db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r636625 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java
Date Thu, 13 Mar 2008 04:34:30 GMT
Author: djd
Date: Wed Mar 12 21:34:28 2008
New Revision: 636625

URL: http://svn.apache.org/viewvc?rev=636625&view=rev
Log:
Minor cleanup in NSSecurityMechanismTest to use some utility methods.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java?rev=636625&r1=636624&r2=636625&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java
Wed Mar 12 21:34:28 2008
@@ -190,14 +190,9 @@
         return suite;
     }
     
-    public void tearDown() throws Exception {
-        AccessController.doPrivileged
-        (new java.security.PrivilegedAction(){
-            public Object run(){
-                return System.getProperties().remove(
-                        "derby.drda.securityMechanism");
-            }
-        });
+    protected void tearDown() throws Exception {
+        removeSystemProperty("derby.drda.securityMechanism");
+
         super.tearDown();
     }
 
@@ -416,15 +411,9 @@
             }
         }
 
+        setSystemProperty("derby.drda.securityMechanism",
+                derby_drda_securityMechanism);
         try {
-            AccessController.doPrivileged
-            (new java.security.PrivilegedAction(){
-                public Object run(){
-                    return System.setProperty(
-                        "derby.drda.securityMechanism",
-                        derby_drda_securityMechanism);
-                }
-            });
             
             // if the security mechanism isn't supported or invalid, getting a
             // networkservercontrol will fail.
@@ -1139,8 +1128,6 @@
         println("Turning ON Derby BUILTIN authentication");
         Connection conn = getDataSourceConnectionWithSecMec(
             "neelima", "lee", new Short(SECMEC_USRSSBPWD));
-        if (conn == null)
-            return; // Exception would have been raised
 
         // Turn on BUILTIN authentication
         CallableStatement cs = conn.prepareCall(
@@ -1194,8 +1181,6 @@
         // Prepare to turn OFF Derby BUILTIN authentication
         conn = getDataSourceConnectionWithSecMec("neelima", "lee",
             new Short(SECMEC_USRSSBPWD));
-        if (conn == null)
-            return; // Exception would have been raised
 
         // Turn off BUILTIN authentication
         cs = conn.prepareCall(



Mime
View raw message