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:46 UTC
[26/50] [abbrv] incubator-geode git commit: Added SecurityTest to the
Category. Reformatted to latest code style configuration.
Added SecurityTest to the Category. Reformatted to latest code style configuration.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/2557979b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/2557979b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/2557979b
Branch: refs/heads/develop
Commit: 2557979bff3ccf6a2a034fae885e938c217bd3ed
Parents: 3879310
Author: Kevin J. Duling <kd...@pivotal.io>
Authored: Wed Jun 29 15:15:27 2016 -0700
Committer: Kevin J. Duling <kd...@pivotal.io>
Committed: Wed Jun 29 15:15:27 2016 -0700
----------------------------------------------------------------------
.../security/IntegratedClientAuthDUnitTest.java | 25 +++--
...tedClientContainsKeyAuthDistributedTest.java | 3 +-
...entDestroyInvalidateAuthDistributedTest.java | 23 ++--
...dClientDestroyRegionAuthDistributedTest.java | 40 ++++---
...lientExecuteFunctionAuthDistributedTest.java | 3 +-
...xecuteRegionFunctionAuthDistributedTest.java | 6 +-
...tegratedClientGetAllAuthDistributedTest.java | 3 +-
...tGetClientPRMetaDataAuthDistributedTest.java | 28 ++---
...ientPartitionAttrCmdAuthDistributedTest.java | 12 ++-
...gratedClientGetEntryAuthDistributedTest.java | 37 +++----
...tegratedClientGetPutAuthDistributedTest.java | 58 +++++------
...tedClientRegionClearAuthDistributedTest.java | 23 ++--
...ientRegisterInterestAuthDistributedTest.java | 104 +++++++++----------
...ratedClientRemoveAllAuthDistributedTest.java | 25 +++--
...IntegratedClientSizeAuthDistributedTest.java | 3 +-
...ntUnregisterInterestAuthDistributedTest.java | 19 ++--
16 files changed, 201 insertions(+), 211 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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 ccdc966..9eb12c4 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
@@ -19,26 +19,26 @@ package com.gemstone.gemfire.security;
import static com.googlecode.catchexception.CatchException.*;
import static org.assertj.core.api.Assertions.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
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 com.gemstone.gemfire.test.junit.categories.SecurityTest;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
+@Category({ DistributedTest.class, SecurityTest.class })
public class IntegratedClientAuthDUnitTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
public void authWithCorrectPasswordShouldPass() {
client1.invoke("logging in super-user with correct password", () -> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("super-user", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ ClientCache cache = new ClientCacheFactory(createClientProperties("super-user", "1234567")).setPoolSubscriptionEnabled(true)
+ .addPoolServer("localhost", serverPort)
+ .create();
ClientRegionFactory<String, String> crf = cache.createClientRegionFactory(ClientRegionShortcut.PROXY);
@@ -53,14 +53,13 @@ public class IntegratedClientAuthDUnitTest extends AbstractIntegratedClientAuthD
client2.invoke("logging in super-user with wrong password", () -> {
AuthenticationFailedException expected = new AuthenticationFailedException("Authentication error. Please check your username/password.");
- catchException(new ClientCacheFactory(createClientProperties("super-user", "wrong"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort))
- .create();
+ 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);
+ assertThat((Throwable) caughtException()).hasCause(expected);
});
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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 558c427..f5bbcd4 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
@@ -25,8 +25,9 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
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 IntegratedClientContainsKeyAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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 1b3ae21..febc608 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,17 +18,18 @@ 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.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;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
+@Category({ DistributedTest.class, SecurityTest.class })
public class IntegratedClientDestroyInvalidateAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
@@ -36,10 +37,9 @@ public class IntegratedClientDestroyInvalidateAuthDistributedTest extends Abstra
// Delete one key and invalidate another key with an authorized user.
AsyncInvocation ai1 = client1.invokeAsync(() -> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("dataUser", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ ClientCache cache = new ClientCacheFactory(createClientProperties("dataUser", "1234567")).setPoolSubscriptionEnabled(true)
+ .addPoolServer("localhost", serverPort)
+ .create();
Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
assertTrue(region.containsKeyOnServer("key1"));
@@ -57,10 +57,9 @@ public class IntegratedClientDestroyInvalidateAuthDistributedTest extends Abstra
// Delete one key and invalidate another key with an unauthorized user.
AsyncInvocation ai2 = client2.invokeAsync(() -> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionReader", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionReader", "1234567")).setPoolSubscriptionEnabled(true)
+ .addPoolServer("localhost", serverPort)
+ .create();
Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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 42d55f7..8f81c18 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
@@ -18,45 +18,43 @@ package com.gemstone.gemfire.security;
import static org.assertj.core.api.Assertions.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
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 com.gemstone.gemfire.test.junit.categories.SecurityTest;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
+@Category({ DistributedTest.class, SecurityTest.class })
public class IntegratedClientDestroyRegionAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
public void testDestroyRegion() throws InterruptedException {
- client1.invoke(()-> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("dataWriter", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ client1.invoke(() -> {
+ 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");
+ assertNotAuthorized(() -> region.destroyRegion(), "DATA:MANAGE");
});
- client2.invoke(()-> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionManager", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ client2.invoke(() -> {
+ 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");
+ assertNotAuthorized(() -> region.destroyRegion(), "DATA:MANAGE");
});
- client3.invoke(()-> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("super-user", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ client3.invoke(() -> {
+ 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();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteFunctionAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteFunctionAuthDistributedTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteFunctionAuthDistributedTest.java
index 089517a..5af9f4c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteFunctionAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteFunctionAuthDistributedTest.java
@@ -25,8 +25,9 @@ import com.gemstone.gemfire.cache.execute.FunctionService;
import com.gemstone.gemfire.cache.execute.ResultCollector;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
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 IntegratedClientExecuteFunctionAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
private final static Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteRegionFunctionAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteRegionFunctionAuthDistributedTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteRegionFunctionAuthDistributedTest.java
index ee5dff1..3665f63 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteRegionFunctionAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientExecuteRegionFunctionAuthDistributedTest.java
@@ -25,9 +25,11 @@ import com.gemstone.gemfire.cache.execute.FunctionService;
import com.gemstone.gemfire.cache.execute.ResultCollector;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
-@Category(DistributedTest.class)
-public class IntegratedClientExecuteRegionFunctionAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
+@Category({ DistributedTest.class, SecurityTest.class })
+public class IntegratedClientExecuteRegionFunctionAuthDistributedTest
+ extends AbstractIntegratedClientAuthDistributedTest {
private final static Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetAllAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetAllAuthDistributedTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetAllAuthDistributedTest.java
index 792fa87..955f716 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetAllAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetAllAuthDistributedTest.java
@@ -28,8 +28,9 @@ import org.junit.experimental.categories.Category;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
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 IntegratedClientGetAllAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPRMetaDataAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPRMetaDataAuthDistributedTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPRMetaDataAuthDistributedTest.java
index 899100e..dc2ecbd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPRMetaDataAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPRMetaDataAuthDistributedTest.java
@@ -27,34 +27,34 @@ import com.gemstone.gemfire.cache.client.internal.ClientMetadataService;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
-@Category(DistributedTest.class)
-public class IntegratedClientGetClientPRMetaDataAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
+@Category({ DistributedTest.class, SecurityTest.class })
+public class IntegratedClientGetClientPRMetaDataAuthDistributedTest
+ extends AbstractIntegratedClientAuthDistributedTest {
@Test
public void testGetClientPartitionAttrCmd() {
client1.invoke("logging in stranger", () -> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567")).setPoolSubscriptionEnabled(true)
+ .addPoolServer("localhost", serverPort)
+ .create();
Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
- ClientMetadataService service = ((GemFireCacheImpl)cache).getClientMetadataService();
- assertNotAuthorized(() -> service.getClientPRMetadata((LocalRegion)cache.getRegion(region.getName())), "CLUSTER:READ");
+ ClientMetadataService service = ((GemFireCacheImpl) cache).getClientMetadataService();
+ assertNotAuthorized(() -> service.getClientPRMetadata((LocalRegion) cache.getRegion(region.getName())), "CLUSTER:READ");
});
client2.invoke("logging in super-user", () -> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("super-user", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ ClientCache cache = new ClientCacheFactory(createClientProperties("super-user", "1234567")).setPoolSubscriptionEnabled(true)
+ .addPoolServer("localhost", serverPort)
+ .create();
Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
- ClientMetadataService service = ((GemFireCacheImpl)cache).getClientMetadataService();
- service.getClientPRMetadata((LocalRegion)cache.getRegion(region.getName()));
+ ClientMetadataService service = ((GemFireCacheImpl) cache).getClientMetadataService();
+ service.getClientPRMetadata((LocalRegion) cache.getRegion(region.getName()));
});
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPartitionAttrCmdAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPartitionAttrCmdAuthDistributedTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPartitionAttrCmdAuthDistributedTest.java
index 52c4a0c..05ce282 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPartitionAttrCmdAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetClientPartitionAttrCmdAuthDistributedTest.java
@@ -23,22 +23,24 @@ import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.internal.GetClientPartitionAttributesOp;
import com.gemstone.gemfire.cache.client.internal.PoolImpl;
import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
-@Category(DistributedTest.class)
-public class IntegratedClientGetClientPartitionAttrCmdAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
+@Category({ DistributedTest.class, SecurityTest.class })
+public class IntegratedClientGetClientPartitionAttrCmdAuthDistributedTest
+ extends AbstractIntegratedClientAuthDistributedTest {
@Test
public void testGetClientPartitionAttrCmd() {
client1.invoke("logging in stranger", () -> {
- ClientCache cache =createClientCache("stranger", "1234567", serverPort);
+ ClientCache cache = createClientCache("stranger", "1234567", serverPort);
- assertNotAuthorized(() -> GetClientPartitionAttributesOp.execute((PoolImpl)cache.getDefaultPool(), REGION_NAME), "CLUSTER:READ");
+ assertNotAuthorized(() -> GetClientPartitionAttributesOp.execute((PoolImpl) cache.getDefaultPool(), REGION_NAME), "CLUSTER:READ");
});
client2.invoke("logging in super-user with correct password", () -> {
ClientCache cache = createClientCache("super-user", "1234567", serverPort);
- GetClientPartitionAttributesOp.execute((PoolImpl)cache.getDefaultPool(), REGION_NAME);
+ GetClientPartitionAttributesOp.execute((PoolImpl) cache.getDefaultPool(), REGION_NAME);
});
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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
index b4eff71..8472af9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetEntryAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientGetEntryAuthDistributedTest.java
@@ -17,6 +17,9 @@
package com.gemstone.gemfire.security;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.CacheTransactionManager;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
@@ -24,48 +27,42 @@ 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;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
-public class IntegratedClientGetEntryAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest{
+@Category({ DistributedTest.class, SecurityTest.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();
+ 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 {
+ 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();
+ 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 {
+ } finally {
transactionManager.commit();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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 37f9e80..e04ad3f 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,17 +24,18 @@ 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.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;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
+@Category({ DistributedTest.class, SecurityTest.class })
public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
@@ -48,34 +49,32 @@ public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegrate
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();
+ 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);
- 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");
});
// client2 connects to user as a user authorized to use AuthRegion region
- AsyncInvocation ai2 = client2.invokeAsync(()->{
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ AsyncInvocation ai2 = client2.invokeAsync(() -> {
+ ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser", "1234567")).setPoolSubscriptionEnabled(true)
+ .addPoolServer("localhost", serverPort)
+ .create();
Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
@@ -86,7 +85,7 @@ public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegrate
region.putAll(allValues);
// get all
- Map keyValues = region.getAll(keys);
+ Map keyValues = region.getAll(keys);
assertEquals(2, keyValues.size());
// keyset
@@ -95,25 +94,24 @@ public class IntegratedClientGetPutAuthDistributedTest extends AbstractIntegrate
});
// 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();
+ 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);
- 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
- assertNotAuthorized(()->region.keySetOnServer(), "DATA:READ:AuthRegion");
+ assertNotAuthorized(() -> region.keySetOnServer(), "DATA:READ:AuthRegion");
});
ai1.join();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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 44985c7..1e63f53 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,17 +16,18 @@
*/
package com.gemstone.gemfire.security;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
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;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
+@Category({ DistributedTest.class, SecurityTest.class })
public class IntegratedClientRegionClearAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
@@ -35,10 +36,9 @@ public class IntegratedClientRegionClearAuthDistributedTest extends AbstractInte
SerializableRunnable clearUnauthorized = new SerializableRunnable() {
@Override
public void run() {
- ClientCache cache = new ClientCacheFactory(createClientProperties("stranger", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ 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");
@@ -50,10 +50,9 @@ public class IntegratedClientRegionClearAuthDistributedTest extends AbstractInte
SerializableRunnable clearAuthorized = new SerializableRunnable() {
@Override
public void run() {
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ 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/2557979b/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 373b7dd..0036a38 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,52 +19,50 @@ package com.gemstone.gemfire.security;
import java.util.ArrayList;
import java.util.List;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
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;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
+@Category({ DistributedTest.class, SecurityTest.class })
public class IntegratedClientRegisterInterestAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
public void testRegisterInterest() 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();
+ 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);
- assertNotAuthorized(()->region.registerInterest("key3"), "DATA:READ:AuthRegion:key3");
+ assertNotAuthorized(() -> region.registerInterest("key3"), "DATA:READ:AuthRegion:key3");
});
// client2 connects to user as a user authorized to use AuthRegion region
- AsyncInvocation ai2 = client2.invokeAsync(()->{
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ AsyncInvocation ai2 = client2.invokeAsync(() -> {
+ 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(()->{
- ClientCache cache = new ClientCacheFactory(createClientProperties("key1User", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ 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);
- assertNotAuthorized(()->region.registerInterest("key2"), "DATA:READ:AuthRegion:key2");
+ assertNotAuthorized(() -> region.registerInterest("key2"), "DATA:READ:AuthRegion:key2");
});
ai1.join();
@@ -79,37 +77,34 @@ public class IntegratedClientRegisterInterestAuthDistributedTest extends Abstrac
@Test
public void testRegisterInterestRegex() 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();
+ 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);
- assertNotAuthorized(()->region.registerInterestRegex("key.*"), "DATA:READ:AuthRegion");
+ assertNotAuthorized(() -> region.registerInterestRegex("key.*"), "DATA:READ:AuthRegion");
});
// client2 connects to user as a user authorized to use AuthRegion region
- AsyncInvocation ai2 = client2.invokeAsync(()->{
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ AsyncInvocation ai2 = client2.invokeAsync(() -> {
+ 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(()->{
- ClientCache cache = new ClientCacheFactory(createClientProperties("key1User", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ 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);
- assertNotAuthorized(()->region.registerInterestRegex("key[0-9]+"), "DATA:READ:AuthRegion");
- assertNotAuthorized(()->region.registerInterestRegex("key1"), "DATA:READ:AuthRegion");
+ assertNotAuthorized(() -> region.registerInterestRegex("key[0-9]+"), "DATA:READ:AuthRegion");
+ assertNotAuthorized(() -> region.registerInterestRegex("key1"), "DATA:READ:AuthRegion");
});
ai1.join();
@@ -128,36 +123,33 @@ public class IntegratedClientRegisterInterestAuthDistributedTest extends Abstrac
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();
+ 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);
- assertNotAuthorized(()->region.registerInterest(keys), "DATA:READ:AuthRegion");
+ assertNotAuthorized(() -> region.registerInterest(keys), "DATA:READ:AuthRegion");
});
// client2 connects to user as a user authorized to use AuthRegion region
- AsyncInvocation ai2 = client2.invokeAsync(()->{
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ AsyncInvocation ai2 = client2.invokeAsync(() -> {
+ 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(()->{
- ClientCache cache = new ClientCacheFactory(createClientProperties("key1User", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ 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);
- assertNotAuthorized(()->region.registerInterest(keys), "DATA:READ:AuthRegion");
+ assertNotAuthorized(() -> region.registerInterest(keys), "DATA:READ:AuthRegion");
});
ai1.join();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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 46ed1b8..8eb4ebf 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
@@ -20,42 +20,41 @@ import static org.junit.Assert.*;
import java.util.Arrays;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
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;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
+@Category({ DistributedTest.class, SecurityTest.class })
public class IntegratedClientRemoveAllAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
public void testRemoveAll() throws InterruptedException {
AsyncInvocation ai1 = client1.invokeAsync(() -> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionReader", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ 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(() -> {
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionWriter", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ 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");
+ assertNotAuthorized(() -> region.containsKeyOnServer("key1"), "DATA:READ:AuthRegion:key1");
});
ai1.join();
ai2.join();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientSizeAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientSizeAuthDistributedTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientSizeAuthDistributedTest.java
index d0624a9..b1c1258 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientSizeAuthDistributedTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/IntegratedClientSizeAuthDistributedTest.java
@@ -26,8 +26,9 @@ import com.gemstone.gemfire.cache.client.internal.InternalPool;
import com.gemstone.gemfire.cache.client.internal.SizeOp;
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 IntegratedClientSizeAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
@Test
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2557979b/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 082474a..e6152ee 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,26 +16,27 @@
*/
package com.gemstone.gemfire.security;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
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;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+@Category({ DistributedTest.class, SecurityTest.class })
+public class IntegratedClientUnregisterInterestAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest {
-@Category(DistributedTest.class)
-public class IntegratedClientUnregisterInterestAuthDistributedTest extends AbstractIntegratedClientAuthDistributedTest{
@Test
public void testUnregisterInterest() throws InterruptedException {
// client2 connects to user as a user authorized to use AuthRegion region
- AsyncInvocation ai1 = client2.invokeAsync(()->{
- ClientCache cache = new ClientCacheFactory(createClientProperties("authRegionUser", "1234567"))
- .setPoolSubscriptionEnabled(true)
- .addPoolServer("localhost", serverPort)
- .create();
+ AsyncInvocation ai1 = client2.invokeAsync(() -> {
+ 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");