geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [46/50] [abbrv] incubator-geode git commit: Created GetEntry Test and removed use of SecurityTestUtils
Date Mon, 27 Jun 2016 21:21:36 GMT
Created GetEntry Test and removed use of SecurityTestUtils


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

Branch: refs/heads/feature/GEODE-1571
Commit: 98244ecef5fed7c06481d59852ed20bf6f766e2b
Parents: 536c13b
Author: gmeilen <gracemeilen@gmail.com>
Authored: Mon Jun 27 11:19:50 2016 -0700
Committer: gmeilen <gracemeilen@gmail.com>
Committed: Mon Jun 27 11:19:50 2016 -0700

----------------------------------------------------------------------
 .../cache/tier/sockets/command/GetEntry70.java  |  1 +
 ...ractIntegratedClientAuthDistributedTest.java | 71 +++++++++++++----
 .../security/IntegratedClientAuthDUnitTest.java | 36 ++++++++-
 ...tedClientContainsKeyAuthDistributedTest.java | 27 ++++++-
 ...entDestroyInvalidateAuthDistributedTest.java | 31 +++++---
 ...dClientDestroyRegionAuthDistributedTest.java | 31 ++++++--
 ...gratedClientGetEntryAuthDistributedTest.java | 80 ++++++++++++++++++++
 ...tegratedClientGetPutAuthDistributedTest.java | 34 ++++++---
 ...ntegratedClientQueryAuthDistributedTest.java | 12 ++-
 ...tedClientRegionClearAuthDistributedTest.java | 20 +++--
 ...ientRegisterInterestAuthDistributedTest.java | 76 ++++++++++++++-----
 ...ratedClientRemoveAllAuthDistributedTest.java | 28 ++++---
 ...ntUnregisterInterestAuthDistributedTest.java | 12 ++-
 13 files changed, 369 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GetEntry70.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GetEntry70.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GetEntry70.java
index d975f1b..715da7f 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GetEntry70.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GetEntry70.java
@@ -24,6 +24,7 @@ import com.gemstone.gemfire.internal.cache.NonLocalRegionEntry;
 import com.gemstone.gemfire.internal.cache.tier.Command;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
+import com.gemstone.gemfire.internal.security.GeodeSecurityUtil;
 
 /**
  * getEntry(key) operation performed on server.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/AbstractIntegratedClientAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/AbstractIntegratedClientAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/AbstractIntegratedClientAuthDistributedTest.java
index 4a2db57..5243bd5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/AbstractIntegratedClientAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/AbstractIntegratedClientAuthDistributedTest.java
@@ -16,21 +16,39 @@
  */
 package com.gemstone.gemfire.security;
 
-import static com.gemstone.gemfire.security.SecurityTestUtils.*;
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.fail;
+import static com.gemstone.gemfire.test.dunit.DistributedTestUtils.getDUnitLocatorPort;
+import static com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter;
+import static com.gemstone.gemfire.test.dunit.NetworkUtils.getIPLiteral;
 import static org.assertj.core.api.Assertions.*;
 import static org.junit.Assert.*;
 
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.management.internal.security.JSONAuthorization;
+import com.gemstone.gemfire.security.templates.UserPasswordAuthInit;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.VM;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
 import org.junit.After;
 import org.junit.Before;
 
