You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2009/07/17 14:13:14 UTC

[jira] Created: (DERBY-4311) BaseJDBCTestCase.assertErrorCode() never fails

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


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.


[jira] Commented: (DERBY-4311) BaseJDBCTestCase.assertErrorCode() never fails

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732505#action_12732505 ] 

Kristian Waagan commented on DERBY-4311:
----------------------------------------

+1

> 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
>         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.


[jira] Updated: (DERBY-4311) BaseJDBCTestCase.assertErrorCode() never fails

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4311:
--------------------------------------

    Attachment: assertErrorCode.diff

The attached patch removes the two unused assertErrorCode() methods. I'm running suites.All as a sanity test and will commit if it passes.

> 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
>         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.


[jira] Closed: (DERBY-4311) BaseJDBCTestCase.assertErrorCode() never fails

Posted by "Knut Anders Hatlen (JIRA)" <ji...@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.