You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ji...@apache.org on 2016/07/08 15:51:48 UTC

[28/50] [abbrv] incubator-geode git commit: Merge branch 'feature/GEODE-1571' of ssh://github.com/jinmeiliao/incubator-geode into feature/GEODE-1571

Merge branch 'feature/GEODE-1571' of ssh://github.com/jinmeiliao/incubator-geode into feature/GEODE-1571

# Conflicts:
#	geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java


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

Branch: refs/heads/develop
Commit: aa2007baae9f0ecd5367c8d917bb3a511a39c58a
Parents: 39c5684 2557979
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Thu Jun 30 12:00:25 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Thu Jun 30 12:00:25 2016 -0700

----------------------------------------------------------------------
 .../cache/tier/sockets/command/Size.java        | 141 ++++++++-----------
 .../security/IntegratedClientAuthDUnitTest.java |  25 ++--
 ...tedClientContainsKeyAuthDistributedTest.java |   3 +-
 ...entDestroyInvalidateAuthDistributedTest.java |  23 ++-
 ...dClientDestroyRegionAuthDistributedTest.java |  40 +++---
 ...lientExecuteFunctionAuthDistributedTest.java |  61 ++++++++
 ...xecuteRegionFunctionAuthDistributedTest.java |  62 ++++++++
 ...tegratedClientGetAllAuthDistributedTest.java |   3 +-
 ...tGetClientPRMetaDataAuthDistributedTest.java |  28 ++--
 ...ientPartitionAttrCmdAuthDistributedTest.java |  12 +-
 ...gratedClientGetEntryAuthDistributedTest.java |  37 +++--
 ...tegratedClientGetPutAuthDistributedTest.java |  25 ++--
 ...tedClientRegionClearAuthDistributedTest.java |  23 ++-
 ...ientRegisterInterestAuthDistributedTest.java | 104 +++++++-------
 ...ratedClientRemoveAllAuthDistributedTest.java |  25 ++--
 ...IntegratedClientSizeAuthDistributedTest.java |  58 ++++++++
 ...ntUnregisterInterestAuthDistributedTest.java |  19 +--
 17 files changed, 417 insertions(+), 272 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aa2007ba/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
index 0630ecf,e04ad3f..630e340
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetPutAuthDistributedTest.java
@@@ -29,10 -29,13 +29,11 @@@ import org.junit.experimental.categorie
  
  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 com.gemstone.gemfire.test.junit.categories.SecurityTest;
  
- @Category(DistributedTest.class)
+ @Category({ DistributedTest.class, SecurityTest.class })
  public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
  
    @Test
@@@ -46,21 -49,24 +47,21 @@@
      keys.add("key2");
  
      // 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();
 -
 -      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
 +    AsyncInvocation ai1 =  client1.invokeAsync(()->{
 +      ClientCache cache = createClientCache("stranger", "1234567", serverPort);
 +      Region region = cache.getRegion(REGION_NAME);
  
-       assertNotAuthorized(()->region.put("key3", "value3"), "DATA:WRITE:AuthRegion:key3");
-       assertNotAuthorized(()->region.get("key3"), "DATA:READ:AuthRegion:key3");
+       assertNotAuthorized(() -> region.put("key3", "value3"), "DATA:WRITE:AuthRegion:key3");
+       assertNotAuthorized(() -> region.get("key3"), "DATA:READ:AuthRegion:key3");
  
        //putall
-       assertNotAuthorized(()->region.putAll(allValues), "DATA:WRITE:AuthRegion");
+       assertNotAuthorized(() -> region.putAll(allValues), "DATA:WRITE:AuthRegion");
  
        // not authorized for either keys, get no record back
-       Map keyValues =  region.getAll(keys);
+       Map keyValues = region.getAll(keys);
        assertEquals(0, keyValues.size());
  
-       assertNotAuthorized(()->region.keySetOnServer(), "DATA:READ:AuthRegion");
+       assertNotAuthorized(() -> region.keySetOnServer(), "DATA:READ:AuthRegion");
      });
  
  
@@@ -85,17 -94,20 +86,17 @@@
      });
  
      // client3 connects to user as a user authorized to use key1 in AuthRegion region
 -    AsyncInvocation ai3 = client3.invokeAsync(() -> {
 -      ClientCache cache = new ClientCacheFactory(createClientProperties("key1User", "1234567")).setPoolSubscriptionEnabled(true)
 -                                                                                               .addPoolServer("localhost", serverPort)
 -                                                                                               .create();
 -
 -      Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
 +    AsyncInvocation ai3 =  client3.invokeAsync(()->{
 +      ClientCache cache = createClientCache("key1User", "1234567", serverPort);
 +      Region region = cache.getRegion(REGION_NAME);
  
-       assertNotAuthorized(()->region.put("key2", "value1"), "DATA:WRITE:AuthRegion:key2");
-       assertNotAuthorized(()->region.get("key2"), "DATA:READ:AuthRegion:key2");
+       assertNotAuthorized(() -> region.put("key2", "value1"), "DATA:WRITE:AuthRegion:key2");
+       assertNotAuthorized(() -> region.get("key2"), "DATA:READ:AuthRegion:key2");
  
-       assertNotAuthorized(()->region.putAll(allValues), "DATA:WRITE:AuthRegion");
+       assertNotAuthorized(() -> region.putAll(allValues), "DATA:WRITE:AuthRegion");
  
        // only authorized for one recrod
-       Map keyValues =  region.getAll(keys);
+       Map keyValues = region.getAll(keys);
        assertEquals(1, keyValues.size());
  
        // keyset