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 dj...@apache.org on 2007/10/29 20:58:11 UTC

svn commit: r589829 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java

Author: djd
Date: Mon Oct 29 12:58:10 2007
New Revision: 589829

URL: http://svn.apache.org/viewvc?rev=589829&view=rev
Log:
DERBY-3147 (partial) Add two user names to AuthenticationTest that must be represented as delimited identifiers in SQL due to an @ sign or the user being 123.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java?rev=589829&r1=589828&r2=589829&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java Mon Oct 29 12:58:10 2007
@@ -53,7 +53,7 @@
     private static final String PASSWORD_SUFFIX = "suf2ix";
     private static final String USERS[] = 
         {"APP","dan","kreg","jeff","ames","jerry","francois","jamie","howardR",
-        "\"eVe\""};
+        "\"eVe\"","\"fred@derby.com\"", "\"123\"" };
 
     private static final String zeus = "\u0396\u0395\u03A5\u03A3";
     private static final String apollo = "\u0391\u09A0\u039F\u039B\u039B\u039A\u0390";
@@ -135,20 +135,22 @@
         suite.addTest(new SystemPropertyTestSetup (test, sysprops));
     }
     
-    public void tearDown() throws Exception {
-        try {
-            AccessController.doPrivileged
-            (new java.security.PrivilegedAction(){
-                public Object run(){
-                    System.getProperties().remove(
-                        "derby.connection.requireAuthentication");
-                    return 
-                        System.getProperties().remove("derby.user." +apollo);
-                }
-            });
-        } catch (Exception e) {
-            fail("failed to unset properties");
-        }
+    protected void setUp() throws Exception {
+        
+        setDatabaseProperty("derby.database.defaultConnectionMode",
+                null, getConnection());
+        setDatabaseProperty("derby.database.readOnlyAccessUsers",
+                null, getConnection());
+        setDatabaseProperty("derby.database.fullAccessUsers",
+                null, getConnection());
+        
+        commit();
+        
+    }
+    
+    protected void tearDown() throws Exception {
+        removeSystemProperty("derby.connection.requireAuthentication");
+        removeSystemProperty("derby.user." +apollo);
         super.tearDown();
     }
     
@@ -244,7 +246,7 @@
         // DatabaseMetaData.getUserName() returns the user name used
         // to make the request via JDBC.
         assertEquals("DatabaseMetaData.getUserName()",
-                jdbcUserName, connUser.getMetaData().getUserName());
+                jdbcUserName, connUser.getMetaData().getUserName());       
         
         JDBC.cleanup(connUser);
     }