db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r589796 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java
Date Mon, 29 Oct 2007 18:40:13 GMT
Author: djd
Date: Mon Oct 29 11:40:13 2007
New Revision: 589796

URL: http://svn.apache.org/viewvc?rev=589796&view=rev
Log:
DERBY-3147 Add some tests for duplicates in the read only and full access lists as database
properties.

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=589796&r1=589795&r2=589796&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 11:40:13 2007
@@ -553,6 +553,66 @@
         // use valid user/pwd to set the full accessusers.
         Connection conn1 = openDefaultConnection(
             "dan", ("dan" + PASSWORD_SUFFIX));
+        
+        // Test duplicates on the list of users
+        try {
+            setDatabaseProperty("derby.database.fullAccessUsers", 
+                    "dan,jamie,dan", conn1);
+            fail("Duplicate allowed on derby.database.fullAccessUsers");
+        } catch (SQLException e) {
+            assertSQLState("4250D", e);
+        }
+        try {
+            setDatabaseProperty("derby.database.fullAccessUsers", 
+                    "dan,jamie,DaN", conn1);
+            fail("Duplicate allowed on derby.database.fullAccessUsers");
+        } catch (SQLException e) {
+            assertSQLState("4250D", e);
+        }
+        try {
+            setDatabaseProperty("derby.database.fullAccessUsers", 
+                    "dan,jamie,\"DAN\"", conn1);
+            fail("Duplicate allowed on derby.database.fullAccessUsers");
+        } catch (SQLException e) {
+            assertSQLState("4250D", e);
+        }
+        try {
+            setDatabaseProperty("derby.database.fullAccessUsers", 
+                    "\"dan\",jamie,\"dan\"", conn1);
+            fail("Duplicate allowed on derby.database.fullAccessUsers");
+        } catch (SQLException e) {
+            assertSQLState("4250D", e);
+        }
+        
+        try {
+            setDatabaseProperty("derby.database.readOnlyAccessUsers", 
+                    "dan,jamie,dan", conn1);
+            fail("Duplicate allowed on derby.database.readOnlyAccessUsers");
+        } catch (SQLException e) {
+            assertSQLState("4250D", e);
+        }
+        try {
+            setDatabaseProperty("derby.database.readOnlyAccessUsers", 
+                    "dan,jamie,DaN", conn1);
+            fail("Duplicate allowed on derby.database.readOnlyAccessUsers");
+        } catch (SQLException e) {
+            assertSQLState("4250D", e);
+        }
+        try {
+            setDatabaseProperty("derby.database.readOnlyAccessUsers", 
+                    "dan,jamie,\"DAN\"", conn1);
+            fail("Duplicate allowed on derby.database.readOnlyAccessUsers");
+        } catch (SQLException e) {
+            assertSQLState("4250D", e);
+        }
+        try {
+            setDatabaseProperty("derby.database.readOnlyAccessUsers", 
+                    "\"dan\",jamie,\"dan\"", conn1);
+            fail("Duplicate allowed on derby.database.readOnlyAccessUsers");
+        } catch (SQLException e) {
+            assertSQLState("4250D", e);
+        }
+        
         setDatabaseProperty("derby.database.fullAccessUsers", 
             "dan,jamie,system", conn1);
         // cannot set a user to both full and readonly access...



Mime
View raw message