-public class AbstractIntegratedClientAuthDistributedTest extends JUnit4DistributedTestCase
{
+public class AbstractIntegratedClientAuthDistributedTest extends JUnit4CacheTestCase {
+
+  protected static final String REGION_NAME = "AuthRegion";
 
   protected VM client1 = null;
   protected VM client2 = null;
@@ -40,14 +58,30 @@ public class AbstractIntegratedClientAuthDistributedTest extends JUnit4Distribut
   @Before
   public void before() throws Exception{
     final Host host = Host.getHost(0);
-    client1 = host.getVM(1);
-    client2 = host.getVM(2);
-    client3 = host.getVM(3);
+    this.client1 = host.getVM(1);
+    this.client2 = host.getVM(2);
+    this.client3 = host.getVM(3);
 
     JSONAuthorization.setUpWithJsonFile("clientServer.json");
-    serverPort =  SecurityTestUtils.createCacheServer(JSONAuthorization.class.getName()+".create");
-    Region region = getCache().getRegion(SecurityTestUtils.REGION_NAME);
-    assertEquals(0, region.size());
+
+    Properties props = new Properties();
+    props.setProperty(SECURITY_CLIENT_AUTHENTICATOR, JSONAuthorization.class.getName()+".create");
+    props.setProperty(MCAST_PORT, "0");
+    props.setProperty(LOCATORS, "");
+    props.setProperty(SECURITY_LOG_LEVEL, "finest");
+
+    getSystem(props);
+
+    Cache cache = getCache();
+
+    Region region = cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+
+    CacheServer server1 = cache.addCacheServer();
+    server1.setPort(0);
+    server1.start();
+
+    this.serverPort = server1.getPort();
+
     for (int i = 0; i < 5; i++) {
       String key = "key" + i;
       String value = "value" + i;
@@ -56,11 +90,9 @@ public class AbstractIntegratedClientAuthDistributedTest extends JUnit4Distribut
     assertEquals(5, region.size());
   }
 
-  @After
-  public void after(){
-    client1.invoke(() -> closeCache());
-    client2.invoke(() -> closeCache());
-    client3.invoke(() -> closeCache());
+  @Override
+  public void preTearDownCacheTestCase() throws Exception {
+    Invoke.invokeInEveryVM(()->closeCache());
     closeCache();
   }
 
@@ -68,4 +100,15 @@ public class AbstractIntegratedClientAuthDistributedTest extends JUnit4Distribut
     assertThatThrownBy(shouldRaiseThrowable).hasMessageContaining(permString);
   }
 
+  protected Properties createClientProperties(String userName, String password) {
+    Properties props = new Properties();
+    props.setProperty(UserPasswordAuthInit.USER_NAME, userName);
+    props.setProperty(UserPasswordAuthInit.PASSWORD, password);
+    props.setProperty(SECURITY_CLIENT_AUTH_INIT, UserPasswordAuthInit.class.getName() + ".create");
+    props.setProperty(MCAST_PORT, "0");
+    props.setProperty(LOCATORS, "");
+    props.setProperty(SECURITY_LOG_LEVEL, "finest");
+    return props;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientAuthDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientAuthDUnitTest.java
index 10a8f73..ccdc966 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientAuthDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientAuthDUnitTest.java
@@ -16,6 +16,14 @@
  */
 package com.gemstone.gemfire.security;
 
+import static com.googlecode.catchexception.CatchException.*;
+import static org.assertj.core.api.Assertions.*;
+
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 import org.junit.Test;
@@ -25,14 +33,34 @@ import org.junit.experimental.categories.Category;
 public class IntegratedClientAuthDUnitTest extends AbstractIntegratedClientAuthDistributedTest
{
 
   @Test
-  public void testAuthentication(){
-    int port = serverPort;
+  public void authWithCorrectPasswordShouldPass() {
     client1.invoke("logging in super-user with correct password", () -> {
-      SecurityTestUtils.createCacheClient("super-user", "1234567", port, SecurityTestUtils.NO_EXCEPTION);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("super-user", "1234567"))
+          .setPoolSubscriptionEnabled(true)
+          .addPoolServer("localhost", serverPort)
+          .create();
+
+      ClientRegionFactory<String, String> crf = cache.createClientRegionFactory(ClientRegionShortcut.PROXY);
+
+      crf.create(REGION_NAME);
     });
+  }
+
+  @Test
+  public void authWithIncorrectPasswordShouldFail() {
+    IgnoredException.addIgnoredException(AuthenticationFailedException.class.getName());
 
     client2.invoke("logging in super-user with wrong password", () -> {
-      SecurityTestUtils.createCacheClient("super-user", "wrong", port, SecurityTestUtils.AUTHFAIL_EXCEPTION);
+      AuthenticationFailedException expected = new AuthenticationFailedException("Authentication
error. Please check your username/password.");
+
+      catchException(new ClientCacheFactory(createClientProperties("super-user", "wrong"))
+          .setPoolSubscriptionEnabled(true)
+          .addPoolServer("localhost", serverPort))
+          .create();
+
+      //throw caughtException(); // TODO: gemfire-mm review as team
+
+      assertThat((Throwable)caughtException()).hasCause(expected);
     });
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
index 87535db..a02b49c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientContainsKeyAuthDistributedTest.java
@@ -18,20 +18,25 @@ package com.gemstone.gemfire.security;
 
 import static org.junit.Assert.*;
 
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 @Category(DistributedTest.class)
 public class IntegratedClientContainsKeyAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest
{
 
   @Test
   public void testContainsKey() throws InterruptedException {
-
+//    AsyncInvocation ai1 = client1.invokeAsync("containsKey with permission", () -> {
+//      ClientCache cache = new ClientCacheFactory(createClientProperties("dataReader", "1234567"))
+//          .setPoolSubscriptionEnabled(true)
+//          .addPoolServer("localhost", serverPort)
+//          .create();
+//
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
       Cache cache = SecurityTestUtils.createCacheClient("key1User", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
       final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
@@ -43,7 +48,21 @@ public class IntegratedClientContainsKeyAuthDistributedTest extends AbstractInte
       Cache cache = SecurityTestUtils.createCacheClient("authRegionReader", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
       final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
       region.containsKeyOnServer("key3");
+      assertTrue(region.containsKeyOnServer("key1"));
+
     });
+
+//    AsyncInvocation ai2 = client2.invokeAsync("containsKey without permission", () ->
{
+//      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionReader",
"1234567"))
+//        .setPoolSubscriptionEnabled(true)
+//        .addPoolServer("localhost", serverPort)
+//        .create();
+//
+//      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
+//      assertNotAuthorized(() -> region.containsKeyOnServer("key3"), "DATA:READ");
+
+//    });
+
     ai1.join();
     ai2.join();
     ai1.checkException();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyInvalidateAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyInvalidateAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyInvalidateAuthDistributedTest.java
index e78ed62..1b3ae21 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyInvalidateAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyInvalidateAuthDistributedTest.java
@@ -18,8 +18,10 @@ package com.gemstone.gemfire.security;
 
 import static org.junit.Assert.*;
 
-import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
@@ -34,15 +36,17 @@ public class IntegratedClientDestroyInvalidateAuthDistributedTest extends
Abstra
 
     // Delete one key and invalidate another key with an authorized user.
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionUser", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("dataUser", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
 
-      assertEquals(region.get("key1"), "value1");
-      assertTrue(region.containsKey("key1")); // will only be true after we first get it,
then it's cached locally
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
+      assertTrue(region.containsKeyOnServer("key1"));
 
       // Destroy key1
       region.destroy("key1");
-      assertFalse(region.containsKey("key1"));
+      assertFalse(region.containsKeyOnServer("key1"));
 
       // Invalidate key2
       assertNotNull("Value of key2 should not be null", region.get("key2"));
@@ -53,22 +57,25 @@ public class IntegratedClientDestroyInvalidateAuthDistributedTest extends
Abstra
 
     // Delete one key and invalidate another key with an unauthorized user.
     AsyncInvocation ai2 = client2.invokeAsync(() -> {
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionReader", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionReader",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
 
-      assertEquals(region.get("key3"), "value3");
-      assertTrue(region.containsKey("key3")); // will only be true after we first get it,
then it's cached locally
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
+
+      assertTrue(region.containsKeyOnServer("key3"));
 
       // Destroy key1
       assertNotAuthorized(() -> region.destroy("key3"), "DATA:WRITE:AuthRegion");
-      assertTrue(region.containsKey("key3"));
+      assertTrue(region.containsKeyOnServer("key3"));
 
       // Invalidate key2
       assertNotNull("Value of key4 should not be null", region.get("key4"));
       assertNotAuthorized(() -> region.invalidate("key4"), "DATA:WRITE:AuthRegion");
       assertNotNull("Value of key4 should not be null", region.get("key4"));
-      cache.close();
     });
+
     ai1.join();
     ai2.join();
     ai1.checkException();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyRegionAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyRegionAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyRegionAuthDistributedTest.java
index a9cc354..42d55f7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyRegionAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientDestroyRegionAuthDistributedTest.java
@@ -16,8 +16,12 @@
  */
 package com.gemstone.gemfire.security;
 
-import com.gemstone.gemfire.cache.Cache;
+import static org.assertj.core.api.Assertions.*;
+
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 import org.junit.Test;
@@ -29,21 +33,34 @@ public class IntegratedClientDestroyRegionAuthDistributedTest extends
AbstractIn
   @Test
   public void testDestroyRegion() throws InterruptedException {
     client1.invoke(()-> {
-      Cache cache = SecurityTestUtils.createCacheClient("dataWriter", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("dataWriter", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(()->region.destroyRegion(), "DATA:MANAGE");
     });
 
     client2.invoke(()-> {
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionManager", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionManager",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(()->region.destroyRegion(), "DATA:MANAGE");
     });
 
     client3.invoke(()-> {
-      Cache cache = SecurityTestUtils.createCacheClient("super-user", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("super-user", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       region.destroyRegion();
+      assertThat(region.isDestroyed()).isTrue();
     });
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetEntryAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetEntryAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetEntryAuthDistributedTest.java
new file mode 100644
index 0000000..b4eff71
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetEntryAuthDistributedTest.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.security;
+
+
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+@Category(DistributedTest.class)
+public class IntegratedClientGetEntryAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest{
+
+  @Test
+  public void testGetEntry() throws InterruptedException {
+    // client1 connects to server as a user not authorized to do any operations
+
+    AsyncInvocation ai1 =  client1.invokeAsync(()->{
+      ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      CacheTransactionManager transactionManager = cache.getCacheTransactionManager();
+      transactionManager.begin();
+      try {
+        Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
+        assertNotAuthorized(()->region.getEntry("key3"), "DATA:READ:AuthRegion:key3");
+      }
+      finally {
+        transactionManager.commit();
+      }
+
+    });
+
+    AsyncInvocation ai2 =  client2.invokeAsync(()->{
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionReader",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      CacheTransactionManager transactionManager = cache.getCacheTransactionManager();
+      transactionManager.begin();
+      try {
+        Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
+        region.getEntry("key3");
+      }
+      finally {
+        transactionManager.commit();
+      }
+
+    });
+
+    ai1.join();
+    ai2.join();
+    ai1.checkException();
+    ai2.checkException();
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
index 4bd7191..37f9e80 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
@@ -24,14 +24,16 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 @Category(DistributedTest.class)
 public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest
{
 
@@ -47,8 +49,12 @@ public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegrate
 
     // client1 connects to server as a user not authorized to do any operations
     AsyncInvocation ai1 =  client1.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("stranger", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
 
       assertNotAuthorized(()->region.put("key3", "value3"), "DATA:WRITE:AuthRegion:key3");
       assertNotAuthorized(()->region.get("key3"), "DATA:READ:AuthRegion:key3");
@@ -66,8 +72,12 @@ public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegrate
 
     // client2 connects to user as a user authorized to use AuthRegion region
     AsyncInvocation ai2 =  client2.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionUser", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
 
       region.put("key3", "value3");
       assertEquals("value3", region.get("key3"));
@@ -86,8 +96,12 @@ public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegrate
 
     // client3 connects to user as a user authorized to use key1 in AuthRegion region
     AsyncInvocation ai3 =  client3.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("key1User", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("key1User", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
 
       assertNotAuthorized(()->region.put("key2", "value1"), "DATA:WRITE:AuthRegion:key2");
       assertNotAuthorized(()->region.get("key2"), "DATA:READ:AuthRegion:key2");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientQueryAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientQueryAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientQueryAuthDistributedTest.java
index 8651a2f..a6a2129 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientQueryAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientQueryAuthDistributedTest.java
@@ -16,8 +16,10 @@
  */
 package com.gemstone.gemfire.security;
 
-import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
@@ -31,8 +33,12 @@ public class IntegratedClientQueryAuthDistributedTest extends AbstractIntegrated
   @Test
   public void testQuery(){
     client1.invoke(()-> {
-      Cache cache = SecurityTestUtils.createCacheClient("stranger", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
 
       String query = "select * from /AuthRegion";
       assertNotAuthorized(()->region.query(query), "DATA:READ:AuthRegion");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegionClearAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegionClearAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegionClearAuthDistributedTest.java
index b344ce1..44985c7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegionClearAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegionClearAuthDistributedTest.java
@@ -16,8 +16,10 @@
  */
 package com.gemstone.gemfire.security;
 
-import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
@@ -33,8 +35,12 @@ public class IntegratedClientRegionClearAuthDistributedTest extends AbstractInte
     SerializableRunnable clearUnauthorized = new SerializableRunnable() {
       @Override
       public void run() {
-        Cache cache = SecurityTestUtils.createCacheClient("stranger", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-        final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+        ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
+          .setPoolSubscriptionEnabled(true)
+          .addPoolServer("localhost", serverPort)
+          .create();
+
+        Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
         assertNotAuthorized(() -> region.clear(), "DATA:WRITE:AuthRegion");
       }
     };
@@ -44,8 +50,12 @@ public class IntegratedClientRegionClearAuthDistributedTest extends AbstractInte
     SerializableRunnable clearAuthorized = new SerializableRunnable() {
       @Override
       public void run() {
-        Cache cache = SecurityTestUtils.createCacheClient("authRegionUser", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-        final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+        ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser",
"1234567"))
+          .setPoolSubscriptionEnabled(true)
+          .addPoolServer("localhost", serverPort)
+          .create();
+
+        Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
         region.clear();
       }
     };

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegisterInterestAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegisterInterestAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegisterInterestAuthDistributedTest.java
index d533a20..373b7dd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegisterInterestAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRegisterInterestAuthDistributedTest.java
@@ -19,8 +19,10 @@ package com.gemstone.gemfire.security;
 import java.util.ArrayList;
 import java.util.List;
 
-import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
@@ -34,22 +36,34 @@ public class IntegratedClientRegisterInterestAuthDistributedTest extends
Abstrac
   public void testRegisterInterest() throws InterruptedException {
     // client1 connects to server as a user not authorized to do any operations
     AsyncInvocation ai1 =  client1.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("stranger", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(()->region.registerInterest("key3"), "DATA:READ:AuthRegion:key3");
     });
 
     // client2 connects to user as a user authorized to use AuthRegion region
     AsyncInvocation ai2 =  client2.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionUser", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       region.registerInterest("key3");  //  DATA:READ:AuthRegion:key3;
     });
 
     // client3 connects to user as a user authorized to use key1 in AuthRegion region
     AsyncInvocation ai3 =  client3.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("key1User", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("key1User", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(()->region.registerInterest("key2"), "DATA:READ:AuthRegion:key2");
     });
 
@@ -66,22 +80,34 @@ public class IntegratedClientRegisterInterestAuthDistributedTest extends
Abstrac
   public void testRegisterInterestRegex() throws InterruptedException {
     //client1 connects to server as a user not authorized to do any operations
     AsyncInvocation ai1 =  client1.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("stranger", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(()->region.registerInterestRegex("key.*"), "DATA:READ:AuthRegion");
     });
 
     // client2 connects to user as a user authorized to use AuthRegion region
     AsyncInvocation ai2 =  client2.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionUser", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       region.registerInterestRegex("key[0-9]+");  //  DATA:READ:AuthRegion:key3;
     });
 
     // client3 connects to user as a user authorized to use key1 in AuthRegion region
     AsyncInvocation ai3 =  client3.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("key1User", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("key1User", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(()->region.registerInterestRegex("key[0-9]+"), "DATA:READ:AuthRegion");
       assertNotAuthorized(()->region.registerInterestRegex("key1"), "DATA:READ:AuthRegion");
     });
@@ -103,22 +129,34 @@ public class IntegratedClientRegisterInterestAuthDistributedTest extends
Abstrac
 
     //client1 connects to server as a user not authorized to do any operations
     AsyncInvocation ai1 =  client1.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("stranger", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(()->region.registerInterest(keys), "DATA:READ:AuthRegion");
     });
 
     // client2 connects to user as a user authorized to use AuthRegion region
     AsyncInvocation ai2 =  client2.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionUser", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       region.registerInterest(keys);  //  DATA:READ:AuthRegion;
     });
 
     // client3 connects to user as a user authorized to use key1 in AuthRegion region
     AsyncInvocation ai3 =  client3.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("key1User", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("key1User", "1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(()->region.registerInterest(keys), "DATA:READ:AuthRegion");
     });
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
index edfbdd6..46ed1b8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientRemoveAllAuthDistributedTest.java
@@ -16,18 +16,20 @@
  */
 package com.gemstone.gemfire.security;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
 
 import java.util.Arrays;
 
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 @Category(DistributedTest.class)
 public class IntegratedClientRemoveAllAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest
{
 
@@ -35,14 +37,22 @@ public class IntegratedClientRemoveAllAuthDistributedTest extends AbstractIntegr
   public void testRemoveAll() throws InterruptedException {
 
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionReader", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionReader",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       assertNotAuthorized(() -> region.removeAll(Arrays.asList("key1", "key2", "key3",
"key4")), "DATA:WRITE:AuthRegion");
     });
 
     AsyncInvocation ai2 = client2.invokeAsync(() -> {
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionWriter", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionWriter",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       region.removeAll(Arrays.asList("key1", "key2", "key3", "key4"));
       assertFalse(region.containsKey("key1"));
       assertNotAuthorized(()->region.containsKeyOnServer("key1"), "DATA:READ:AuthRegion:key1");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98244ece/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientUnregisterInterestAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientUnregisterInterestAuthDistributedTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientUnregisterInterestAuthDistributedTest.java
index aa46882..082474a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientUnregisterInterestAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientUnregisterInterestAuthDistributedTest.java
@@ -16,8 +16,10 @@
  */
 package com.gemstone.gemfire.security;
 
-import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
@@ -30,8 +32,12 @@ public class IntegratedClientUnregisterInterestAuthDistributedTest extends
Abstr
   public void testUnregisterInterest() throws InterruptedException {
     // client2 connects to user as a user authorized to use AuthRegion region
     AsyncInvocation ai1 =  client2.invokeAsync(()->{
-      Cache cache = SecurityTestUtils.createCacheClient("authRegionUser", "1234567", serverPort,
SecurityTestUtils.NO_EXCEPTION);
-      final Region region = cache.getRegion(SecurityTestUtils.REGION_NAME);
+      ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser",
"1234567"))
+        .setPoolSubscriptionEnabled(true)
+        .addPoolServer("localhost", serverPort)
+        .create();
+
+      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
       region.registerInterest("key3");
       region.unregisterInterest("key3");  //  DATA:READ:AuthRegion:key3;
     });



Mime
View raw message