From derby-commits-return-11021-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Wed Dec 17 15:38:09 2008 Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 84177 invoked from network); 17 Dec 2008 15:38:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Dec 2008 15:38:09 -0000 Received: (qmail 84083 invoked by uid 500); 17 Dec 2008 15:38:22 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 84058 invoked by uid 500); 17 Dec 2008 15:38:22 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 84049 invoked by uid 99); 17 Dec 2008 15:38:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2008 07:38:22 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2008 15:38:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9607523889BA; Wed, 17 Dec 2008 07:37:46 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r727417 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java Date: Wed, 17 Dec 2008 15:37:46 -0000 To: derby-commits@db.apache.org From: dag@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081217153746.9607523889BA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dag Date: Wed Dec 17 07:37:46 2008 New Revision: 727417 URL: http://svn.apache.org/viewvc?rev=727417&view=rev Log: DERBY-3137 SQL roles: add catalog support Patch DERBY-3137-modeTests which adds a missing test case: Creating a role that already exists. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java?rev=727417&r1=727416&r2=727417&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java Wed Dec 17 07:37:46 2008 @@ -74,7 +74,7 @@ private final static String notIdle = "25001"; private final static String invalidRoleName = "4293A"; private final static String userException = "38000"; - private final static String userAlreadyExists = "X0Y68"; + private final static String objectAlreadyExists = "X0Y68"; private final static String invalidPUBLIC = "4251B"; private final static String loginFailed = "08004"; private final static String roleGrantCircularity = "4251C"; @@ -408,33 +408,37 @@ doStmt("create role \"NONE\"", // quoted role id should work sqlAuthorizationRequired, null , roleDboOnly); + // Verify that we can't create a role which already exists + doStmt("create role foo", + sqlAuthorizationRequired, objectAlreadyExists, roleDboOnly); + // Verify that we can't create a role which has the same auth // id as a known user (DERBY-3673). // // a) built-in user: doStmt("create role " + users[dboIndex], sqlAuthorizationRequired, - userAlreadyExists, roleDboOnly); + objectAlreadyExists, roleDboOnly); // specified with mixed case : DonaldDuck doStmt("create role " + users[nonDboIndex], - sqlAuthorizationRequired, userAlreadyExists, roleDboOnly); + sqlAuthorizationRequired, objectAlreadyExists, roleDboOnly); // delimited identifier with embedded text quote inside doStmt("create role " + users[additionaluserIndex], - sqlAuthorizationRequired, userAlreadyExists, roleDboOnly); + sqlAuthorizationRequired, objectAlreadyExists, roleDboOnly); // b) A grant to this auth id exists (see setup), even though // it is not a built-in user, so the presumption is, it is a // user defined externally: doStmt("create role whoever", sqlAuthorizationRequired, - userAlreadyExists, roleDboOnly); + objectAlreadyExists, roleDboOnly); // c) A schema exists which has an authid we did not see // through properties; user has been removed, but his schema // lingers.. doStmt("create role schemaowner", sqlAuthorizationRequired, - userAlreadyExists, roleDboOnly); + objectAlreadyExists, roleDboOnly); testLoginWithUsernameWhichIsARole();