[ http://issues.apache.org/jira/browse/DERBY-1474?page=all ]
Kristian Waagan updated DERBY-1474:
-----------------------------------
Attachment: derby-1474-2b.diff
'derby-1474-2b.diff' addresses the two last comments, from Knut Anders and
Andreas.
Originally I didn't want to have the assertEquals-methods throw checked
exceptions. This can cause some inconveniences* in test-methods throwing other
IOExceptions, and it doesn't match the behavior of the rest of the JUnit
assertEquals-methods. However, after having read up on the differences between
failures and errors, and the feedback I got, I have decided to go for checked
exceptions anyway. Makes the code simple. Thanks to Andreas for making me
reconsider this.
The solution makes the very good suggestions from Knut Anders non-applicable.
Too bad :)
Patch changes:
* addition of throws clause
* removal of try - catch
* reindentation of the new code (sorry, made the patch a bit meaty)
* moved the declaration of InputStream/Reader variables
Ready for another review/commit round.
*) For errors you usually want the full stack trace. If your test-method calls
methods that you expect to throw IOExceptions, and/or you have a throws
IOException clause, you should try to use as small try-catch blocks as possible
to allow the IOException from assertEquals to be caught by the JUnit framework
instead of your own catch block.
> Add assertEquals overloads for Blob and Clob
> --------------------------------------------
>
> Key: DERBY-1474
> URL: http://issues.apache.org/jira/browse/DERBY-1474
> Project: Derby
> Type: Sub-task
> Components: Test
> Versions: 10.2.0.0, 10.3.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Fix For: 10.2.0.0
> Attachments: derby-1474-1a.diff, derby-1474-1a.stat, derby-1474-1b.diff,
> derby-1474-1c.diff, derby-1474-2a.diff, derby-1474-2a.stat,
> derby-1474-2b.diff, error-output.txt
>
> Add assertEquals(Blob,Blob) and assertEquals(Clob,Clob) to BaseJDBCTestCase.
> The naming follows the JUnit scheme, and the methods throws an
> AssertionFailedError if the objects passed in are not equal.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira