db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r555075 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java
Date Tue, 10 Jul 2007 21:00:44 GMT
Author: kmarsden
Date: Tue Jul 10 14:00:43 2007
New Revision: 555075

URL: http://svn.apache.org/viewvc?view=rev&rev=555075
Log:
DERBY-2893 Fix GrantRevokeTest to use correct user for assertInsertPrivilege


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java?view=diff&rev=555075&r1=555074&r2=555075
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java
Tue Jul 10 14:00:43 2007
@@ -1045,7 +1045,7 @@
     	// NOTE - getColumns returns empty result set if schema / table names not capitalized.
         // TODO - should implement asserting insert privilege on a subset of columns at some
point
     	
-    	Connection c = openUserConnection(users[0]);
+    	Connection c = openUserConnection(user);
 
     	Statement s = c.createStatement();
     	try {
@@ -1063,13 +1063,12 @@
             rs.close();
             command.append(")");
     	    int i = s.executeUpdate(command.toString());
-            // DERBY-2893 INSERT seems to succeed.
-            //if (!hasPrivilege)
-            //    fail("expected no INSERT permission on table");
+            if (!hasPrivilege)
+               fail("expected no INSERT permission on table");
 
     	} catch (SQLException e) {
     		if (!hasPrivilege) {
-    			assertSQLState("42502", e);
+    			assertSQLState("42500", e);
     		} else {
     			fail("Unexpected lack of insert privilege on " + schema + "." + table + " by " + user);
     		}
@@ -1130,9 +1129,8 @@
         	        assertEquals(columnCount, actualCount);
         	    }
                 
-                // DERBY-2893 UPDATE seems to succeed.
-                //if (!hasPrivilege)
-                //    fail("expected no UPDATE permission on table");
+                if (!hasPrivilege)
+                  fail("expected no UPDATE permission on table");
 
     		} catch (SQLException e) {
         		if (!hasPrivilege) {



Mime
View raw message