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 dy...@apache.org on 2008/04/12 19:23:13 UTC
svn commit: r647474 - in
/db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting:
junit/SecurityManagerSetup.java
unitTests/junit/SystemPrivilegesPermissionTest.java
Author: dyre
Date: Sat Apr 12 10:23:12 2008
New Revision: 647474
URL: http://svn.apache.org/viewvc?rev=647474&view=rev
Log:
DERBY-3548: NoClassDefFoundError failure in SystemPrivilegesPermissionTest for weme6.1
Merged to 10.4 with svn merge -r 639058:639059 ../derby-scratch
No conflicts.
Modified:
db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/unitTests/junit/SystemPrivilegesPermissionTest.java
Modified: db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java?rev=647474&r1=647473&r2=647474&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java (original)
+++ db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java Sat Apr 12 10:23:12 2008
@@ -37,6 +37,17 @@
*
*/
public final class SecurityManagerSetup extends TestSetup {
+
+ /**
+ * Does the JVM support Subjects for
+ * authorization through Java security manager.
+ * J2ME/CDC/Foundation 1.1 does not support Subjects.
+ */
+ public static final boolean JVM_HAS_SUBJECT_AUTHORIZATION;
+ static {
+ JVM_HAS_SUBJECT_AUTHORIZATION = JDBC.haveClass("javax.security.auth.Subject");
+ }
+
private static final Properties classPathSet = new Properties();
Modified: db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/unitTests/junit/SystemPrivilegesPermissionTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/unitTests/junit/SystemPrivilegesPermissionTest.java?rev=647474&r1=647473&r2=647474&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/unitTests/junit/SystemPrivilegesPermissionTest.java (original)
+++ db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/unitTests/junit/SystemPrivilegesPermissionTest.java Sat Apr 12 10:23:12 2008
@@ -154,16 +154,15 @@
TestSuite suite = new TestSuite(
SystemPrivilegesPermissionTest.class,
"SystemPrivilegesPermissionTest");
- return new SecurityManagerSetup(suite, POLICY_FILE_NAME);
+
+ if (SecurityManagerSetup.JVM_HAS_SUBJECT_AUTHORIZATION)
+ {
+ suite.addTest(new SecurityManagerSetup(
+ new SystemPrivilegesPermissionTest("policyTestSystemGrants"),
+ POLICY_FILE_NAME));
+ }
+ return suite;
}
-
- /**
- * Test case that does a check of the XXX
- */
- public void testIsSecurityManager() {
- assertSecurityManager();
- }
-
/**
* Tests SystemPrincipal.
@@ -301,11 +300,11 @@
p.getActions());
}
}
-
-
-
}
}
+ }
+
+ public void policyTestSystemGrants() {
// test SystemPermission for authorized user against policy file