[ 
https://issues.apache.org/jira/browse/DERBY-2514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12600442#action_12600442
 ] 

Knut Anders Hatlen commented on DERBY-2514:
-------------------------------------------

It looks like the test cases in the attached patch cover the two cases 
identified by Myrna. Some (mainly cosmetic) comments:

- When there's an expected SQLException, like in testDMDconnClosed(), we 
normally check that the SQL state is the expected one by calling the 
assertSQLState() method.

- Instead of calling fail() from within a catch clause when there's an 
unexpected exception, the exception should be thrown by the test method. That 
way JUnit is able to report the stack trace of the original exception, which 
makes it easier to debug problems if the test fails.

- Perhaps testDMDconnClosed() could be moved to the existing 
jdbcapi/DatabaseMetaDataTest?

- The test case testSerializedException() in derbynet/SqlExceptionTest already 
tests that an SQLException thrown by the embedded driver is serializable (based 
on the comments, I think it intends to tests a client exception, but that's not 
what it does), so testDerby62() doesn't actually add test coverage. Perhaps 
it's better to clean up SqlExceptionTest rather than adding a new test?

> convert lang/closed.java to junit
> ---------------------------------
>
>                 Key: DERBY-2514
>                 URL: https://issues.apache.org/jira/browse/DERBY-2514
>             Project: Derby
>          Issue Type: Test
>          Components: Newcomer, Test
>         Environment: convert lang/closed.java to junit
>            Reporter: Ramandeep Kaur
>            Assignee: Svein Erik Løvland
>            Priority: Minor
>         Attachments: Derby2514.diff, Derby2514_2.diff
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to