You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by kr...@apache.org on 2012/02/27 11:13:29 UTC
svn commit: r1294088 - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit:
SecurityManagerSetup.java TestConfiguration.java
Author: kristwaa
Date: Mon Feb 27 10:13:28 2012
New Revision: 1294088
URL: http://svn.apache.org/viewvc?rev=1294088&view=rev
Log:
DERBY-5631: Extend SecurityManagerSetup to add extra privileges to the set of default privileges (merge two policy files)
Introduced constant NO_POLICY for "<NONE>".
Corrected class name in license.
Fixed typo.
Patch file: derby-5631-2a-introduce_NO_POLICY_constant.diff
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java?rev=1294088&r1=1294087&r2=1294088&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java Mon Feb 27 10:13:28 2012
@@ -1,6 +1,6 @@
/*
*
- * Derby - Class org.apache.derbyTesting.functionTests.util.SecurityManagerSetup
+ * Derby - Class org.apache.derbyTesting.junit.SecurityManagerSetup
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -38,6 +38,9 @@ import junit.framework.TestSuite;
*/
public final class SecurityManagerSetup extends TestSetup {
+ /** Constant used to indicate that no security policy is to be installed. */
+ static final String NO_POLICY = "<NONE>";
+
/**
* Does the JVM support Subjects for
* authorization through Java security manager.
@@ -114,7 +117,7 @@ public final class SecurityManagerSetup
if (externalSecurityManagerInstalled)
return new TestSuite("skipped due to external security manager "
+ test.toString());
- return new SecurityManagerSetup(test, "<NONE>");
+ return new SecurityManagerSetup(test, NO_POLICY);
}
/**
@@ -123,11 +126,11 @@ public final class SecurityManagerSetup
*/
static void noSecurityManager()
{
- installSecurityManager("<NONE>");
+ installSecurityManager(NO_POLICY);
}
/**
- * Install specific polciy file with the security manager
+ * Install specific policy file with the security manager
* including the special case of no security manager.
*/
protected void setUp() {
@@ -136,7 +139,7 @@ public final class SecurityManagerSetup
protected void tearDown() throws Exception
{
- if ("<NONE>".equals(decoratorPolicyResource))
+ if (NO_POLICY.equals(decoratorPolicyResource))
BaseTestCase.setSystemProperty("java.security.policy", "");
else if ( !externalSecurityManagerInstalled )
{
@@ -202,7 +205,7 @@ public final class SecurityManagerSetup
}
// Check indicator for no security manager
- if ("<NONE>".equals(set.getProperty("java.security.policy")))
+ if (NO_POLICY.equals(set.getProperty("java.security.policy")))
return;
// and install
@@ -224,7 +227,7 @@ public final class SecurityManagerSetup
private static void setSecurityPolicy(Properties set,
String policyResource)
{
- if ("<NONE>".equals(policyResource)) {
+ if (NO_POLICY.equals(policyResource)) {
set.setProperty("java.security.policy", policyResource);
return;
}
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java?rev=1294088&r1=1294087&r2=1294088&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java Mon Feb 27 10:13:28 2012
@@ -2012,7 +2012,7 @@ public final class TestConfiguration {
SecurityManagerSetup.noSecurityManager();
return false;
} else {
- if ("<NONE>".equals(
+ if (SecurityManagerSetup.NO_POLICY.equals(
BaseTestCase.getSystemProperty("java.security.policy")))
{
// Explict setting of no security manager