db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r540252 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit: SecurityManagerSetup.java TestConfiguration.java
Date Mon, 21 May 2007 19:39:38 GMT
Author: djd
Date: Mon May 21 12:39:37 2007
New Revision: 540252

URL: http://svn.apache.org/viewvc?view=rev&rev=540252
Log:
Cleanup some code related to setting up security managers for JUnit tests.
1) Remove some checked exceptions that are never thrown.
2) Name a couple of empty test suites.

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?view=diff&rev=540252&r1=540251&r2=540252
==============================================================================
--- 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 May 21 12:39:37 2007
@@ -79,7 +79,8 @@
 	public static Test noSecurityManager(Test test)
 	{
 		if (externalSecurityManagerInstalled)
-			return new TestSuite();
+			return new TestSuite("skipped due to external security manager "
+                    + test.toString());
 		return new SecurityManagerSetup(test, "<NONE>");
 	}
 	
@@ -90,17 +91,16 @@
     public static Test noSecurityManager(TestSetup tSetup)
     {
 		if (externalSecurityManagerInstalled)
-			return new TestSuite();
+			return new TestSuite("skipped due to external security manager "
+                    + tSetup.toString());
 		return new SecurityManagerSetup(tSetup, "<NONE>");
     }
 
 	/**
-	 * Install a SecurityManager with the default test policy
-	 * file:
-	 * org/apache/derbyTesting/functionTests/util/derby_tests.policy
+	 * "Install" no security manager.
 	 * 
 	 */
-	static void noSecurityManager() throws PrivilegedActionException
+	static void noSecurityManager()
 	{
 		installSecurityManager("<NONE>");
 	}
@@ -109,7 +109,7 @@
 	 * Install specific polciy file with the security manager
 	 * including the special case of no security manager.
 	 */
-	protected void setUp() throws PrivilegedActionException {
+	protected void setUp() {
 		installSecurityManager(decoratorPolicyResource);
 	}
     
@@ -137,13 +137,13 @@
 	 * org/apache/derbyTesting/functionTests/util/derby_tests.policy
 	 * 
 	 */
-	static void installSecurityManager() throws PrivilegedActionException
+	static void installSecurityManager()
 	{
 		installSecurityManager( getDefaultPolicy() );
 	}
 	
 	private static void installSecurityManager(String policyFile)
-			throws PrivilegedActionException {
+			 {
 
 		if (externalSecurityManagerInstalled)
 			return;
@@ -191,7 +191,7 @@
 	}
 	
 	private static void setSecurityPolicy(Properties set,
-			String policyResource) throws PrivilegedActionException
+			String policyResource)
 	{
 		if ("<NONE>".equals(policyResource)) {
 			set.setProperty("java.security.policy", policyResource);
@@ -369,7 +369,7 @@
      * Remove the security manager.
      */
     private static void uninstallSecurityManager()
-        throws PrivilegedActionException {
+    {
 
             AccessController.doPrivileged
             (

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?view=diff&rev=540252&r1=540251&r2=540252
==============================================================================
--- 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 May 21 12:39:37 2007
@@ -1155,7 +1155,7 @@
      * for the current configuration.
      * @throws PrivilegedActionException 
      */
-    boolean defaultSecurityManagerSetup() throws PrivilegedActionException {
+    boolean defaultSecurityManagerSetup() {
     	
     	// Testing with the DB2 client has not been performed
     	// under the security manager since it's not part



Mime
View raw message