Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 58362 invoked from network); 17 Jul 2009 14:16:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jul 2009 14:16:34 -0000 Received: (qmail 86695 invoked by uid 500); 17 Jul 2009 14:17:40 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 86636 invoked by uid 500); 17 Jul 2009 14:17:39 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 86628 invoked by uid 99); 17 Jul 2009 14:17:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jul 2009 14:17:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jul 2009 14:17:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7FAEF234C1E9 for ; Fri, 17 Jul 2009 07:17:15 -0700 (PDT) Message-ID: <640665554.1247840235522.JavaMail.jira@brutus> Date: Fri, 17 Jul 2009 07:17:15 -0700 (PDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Closed: (DERBY-4311) BaseJDBCTestCase.assertErrorCode() never fails In-Reply-To: <1018046348.1247832794787.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen closed DERBY-4311. ------------------------------------- Resolution: Fixed Fix Version/s: 10.6.0.0 Committed revision 795092. > BaseJDBCTestCase.assertErrorCode() never fails > ---------------------------------------------- > > Key: DERBY-4311 > URL: https://issues.apache.org/jira/browse/DERBY-4311 > Project: Derby > Issue Type: Bug > Components: Test > Affects Versions: 10.6.0.0 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Priority: Minor > Fix For: 10.6.0.0 > > Attachments: assertErrorCode.diff > > > BaseJDBCTestCase.assertErrorCode() doesn't throw an exception if the error code does not match the expected code. > public static void assertErrorCode(String message, int expected, SQLException exception) { > while (exception != null) > { > try { > assertEquals(message, expected,exception.getErrorCode()); > } catch (AssertionFailedError e) { > // check and see if our error code is in a chained exception > exception = exception.getNextException(); > } > } > } > If the error code doesn't match, assertEquals() will raise an error, but the exception is caught and silently ignored. > Since none of the tests uses assertErrorCode() I suggest we remove it. We can re-implement one that works later if the need arises. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.