You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2019/03/26 18:40:53 UTC
[geode] branch develop updated: GEODE-4806: Refactor
SimpleTestSecurityManager usages and remove class. (#3261)
This is an automated email from the ASF dual-hosted git repository.
jensdeppe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 60f4f8c GEODE-4806: Refactor SimpleTestSecurityManager usages and remove class. (#3261)
60f4f8c is described below
commit 60f4f8c9aa1eb97b2ae1d28b22828713581141a6
Author: Sean Goller <se...@goller.net>
AuthorDate: Tue Mar 26 11:40:43 2019 -0700
GEODE-4806: Refactor SimpleTestSecurityManager usages and remove class. (#3261)
* ExtendsFunctionAdapter was present in both integrationTest and
distributedTest resource trees. Removing one caused tests to fail.
Moving the class into geode-junit's resources seems to have resolved
the issue.
Co-authored-by: Sean Goller <sg...@pivotal.io>
Co-authored-by: Helena Bales <hb...@pivotal.io>
---
...tandaloneClientManagementAPIAcceptanceTest.java | 2 +-
....java => ManagementClientTestCreateRegion.java} | 0
.../rest/internal/web/RestSecurityWithSSLTest.java | 4 +-
.../web/SwaggerVerificationIntegrationTest.java | 4 +-
.../geode/tools/pulse/PulseSecurityTest.java | 4 +-
.../tools/pulse/PulseSecurityWithSSLTest.java | 6 +-
.../commands/CreateRegionSecurityDUnitTest.java | 4 +-
.../ExecuteFunctionCommandSecurityTest.java | 4 +-
.../ClusterConfigWithSecurityDUnitTest.java | 10 ++--
.../DistributedSystemMXBeanSecurityTest.java | 4 +-
.../internal/security/MultiGfshDUnitTest.java | 4 +-
.../apache/geode/security/ClientAuthDUnitTest.java | 3 +-
.../ClientDestroyInvalidateAuthDUnitTest.java | 3 +-
.../ClientExecuteFunctionAuthDUnitTest.java | 3 +-
.../ClientExecuteRegionFunctionAuthDUnitTest.java | 3 +-
.../ClusterConfigWithoutSecurityDUnitTest.java | 7 ++-
.../ClusterConfigurationSecurityDUnitTest.java | 3 +-
.../geode/security/OtherSimplySecurityManager.java | 4 +-
.../PeerSecurityWithEmbeddedLocatorDUnitTest.java | 3 +-
.../security/SecurityClusterConfigDUnitTest.java | 9 +--
.../SecurityWithoutClusterConfigDUnitTest.java | 3 +-
.../security/StartServerAuthorizationTest.java | 3 +-
.../deployment/ExtendsFunctionAdapter.java | 25 --------
.../CacheServerMBeanAuthenticationJUnitTest.java | 4 +-
.../security/DeployCommandsSecurityTest.java | 4 +-
.../security/DiskStoreMXBeanSecurityJUnitTest.java | 4 +-
.../security/FileUploaderMBeanSecurityTest.java | 4 +-
.../security/GatewayReceiverMBeanSecurityTest.java | 4 +-
.../security/GatewaySenderMBeanSecurityTest.java | 4 +-
.../security/GfshCommandsPostProcessorTest.java | 4 +-
.../LockServiceMBeanAuthorizationJUnitTest.java | 4 +-
.../CacheFactoryWithSecurityObjectTest.java | 3 +-
.../security/SecurityServiceFactoryTest.java | 16 ++---
.../geode/security/SimpleSecurityManagerTest.java | 5 +-
.../geode/security/ClientCQAuthDUnitTest.java | 3 +-
.../security/GfshCommandsSecurityTestBase.java | 4 +-
.../experimental/driver/AuthenticationTest.java | 4 +-
.../experimental/driver/AuthorizationTest.java | 4 +-
.../driver/PostProcessingIntegrationTest.java | 4 +-
.../geode/security/SimpleTestSecurityManager.java | 69 ----------------------
.../apache/geode/security/SpySecurityManager.java | 4 +-
.../deployment/ExtendsFunctionAdapter.java | 0
.../lucene/LuceneClientSecurityDUnitTest.java | 4 +-
.../lucene/LuceneCommandsSecurityDUnitTest.java | 4 +-
.../LocatorConnectionAuthenticationDUnitTest.java | 4 +-
geode-web-management/build.gradle | 14 ++---
.../LocatorWithSecurityManagerContextLoader.java | 4 +-
...xecuteFunctionCommandWithSecurityDUnitTest.java | 4 +-
.../commands/ConnectCommandWithSecurityTest.java | 4 +-
.../shell/HttpOperationInvokerSecurityTest.java | 4 +-
50 files changed, 112 insertions(+), 193 deletions(-)
diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
index 217bd40..92b724c 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/rest/StandaloneClientManagementAPIAcceptanceTest.java
@@ -84,7 +84,7 @@ public class StandaloneClientManagementAPIAcceptanceTest {
public void clientCreatesRegionUsingClusterManagementService() throws Exception {
JarBuilder jarBuilder = new JarBuilder();
String filePath =
- TestUtil.getResourcePath(this.getClass(), "/ManagementClientCreateRegion.java");
+ TestUtil.getResourcePath(this.getClass(), "/ManagementClientTestCreateRegion.java");
assertThat(filePath).as("java file resource not found").isNotBlank();
File outputJar = new File(tempDir.getRoot(), "output.jar");
diff --git a/geode-assembly/src/acceptanceTest/resources/ManagementClientCreateRegion.java b/geode-assembly/src/acceptanceTest/resources/ManagementClientTestCreateRegion.java
similarity index 100%
rename from geode-assembly/src/acceptanceTest/resources/ManagementClientCreateRegion.java
rename to geode-assembly/src/acceptanceTest/resources/ManagementClientTestCreateRegion.java
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
index 88ecebb..02dc83a 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityWithSSLTest.java
@@ -32,8 +32,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.security.SecurableCommunicationChannel;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.RestAPITest;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.GeodeDevRestClient;
@@ -51,7 +51,7 @@ public class RestSecurityWithSSLTest {
@Rule
public ServerStarterRule serverStarter = new ServerStarterRule().withRestService()
- .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName())
+ .withProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName())
.withProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.WEB.getConstant())
.withProperty(SSL_KEYSTORE, KEYSTORE_FILE.getPath())
.withProperty(SSL_KEYSTORE_PASSWORD, "password").withProperty(SSL_KEYSTORE_TYPE, "JKS")
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/SwaggerVerificationIntegrationTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/SwaggerVerificationIntegrationTest.java
index 9879f1f..de14772 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/SwaggerVerificationIntegrationTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/SwaggerVerificationIntegrationTest.java
@@ -25,7 +25,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
-import org.apache.geode.security.SimpleTestSecurityManager;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.junit.categories.RestAPITest;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.GeodeHttpClientRule;
@@ -37,7 +37,7 @@ public class SwaggerVerificationIntegrationTest {
@ClassRule
public static ServerStarterRule serverStarter = new ServerStarterRule()
- .withSecurityManager(SimpleTestSecurityManager.class).withRestService().withAutoStart();
+ .withSecurityManager(SimpleSecurityManager.class).withRestService().withAutoStart();
@Rule
public GeodeHttpClientRule client = new GeodeHttpClientRule(serverStarter::getHttpPort);
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityTest.java
index d80702a..9bb7a6b 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityTest.java
@@ -25,7 +25,7 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.security.SimpleTestSecurityManager;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.junit.categories.PulseTest;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.EmbeddedPulseRule;
@@ -39,7 +39,7 @@ public class PulseSecurityTest {
@ClassRule
public static ServerStarterRule server =
- new ServerStarterRule().withSecurityManager(SimpleTestSecurityManager.class)
+ new ServerStarterRule().withSecurityManager(SimpleSecurityManager.class)
.withJMXManager().withHttpService()
.withRegion(RegionShortcut.REPLICATE, "regionA");
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
index e0082a3..49aeaa9 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java
@@ -50,8 +50,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.security.SecurableCommunicationChannels;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.PulseTest;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.GeodeHttpClientRule;
@@ -81,7 +81,7 @@ public class PulseSecurityWithSSLTest {
securityProps.setProperty(SSL_PROTOCOLS, "TLSv1.2");
securityProps.setProperty(SSL_CIPHERS, "any");
- locator.withSecurityManager(SimpleTestSecurityManager.class).withProperties(securityProps)
+ locator.withSecurityManager(SimpleSecurityManager.class).withProperties(securityProps)
.startLocator();
HttpResponse response = client.loginToPulse("data", "wrongPassword");
@@ -120,7 +120,7 @@ public class PulseSecurityWithSSLTest {
securityProps.setProperty(HTTP_SERVICE_SSL_TRUSTSTORE, jks.getCanonicalPath());
securityProps.setProperty(HTTP_SERVICE_SSL_TRUSTSTORE_PASSWORD, "password");
- locator.withSecurityManager(SimpleTestSecurityManager.class).withProperties(securityProps)
+ locator.withSecurityManager(SimpleSecurityManager.class).withProperties(securityProps)
.startLocator();
client.loginToPulseAndVerify("cluster", "cluster");
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CreateRegionSecurityDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CreateRegionSecurityDUnitTest.java
index feee5e4..79dd63e 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CreateRegionSecurityDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CreateRegionSecurityDUnitTest.java
@@ -26,8 +26,8 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.security.AuthInitialize;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -45,7 +45,7 @@ public class CreateRegionSecurityDUnitTest {
@BeforeClass
public static void beforeClass() {
locator =
- cluster.startLocatorVM(0, x -> x.withSecurityManager(SimpleTestSecurityManager.class));
+ cluster.startLocatorVM(0, x -> x.withSecurityManager(SimpleSecurityManager.class));
int locatorPort = locator.getPort();
cluster.startServerVM(1,
x -> x.withProperty(AuthInitialize.SECURITY_USERNAME, "cluster")
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandSecurityTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandSecurityTest.java
index 124dcc2..9b0f1bc 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandSecurityTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandSecurityTest.java
@@ -34,12 +34,12 @@ import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.execute.FunctionService;
import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.cache.InternalCache;
import org.apache.geode.management.internal.cli.CliUtil;
import org.apache.geode.management.internal.security.ResourceConstants;
import org.apache.geode.management.internal.security.TestFunctions.ReadFunction;
import org.apache.geode.management.internal.security.TestFunctions.WriteFunction;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -62,7 +62,7 @@ public class ExecuteFunctionCommandSecurityTest implements Serializable {
@BeforeClass
public static void beforeClass() {
Properties locatorProps = new Properties();
- locatorProps.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ locatorProps.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
locator = lsRule.startLocatorVM(0, locatorProps);
Properties serverProps = new Properties();
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigWithSecurityDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigWithSecurityDUnitTest.java
index 33dcd4d..ff76e34 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigWithSecurityDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigWithSecurityDUnitTest.java
@@ -32,10 +32,10 @@ import org.junit.experimental.categories.Category;
import org.apache.geode.distributed.internal.InternalConfigurationPersistenceService;
import org.apache.geode.distributed.internal.InternalLocator;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.cache.InternalCache;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.configuration.utils.ZipUtils;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -62,7 +62,7 @@ public class ClusterConfigWithSecurityDUnitTest {
public void before() throws Exception {
clusterConfigZipPath = buildSecureClusterConfigZip();
locator0 =
- lsRule.startLocatorVM(0, x -> x.withSecurityManager(SimpleTestSecurityManager.class));
+ lsRule.startLocatorVM(0, x -> x.withSecurityManager(SimpleSecurityManager.class));
}
@Test
@@ -80,7 +80,7 @@ public class ClusterConfigWithSecurityDUnitTest {
InternalConfigurationPersistenceService sc = locator.getConfigurationPersistenceService();
Properties clusterConfigProps = sc.getConfiguration("cluster").getGemfireProperties();
assertThat(clusterConfigProps.getProperty(SECURITY_MANAGER))
- .isEqualTo(SimpleTestSecurityManager.class.getName());
+ .isEqualTo(SimpleSecurityManager.class.getName());
assertThat(locator.getConfig().getSecurityManager()).isNotEmpty();
});
}
@@ -104,7 +104,7 @@ public class ClusterConfigWithSecurityDUnitTest {
// the security manager is still the locator's security manager, not the imported one.
assertThat(properties.getProperty(SECURITY_MANAGER))
- .isEqualTo(SimpleTestSecurityManager.class.getName());
+ .isEqualTo(SimpleSecurityManager.class.getName());
});
}
@@ -121,7 +121,7 @@ public class ClusterConfigWithSecurityDUnitTest {
InternalCache cache = ClusterStartupRule.getCache();
Properties properties = cache.getDistributedSystem().getSecurityProperties();
assertThat(properties.getProperty(SECURITY_MANAGER))
- .isEqualTo(SimpleTestSecurityManager.class.getName());
+ .isEqualTo(SimpleSecurityManager.class.getName());
assertThat(cache.getSecurityService().isIntegratedSecurity()).isTrue();
});
}
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/DistributedSystemMXBeanSecurityTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/DistributedSystemMXBeanSecurityTest.java
index ab263fa..a011fa6 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/DistributedSystemMXBeanSecurityTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/DistributedSystemMXBeanSecurityTest.java
@@ -24,9 +24,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.DistributedSystemMXBean;
import org.apache.geode.security.NotAuthorizedException;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.security.TestSecurityManager;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
@@ -41,7 +41,7 @@ public class DistributedSystemMXBeanSecurityTest {
@ClassRule
public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
.withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
- .withSecurityManager(SimpleTestSecurityManager.class).withAutoStart();
+ .withSecurityManager(SimpleSecurityManager.class).withAutoStart();
@Rule
public MBeanServerConnectionRule connectionRule =
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiGfshDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiGfshDUnitTest.java
index dc399f9..bfb70d2 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiGfshDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiGfshDUnitTest.java
@@ -25,12 +25,12 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.logging.LogService;
import org.apache.geode.management.cli.Result.Status;
import org.apache.geode.management.internal.cli.result.CommandResult;
import org.apache.geode.management.internal.cli.result.ErrorResultData;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.dunit.AsyncInvocation;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.VM;
@@ -51,7 +51,7 @@ public class MultiGfshDUnitTest {
@Before
public void setup() throws Exception {
server = lsRule.startServerVM(0,
- x -> x.withJMXManager().withSecurityManager(SimpleTestSecurityManager.class));
+ x -> x.withJMXManager().withSecurityManager(SimpleSecurityManager.class));
}
@Test
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientAuthDUnitTest.java
index c52322f..a36ed0c 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientAuthDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientAuthDUnitTest.java
@@ -32,6 +32,7 @@ import org.apache.geode.cache.client.ClientCache;
import org.apache.geode.cache.client.ClientRegionFactory;
import org.apache.geode.cache.client.ClientRegionShortcut;
import org.apache.geode.cache.client.ServerOperationException;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.rules.ClientVM;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
@@ -58,7 +59,7 @@ public class ClientAuthDUnitTest {
@Rule
public ServerStarterRule server = new ServerStarterRule()
- .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName())
+ .withProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName())
.withRegion(RegionShortcut.REPLICATE, "region");
@Test
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java
index 15edfb1..87ae7fe 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java
@@ -29,6 +29,7 @@ import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.client.ClientCache;
import org.apache.geode.cache.client.ClientRegionShortcut;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.rules.ClientVM;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -44,7 +45,7 @@ public class ClientDestroyInvalidateAuthDUnitTest {
@Rule
public ServerStarterRule server =
new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
- .withSecurityManager(SimpleTestSecurityManager.class).withAutoStart();
+ .withSecurityManager(SimpleSecurityManager.class).withAutoStart();
@Before
public void before() throws Exception {
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java
index e15f3f4..a0b192e 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java
@@ -32,6 +32,7 @@ import org.apache.geode.cache.client.ClientCache;
import org.apache.geode.cache.execute.Function;
import org.apache.geode.cache.execute.ResultCollector;
import org.apache.geode.distributed.ConfigurationProperties;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.internal.security.TestFunctions.ReadFunction;
import org.apache.geode.management.internal.security.TestFunctions.WriteFunction;
import org.apache.geode.test.dunit.rules.ClientVM;
@@ -54,7 +55,7 @@ public class ClientExecuteFunctionAuthDUnitTest {
@BeforeClass
public static void beforeClass() throws Exception {
Properties properties = new Properties();
- properties.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ properties.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
properties.setProperty(ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER,
"org.apache.geode.management.internal.security.TestFunctions*");
server = cluster.startServerVM(0, properties);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java
index f6db5ee..e09d565 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java
@@ -35,6 +35,7 @@ import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.client.ClientCache;
import org.apache.geode.cache.execute.Function;
import org.apache.geode.cache.execute.ResultCollector;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
@@ -58,7 +59,7 @@ public class ClientExecuteRegionFunctionAuthDUnitTest extends JUnit4DistributedT
@Rule
public ServerStarterRule server = new ServerStarterRule()
- .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName())
+ .withProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName())
.withRegion(RegionShortcut.REPLICATE, "RegionA");
@Test
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClusterConfigWithoutSecurityDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClusterConfigWithoutSecurityDUnitTest.java
index 24899d7..ceb54d0 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClusterConfigWithoutSecurityDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClusterConfigWithoutSecurityDUnitTest.java
@@ -30,6 +30,7 @@ import org.junit.experimental.categories.Category;
import org.apache.geode.GemFireConfigException;
import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -68,7 +69,7 @@ public class ClusterConfigWithoutSecurityDUnitTest {
@Test
public void serverShouldBeAllowedToStartWithSecurityIfNotUsingClusterConfig() throws Exception {
Properties props = new Properties();
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
props.setProperty(SECURITY_POST_PROCESSOR, PDXPostProcessor.class.getName());
props.setProperty(USE_CLUSTER_CONFIGURATION, "false");
@@ -79,7 +80,7 @@ public class ClusterConfigWithoutSecurityDUnitTest {
// after cache is created, the configuration won't chagne
Properties secProps = ds.getSecurityProperties();
assertEquals(2, secProps.size());
- assertEquals(SimpleTestSecurityManager.class.getName(),
+ assertEquals(SimpleSecurityManager.class.getName(),
secProps.getProperty("security-manager"));
assertEquals(PDXPostProcessor.class.getName(), secProps.getProperty("security-post-processor"));
}
@@ -90,7 +91,7 @@ public class ClusterConfigWithoutSecurityDUnitTest {
@Test
public void serverShouldNotBeAllowedToStartWithSecurityIfUsingClusterConfig() throws Exception {
Properties props = new Properties();
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
props.setProperty(USE_CLUSTER_CONFIGURATION, "true");
assertThatThrownBy(
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClusterConfigurationSecurityDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClusterConfigurationSecurityDUnitTest.java
index b39f373..2426592 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClusterConfigurationSecurityDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClusterConfigurationSecurityDUnitTest.java
@@ -26,6 +26,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -46,7 +47,7 @@ public class ClusterConfigurationSecurityDUnitTest {
@BeforeClass
public static void beforeClass() throws Exception {
Properties properties = new Properties();
- properties.put(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ properties.put(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
locator = lsRule.startLocatorVM(0, properties);
}
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/OtherSimplySecurityManager.java b/geode-core/src/distributedTest/java/org/apache/geode/security/OtherSimplySecurityManager.java
index 159e3f4..20c0031 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/OtherSimplySecurityManager.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/OtherSimplySecurityManager.java
@@ -14,5 +14,7 @@
*/
package org.apache.geode.security;
-public class OtherSimplySecurityManager extends SimpleTestSecurityManager {
+import org.apache.geode.examples.SimpleSecurityManager;
+
+public class OtherSimplySecurityManager extends SimpleSecurityManager {
}
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/PeerSecurityWithEmbeddedLocatorDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/PeerSecurityWithEmbeddedLocatorDUnitTest.java
index ebb4703..b805e91 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/PeerSecurityWithEmbeddedLocatorDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/PeerSecurityWithEmbeddedLocatorDUnitTest.java
@@ -26,6 +26,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.AvailablePortHelper;
import org.apache.geode.security.templates.DummyAuthenticator;
import org.apache.geode.test.dunit.VM;
@@ -45,7 +46,7 @@ public class PeerSecurityWithEmbeddedLocatorDUnitTest {
int locatorPort = AvailablePortHelper.getRandomAvailableTCPPort();
Properties server0Props = new Properties();
- server0Props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ server0Props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
server0Props.setProperty("start-locator", "localhost[" + locatorPort + "]");
lsRule.startServerVM(0, server0Props);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java
index fa3456e..0cf5d42 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java
@@ -33,6 +33,7 @@ import org.junit.experimental.categories.Category;
import org.apache.geode.GemFireConfigException;
import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ServerStarterRule;
@@ -58,7 +59,7 @@ public class SecurityClusterConfigDUnitTest {
props.setProperty(JMX_MANAGER, "false");
props.setProperty(JMX_MANAGER_START, "false");
props.setProperty(JMX_MANAGER_PORT, 0 + "");
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
props.setProperty(SECURITY_POST_PROCESSOR, PDXPostProcessor.class.getName());
this.lsRule.startLocatorVM(0, props);
@@ -92,7 +93,7 @@ public class SecurityClusterConfigDUnitTest {
// the following are needed for peer-to-peer authentication
props.setProperty("security-username", "cluster");
props.setProperty("security-password", "cluster");
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
props.setProperty(USE_CLUSTER_CONFIGURATION, "true");
// initial security properties should only contain initial set of values
@@ -132,7 +133,7 @@ public class SecurityClusterConfigDUnitTest {
// the following are needed for peer-to-peer authentication
props.setProperty("security-username", "cluster");
props.setProperty("security-password", "cluster");
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
props.setProperty(SECURITY_POST_PROCESSOR, OtherPDXPostProcessor.class.getName());
props.setProperty(USE_CLUSTER_CONFIGURATION, "true");
@@ -150,7 +151,7 @@ public class SecurityClusterConfigDUnitTest {
// the following are needed for peer-to-peer authentication
props.setProperty("security-username", "cluster");
props.setProperty("security-password", "cluster");
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
props.setProperty(USE_CLUSTER_CONFIGURATION, "false");
assertThatThrownBy(
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityWithoutClusterConfigDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityWithoutClusterConfigDUnitTest.java
index ff31b79..bbfd454 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityWithoutClusterConfigDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/SecurityWithoutClusterConfigDUnitTest.java
@@ -29,6 +29,7 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
@@ -57,7 +58,7 @@ public class SecurityWithoutClusterConfigDUnitTest {
.addIgnoredException(
"A server must use cluster configuration when joining a secured cluster.".toString());
Properties props = new Properties();
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
props.setProperty(SECURITY_POST_PROCESSOR, PDXPostProcessor.class.getName());
props.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
locator = lsRule.startLocatorVM(0, props);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/StartServerAuthorizationTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/StartServerAuthorizationTest.java
index 1fa0251..79fd095 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/security/StartServerAuthorizationTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/security/StartServerAuthorizationTest.java
@@ -26,6 +26,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -44,7 +45,7 @@ public class StartServerAuthorizationTest {
@BeforeClass
public static void beforeClass() throws Exception {
Properties props = new Properties();
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
locator = lsRule.startLocatorVM(0, props);
}
diff --git a/geode-core/src/distributedTest/resources/org/apache/geode/management/internal/deployment/ExtendsFunctionAdapter.java b/geode-core/src/distributedTest/resources/org/apache/geode/management/internal/deployment/ExtendsFunctionAdapter.java
deleted file mode 100644
index cf7c7a2..0000000
--- a/geode-core/src/distributedTest/resources/org/apache/geode/management/internal/deployment/ExtendsFunctionAdapter.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.management.internal.deployment;
-
-
-import org.apache.geode.cache.execute.FunctionAdapter;
-import org.apache.geode.cache.execute.FunctionContext;
-
-public class ExtendsFunctionAdapter extends FunctionAdapter {
- public void execute(FunctionContext context) {
- context.getResultSender().lastResult("ExtendsFunctionAdapterResult");
- }
-}
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java
index 7980efc..390b7ed 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java
@@ -21,8 +21,8 @@ import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.CacheServerMXBean;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
import org.apache.geode.test.junit.rules.MBeanServerConnectionRule;
import org.apache.geode.test.junit.rules.ServerStarterRule;
@@ -32,7 +32,7 @@ public class CacheServerMBeanAuthenticationJUnitTest {
@ClassRule
public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
- .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()).withAutoStart();
+ .withProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName()).withAutoStart();
@Rule
public MBeanServerConnectionRule connectionRule =
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java
index 878514c..5e04dfe 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java
@@ -27,9 +27,9 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TemporaryFolder;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.MemberMXBean;
import org.apache.geode.security.NotAuthorizedException;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
import org.apache.geode.test.junit.rules.MBeanServerConnectionRule;
@@ -42,7 +42,7 @@ public class DeployCommandsSecurityTest {
@ClassRule
public static ServerStarterRule server = new ServerStarterRule()
- .withSecurityManager(SimpleTestSecurityManager.class).withJMXManager().withAutoStart();
+ .withSecurityManager(SimpleSecurityManager.class).withJMXManager().withAutoStart();
@ClassRule
public static TemporaryFolder temporaryFolder = new TemporaryFolder();
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java
index 83d514c..91a51fc 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java
@@ -23,8 +23,8 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.RuleChain;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.DiskStoreMXBean;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
import org.apache.geode.test.junit.rules.MBeanServerConnectionRule;
@@ -35,7 +35,7 @@ public class DiskStoreMXBeanSecurityJUnitTest {
private DiskStoreMXBean bean;
public ServerStarterRule server = new ServerStarterRule().withJMXManager()
- .withSecurityManager(SimpleTestSecurityManager.class).withAutoStart();
+ .withSecurityManager(SimpleSecurityManager.class).withAutoStart();
public MBeanServerConnectionRule connectionRule =
new MBeanServerConnectionRule(server::getJmxPort);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/FileUploaderMBeanSecurityTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/FileUploaderMBeanSecurityTest.java
index 10c2df7..d1ce0b2 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/FileUploaderMBeanSecurityTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/FileUploaderMBeanSecurityTest.java
@@ -24,9 +24,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.internal.beans.FileUploaderMBean;
import org.apache.geode.security.NotAuthorizedException;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.security.TestSecurityManager;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
@@ -41,7 +41,7 @@ public class FileUploaderMBeanSecurityTest {
@ClassRule
public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
.withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
- .withSecurityManager(SimpleTestSecurityManager.class).withAutoStart();
+ .withSecurityManager(SimpleSecurityManager.class).withAutoStart();
@Rule
public MBeanServerConnectionRule connectionRule =
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java
index e824e64..5cd5f36 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java
@@ -28,9 +28,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.GatewayReceiverMXBean;
import org.apache.geode.management.ManagementService;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
import org.apache.geode.test.junit.rules.MBeanServerConnectionRule;
@@ -47,7 +47,7 @@ public class GatewayReceiverMBeanSecurityTest {
@ClassRule
public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
- .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()).withAutoStart();
+ .withProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName()).withAutoStart();
@Rule
public MBeanServerConnectionRule connectionRule =
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java
index 58367f5..f93c52a 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java
@@ -28,10 +28,10 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.GatewaySenderMXBean;
import org.apache.geode.management.ManagementService;
import org.apache.geode.management.internal.beans.GatewaySenderMBean;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
import org.apache.geode.test.junit.rules.MBeanServerConnectionRule;
@@ -47,7 +47,7 @@ public class GatewaySenderMBeanSecurityTest {
@ClassRule
public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
- .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()).withAutoStart();
+ .withProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName()).withAutoStart();
@Rule
public MBeanServerConnectionRule connectionRule =
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java
index 171f315..951d0e4 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java
@@ -24,7 +24,7 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.security.SimpleTestSecurityManager;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.security.TestPostProcessor;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
@@ -37,7 +37,7 @@ public class GfshCommandsPostProcessorTest {
@ClassRule
public static ServerStarterRule serverStarter = new ServerStarterRule().withJMXManager()
.withProperty(SECURITY_POST_PROCESSOR, TestPostProcessor.class.getName())
- .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()).withAutoStart();
+ .withProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName()).withAutoStart();
@Rule
public GfshCommandRule gfshConnection =
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java
index 1c7f700..aed5983 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java
@@ -28,8 +28,8 @@ import org.junit.experimental.categories.Category;
import org.apache.geode.cache.Cache;
import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.distributed.internal.locks.DLockService;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.LockServiceMXBean;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
import org.apache.geode.test.junit.rules.MBeanServerConnectionRule;
@@ -41,7 +41,7 @@ public class LockServiceMBeanAuthorizationJUnitTest {
@ClassRule
public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
- .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()).withAutoStart();
+ .withProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName()).withAutoStart();
@Rule
public MBeanServerConnectionRule connectionRule =
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/security/CacheFactoryWithSecurityObjectTest.java b/geode-core/src/integrationTest/java/org/apache/geode/security/CacheFactoryWithSecurityObjectTest.java
index 18434f2..8f47c78 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/security/CacheFactoryWithSecurityObjectTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/security/CacheFactoryWithSecurityObjectTest.java
@@ -28,6 +28,7 @@ import org.junit.experimental.categories.Category;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.distributed.ConfigurationProperties;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.cache.InternalCache;
import org.apache.geode.internal.security.LegacySecurityService;
import org.apache.geode.internal.security.SecurityService;
@@ -43,7 +44,7 @@ public class CacheFactoryWithSecurityObjectTest {
@Before
public void before() throws Exception {
- this.simpleSecurityManager = new SimpleTestSecurityManager();
+ this.simpleSecurityManager = new SimpleSecurityManager();
properties = new Properties();
this.properties.setProperty("mcast-port", "0");
}
diff --git a/geode-core/src/test/java/org/apache/geode/internal/security/SecurityServiceFactoryTest.java b/geode-core/src/test/java/org/apache/geode/internal/security/SecurityServiceFactoryTest.java
index 1f70b04..13336db 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/security/SecurityServiceFactoryTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/security/SecurityServiceFactoryTest.java
@@ -32,9 +32,9 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.cache.CacheConfig;
import org.apache.geode.security.PostProcessor;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.security.TestPostProcessor;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -95,7 +95,7 @@ public class SecurityServiceFactoryTest {
@Test
public void createWithPropsWithSecurityManager() throws Exception {
- properties.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ properties.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
service = SecurityServiceFactory.create(properties);
assertThat(service).isInstanceOf(IntegratedSecurityService.class);
assertThat(service.getSecurityManager()).isNotNull();
@@ -121,7 +121,7 @@ public class SecurityServiceFactoryTest {
@Test
public void shiroOverwritesSecurityManager() throws Exception {
properties.setProperty(SECURITY_SHIRO_INIT, "shiro.ini");
- properties.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ properties.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
service = SecurityServiceFactory.create(properties);
assertThat(service).isInstanceOf(IntegratedSecurityService.class);
assertThat(service.getSecurityManager()).isNull();
@@ -151,7 +151,7 @@ public class SecurityServiceFactoryTest {
@Test
public void cacheConfigOverideProperties_securityManager() throws Exception {
- properties.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ properties.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
when(cacheConfig.getSecurityManager()).thenReturn(securityManager);
service = SecurityServiceFactory.create(properties, cacheConfig);
assertThat(service).isInstanceOf(IntegratedSecurityService.class);
@@ -161,12 +161,12 @@ public class SecurityServiceFactoryTest {
@Test
public void cacheConfigOverideProperties_postProcessor() throws Exception {
- properties.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ properties.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
properties.setProperty(SECURITY_POST_PROCESSOR, TestPostProcessor.class.getName());
when(cacheConfig.getPostProcessor()).thenReturn(postProcessor);
service = SecurityServiceFactory.create(properties, cacheConfig);
assertThat(service).isInstanceOf(IntegratedSecurityService.class);
- assertThat(service.getSecurityManager()).isInstanceOf(SimpleTestSecurityManager.class);
+ assertThat(service.getSecurityManager()).isInstanceOf(SimpleSecurityManager.class);
assertThat(service.getPostProcessor()).isEqualTo(postProcessor);
}
@@ -182,11 +182,11 @@ public class SecurityServiceFactoryTest {
@Test
public void cacheConfigPostProcessorWithPropertySecurityManager() throws Exception {
- properties.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ properties.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
when(cacheConfig.getPostProcessor()).thenReturn(postProcessor);
service = SecurityServiceFactory.create(properties, cacheConfig);
assertThat(service).isInstanceOf(IntegratedSecurityService.class);
- assertThat(service.getSecurityManager()).isInstanceOf(SimpleTestSecurityManager.class);
+ assertThat(service.getSecurityManager()).isInstanceOf(SimpleSecurityManager.class);
assertThat(service.getPostProcessor()).isEqualTo(postProcessor);
}
}
diff --git a/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java b/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java
index 1a7c5c9..8fbefba 100644
--- a/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java
@@ -25,18 +25,19 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.security.ResourcePermission.Operation;
import org.apache.geode.security.ResourcePermission.Resource;
import org.apache.geode.test.junit.categories.SecurityTest;
@Category({SecurityTest.class})
public class SimpleSecurityManagerTest {
- private SimpleTestSecurityManager manager;
+ private SimpleSecurityManager manager;
private Properties credentials;
@Before
public void before() {
- manager = new SimpleTestSecurityManager();
+ manager = new SimpleSecurityManager();
credentials = new Properties();
}
diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/security/ClientCQAuthDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/security/ClientCQAuthDUnitTest.java
index 9fed728..e7c6457 100644
--- a/geode-cq/src/distributedTest/java/org/apache/geode/security/ClientCQAuthDUnitTest.java
+++ b/geode-cq/src/distributedTest/java/org/apache/geode/security/ClientCQAuthDUnitTest.java
@@ -28,6 +28,7 @@ import org.apache.geode.cache.query.CqAttributes;
import org.apache.geode.cache.query.CqAttributesFactory;
import org.apache.geode.cache.query.CqQuery;
import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.dunit.rules.ClientVM;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -47,7 +48,7 @@ public class ClientCQAuthDUnitTest {
@Rule
public ServerStarterRule server = new ServerStarterRule()
- .withSecurityManager(SimpleTestSecurityManager.class)
+ .withSecurityManager(SimpleSecurityManager.class)
.withRegion(RegionShortcut.REPLICATE, REGION_NAME);
@Test
diff --git a/geode-dunit/src/main/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTestBase.java b/geode-dunit/src/main/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTestBase.java
index fb84691..c940eb4 100644
--- a/geode-dunit/src/main/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTestBase.java
+++ b/geode-dunit/src/main/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTestBase.java
@@ -26,13 +26,13 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.logging.LogService;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.result.CommandResult;
import org.apache.geode.management.internal.cli.result.ErrorResultData;
import org.apache.geode.management.internal.cli.result.ModelCommandResult;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.ConnectionConfiguration;
import org.apache.geode.test.junit.rules.GfshCommandRule;
@@ -43,7 +43,7 @@ public class GfshCommandsSecurityTestBase {
@ClassRule
public static ServerStarterRule serverStarter =
new ServerStarterRule().withJMXManager().withHttpService()
- .withSecurityManager(SimpleTestSecurityManager.class)
+ .withSecurityManager(SimpleSecurityManager.class)
.withRegion(RegionShortcut.REPLICATE_PERSISTENT, "persistentRegion")
.withEmbeddedLocator();
diff --git a/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/AuthenticationTest.java b/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/AuthenticationTest.java
index f4d11e9..6d2589a 100644
--- a/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/AuthenticationTest.java
+++ b/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/AuthenticationTest.java
@@ -32,7 +32,7 @@ import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.Locator;
-import org.apache.geode.security.SimpleTestSecurityManager;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.junit.categories.ClientServerTest;
@Category({ClientServerTest.class})
@@ -54,7 +54,7 @@ public class AuthenticationTest {
// Create a cache
CacheFactory cf = new CacheFactory();
cf.set(ConfigurationProperties.MCAST_PORT, "0");
- cf.setSecurityManager(new SimpleTestSecurityManager());
+ cf.setSecurityManager(new SimpleSecurityManager());
cache = cf.create();
// Start a locator
diff --git a/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/AuthorizationTest.java b/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/AuthorizationTest.java
index 641c108..44f2fe5 100644
--- a/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/AuthorizationTest.java
+++ b/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/AuthorizationTest.java
@@ -34,10 +34,10 @@ import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.Locator;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.InternalRegionArguments;
import org.apache.geode.internal.cache.LocalRegion;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.ClientServerTest;
@Category({ClientServerTest.class})
@@ -57,7 +57,7 @@ public class AuthorizationTest {
// Create a cache
CacheFactory cf = new CacheFactory();
cf.set(ConfigurationProperties.MCAST_PORT, "0");
- cf.setSecurityManager(new SimpleTestSecurityManager());
+ cf.setSecurityManager(new SimpleSecurityManager());
cache = cf.create();
// Start a locator
diff --git a/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/PostProcessingIntegrationTest.java b/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/PostProcessingIntegrationTest.java
index 1180005..12ae9b3 100644
--- a/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/PostProcessingIntegrationTest.java
+++ b/geode-experimental-driver/src/integrationTest/java/org/apache/geode/experimental/driver/PostProcessingIntegrationTest.java
@@ -34,8 +34,8 @@ import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.Locator;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.security.PostProcessor;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.categories.ClientServerTest;
@Category({ClientServerTest.class})
@@ -58,7 +58,7 @@ public class PostProcessingIntegrationTest {
// Create a cache
CacheFactory cf = new CacheFactory();
cf.set(ConfigurationProperties.MCAST_PORT, "0");
- cf.setSecurityManager(new SimpleTestSecurityManager());
+ cf.setSecurityManager(new SimpleSecurityManager());
cf.set(ConfigurationProperties.SECURITY_POST_PROCESSOR, SpamPostProcessor.class.getName());
cache = cf.create();
diff --git a/geode-junit/src/main/java/org/apache/geode/security/SimpleTestSecurityManager.java b/geode-junit/src/main/java/org/apache/geode/security/SimpleTestSecurityManager.java
deleted file mode 100644
index ac2d15d..0000000
--- a/geode-junit/src/main/java/org/apache/geode/security/SimpleTestSecurityManager.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package org.apache.geode.security;
-
-import java.util.Properties;
-
-/**
- * This class provides a simple implementation of {@link SecurityManager} for authentication and
- * authorization solely based on the username and password provided.
- *
- * It is meant for demo purpose, not for production.
- *
- * Authentication: All users whose password matches the username are authenticated. e.g.
- * username/password = test/test, user/user, admin/admin
- *
- * Authorization: users whose username is a substring (case insensitive) of the permission required
- * are authorized. e.g. username = data: is authorized for all data operations: data; data:manage
- * data:read data:write username = dataWrite: is authorized for data writes on all regions:
- * data:write data:write:regionA username = cluster: authorized for all cluster operations username
- * = clusterRead: authorized for all cluster read operations
- *
- * a user could be a comma separated list of roles as well.
- */
-public class SimpleTestSecurityManager implements SecurityManager {
-
- @Override
- public void init(final Properties securityProps) {
- // nothing
- }
-
- @Override
- public Object authenticate(final Properties credentials) throws AuthenticationFailedException {
- String username = credentials.getProperty("security-username");
- String password = credentials.getProperty("security-password");
- if (username != null && username.equals(password)) {
- return username;
- }
- throw new AuthenticationFailedException("invalid username/password");
- }
-
- @Override
- public boolean authorize(final Object principal, final ResourcePermission permission) {
- String[] principals = principal.toString().toLowerCase().split(",");
- for (String role : principals) {
- String permissionString = permission.toString().replace(":", "").toLowerCase();
- if (permissionString.startsWith(role))
- return true;
- }
- return false;
- }
-
- @Override
- public void close() {
- // nothing
- }
-}
diff --git a/geode-junit/src/main/java/org/apache/geode/security/SpySecurityManager.java b/geode-junit/src/main/java/org/apache/geode/security/SpySecurityManager.java
index 4523dae..d41e0cf 100644
--- a/geode-junit/src/main/java/org/apache/geode/security/SpySecurityManager.java
+++ b/geode-junit/src/main/java/org/apache/geode/security/SpySecurityManager.java
@@ -17,7 +17,9 @@ package org.apache.geode.security;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger;
-public class SpySecurityManager extends SimpleTestSecurityManager {
+import org.apache.geode.examples.SimpleSecurityManager;
+
+public class SpySecurityManager extends SimpleSecurityManager {
private final AtomicInteger initInvoked = new AtomicInteger(0);
private final AtomicInteger closeInvoked = new AtomicInteger(0);
diff --git a/geode-core/src/integrationTest/resources/org/apache/geode/management/internal/deployment/ExtendsFunctionAdapter.java b/geode-junit/src/main/resources/org/apache/geode/management/internal/deployment/ExtendsFunctionAdapter.java
similarity index 100%
rename from geode-core/src/integrationTest/resources/org/apache/geode/management/internal/deployment/ExtendsFunctionAdapter.java
rename to geode-junit/src/main/resources/org/apache/geode/management/internal/deployment/ExtendsFunctionAdapter.java
diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneClientSecurityDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneClientSecurityDUnitTest.java
index af25925..86a11ab 100644
--- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneClientSecurityDUnitTest.java
+++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneClientSecurityDUnitTest.java
@@ -42,8 +42,8 @@ import org.apache.geode.cache.client.ClientRegionShortcut;
import org.apache.geode.cache.client.ServerOperationException;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.distributed.ConfigurationProperties;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.security.NotAuthorizedException;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.security.templates.UserPasswordAuthInit;
import org.apache.geode.test.junit.categories.LuceneTest;
import org.apache.geode.test.junit.categories.SecurityTest;
@@ -80,7 +80,7 @@ public class LuceneClientSecurityDUnitTest extends LuceneQueriesAccessorBase {
Properties props = new Properties();
props.put(ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER,
"org.apache.geode.cache.lucene.test.TestObject");
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
final Cache cache = getCache(props);
final CacheServer server = cache.addCacheServer();
server.setPort(0);
diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneCommandsSecurityDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneCommandsSecurityDUnitTest.java
index 3d6ae56..aa75f04 100644
--- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneCommandsSecurityDUnitTest.java
+++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneCommandsSecurityDUnitTest.java
@@ -33,13 +33,13 @@ import org.junit.runner.RunWith;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.lucene.internal.cli.LuceneCliStrings;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.CommandResult;
import org.apache.geode.management.internal.cli.result.ErrorResultData;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.LuceneTest;
@@ -62,7 +62,7 @@ public class LuceneCommandsSecurityDUnitTest {
public void before() throws Exception {
// start the locator
Properties props = new Properties();
- props.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName());
+ props.setProperty(SECURITY_MANAGER, SimpleSecurityManager.class.getName());
this.locator = this.locatorServer.startLocatorVM(0, props);
// start the server
diff --git a/geode-protobuf/src/distributedTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/LocatorConnectionAuthenticationDUnitTest.java b/geode-protobuf/src/distributedTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/LocatorConnectionAuthenticationDUnitTest.java
index f96b31d..3c0103f 100644
--- a/geode-protobuf/src/distributedTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/LocatorConnectionAuthenticationDUnitTest.java
+++ b/geode-protobuf/src/distributedTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/LocatorConnectionAuthenticationDUnitTest.java
@@ -33,13 +33,13 @@ import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.Locator;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol;
import org.apache.geode.internal.protocol.protobuf.v1.ConnectionAPI;
import org.apache.geode.internal.protocol.protobuf.v1.MessageUtil;
import org.apache.geode.internal.protocol.protobuf.v1.ProtobufRequestUtilities;
import org.apache.geode.internal.protocol.protobuf.v1.serializer.ProtobufProtocolSerializer;
import org.apache.geode.internal.protocol.protobuf.v1.state.exception.ConnectionStateException;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties;
@@ -69,7 +69,7 @@ public class LocatorConnectionAuthenticationDUnitTest {
System.setProperty("geode.feature-protobuf-protocol", "true");
Properties props = new Properties();
props.setProperty(ConfigurationProperties.SECURITY_MANAGER,
- SimpleTestSecurityManager.class.getName());
+ SimpleSecurityManager.class.getName());
locator = Locator.startLocatorAndDS(0, null, props);
return locator.getPort();
});
diff --git a/geode-web-management/build.gradle b/geode-web-management/build.gradle
index b5b6731..d890570 100644
--- a/geode-web-management/build.gradle
+++ b/geode-web-management/build.gradle
@@ -17,8 +17,11 @@ apply plugin: 'war'
apply from: "${project.projectDir}/../gradle/publish.gradle"
-configurations {
- commonTestCompile
+apply plugin: 'nebula.facet'
+facets {
+ commonTest {
+ parentSourceSet = 'main'
+ }
}
sourceSets {
@@ -33,13 +36,6 @@ sourceSets {
srcDir "${projectDir}/src/main/webapp"
}
}
-
- commonTest {
- java {
- srcDir "${projectDir}/src/commonTest/java"
- }
- compileClasspath = configurations.commonTestCompile
- }
}
dependencies {
diff --git a/geode-web-management/src/commonTest/java/org/apache/geode/management/internal/rest/LocatorWithSecurityManagerContextLoader.java b/geode-web-management/src/commonTest/java/org/apache/geode/management/internal/rest/LocatorWithSecurityManagerContextLoader.java
index 696e16a..2738a0c 100644
--- a/geode-web-management/src/commonTest/java/org/apache/geode/management/internal/rest/LocatorWithSecurityManagerContextLoader.java
+++ b/geode-web-management/src/commonTest/java/org/apache/geode/management/internal/rest/LocatorWithSecurityManagerContextLoader.java
@@ -15,7 +15,7 @@
package org.apache.geode.management.internal.rest;
-import org.apache.geode.security.SimpleTestSecurityManager;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.junit.rules.LocatorStarterRule;
public class LocatorWithSecurityManagerContextLoader extends BaseLocatorContextLoader {
@@ -24,7 +24,7 @@ public class LocatorWithSecurityManagerContextLoader extends BaseLocatorContextL
public LocatorWithSecurityManagerContextLoader() {
locator = new LocatorStarterRule()
- .withSecurityManager(SimpleTestSecurityManager.class)
+ .withSecurityManager(SimpleSecurityManager.class)
.withAutoStart();
}
diff --git a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandWithSecurityDUnitTest.java b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandWithSecurityDUnitTest.java
index 6cc148b..bf08ca8 100644
--- a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandWithSecurityDUnitTest.java
+++ b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandWithSecurityDUnitTest.java
@@ -29,9 +29,9 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.apache.geode.cache.execute.FunctionService;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.internal.security.ResourceConstants;
import org.apache.geode.management.internal.security.TestFunctions.WriteFunction;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.GfshTest;
@@ -50,7 +50,7 @@ public class ExecuteFunctionCommandWithSecurityDUnitTest {
@BeforeClass
public static void beforeClass() {
locator = lsRule.startLocatorVM(0,
- l -> l.withHttpService().withSecurityManager(SimpleTestSecurityManager.class));
+ l -> l.withHttpService().withSecurityManager(SimpleSecurityManager.class));
Properties serverProps = new Properties();
serverProps.setProperty(ResourceConstants.USER_NAME, "clusterManage");
diff --git a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSecurityTest.java b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSecurityTest.java
index 5e7aa7b..0d34c72 100644
--- a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSecurityTest.java
+++ b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSecurityTest.java
@@ -20,7 +20,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
-import org.apache.geode.security.SimpleTestSecurityManager;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.test.junit.categories.GfshTest;
import org.apache.geode.test.junit.categories.SecurityTest;
import org.apache.geode.test.junit.rules.GfshCommandRule;
@@ -32,7 +32,7 @@ public class ConnectCommandWithSecurityTest {
@ClassRule
public static LocatorStarterRule locator = new LocatorStarterRule()
.withHttpService()
- .withSecurityManager(SimpleTestSecurityManager.class).withAutoStart();
+ .withSecurityManager(SimpleSecurityManager.class).withAutoStart();
@Rule
public GfshCommandRule gfsh = new GfshCommandRule();
diff --git a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerSecurityTest.java b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerSecurityTest.java
index 9a31e4f..df5a072 100644
--- a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerSecurityTest.java
+++ b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerSecurityTest.java
@@ -30,11 +30,11 @@ import javax.management.QueryExp;
import org.junit.ClassRule;
import org.junit.Test;
+import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.DistributedSystemMXBean;
import org.apache.geode.management.internal.ManagementConstants;
import org.apache.geode.management.internal.cli.CommandRequest;
import org.apache.geode.security.NotAuthorizedException;
-import org.apache.geode.security.SimpleTestSecurityManager;
import org.apache.geode.test.junit.rules.GfshCommandRule;
import org.apache.geode.test.junit.rules.LocatorStarterRule;
@@ -43,7 +43,7 @@ public class HttpOperationInvokerSecurityTest {
@ClassRule
public static LocatorStarterRule locator =
new LocatorStarterRule().withHttpService()
- .withSecurityManager(SimpleTestSecurityManager.class).withAutoStart();
+ .withSecurityManager(SimpleSecurityManager.class).withAutoStart();
@ClassRule
public static GfshCommandRule gfsh = new GfshCommandRule();