[
http://issues.apache.org/jira/browse/DERBY-1474?page=comments#action_12419589 ]
Knut Anders Hatlen commented on DERBY-1474:
-------------------------------------------
Hi Kristian,
I think your approach is good. I have a couple of comments about your
BaseTestCase.generateError() method. All of them are minor and just a
matter of taste. Please ignore them if you disagree.
1) I think I would have called it throwAssertionError() and let it
throw the error, not return it. That would make it analogous to
SanityManager.THROWASSERT().
2) You don't need reflection to generate the
junit.framework.AssertionFailedError (junit.jar is in the
classpath).
3) You could also avoid the use of reflection to generate the
java.lang.AssertionError as well. To do this, you need to modify
build.xml in the same directory as BaseTestCase.java. In the second
javac clause, make this change:
- <pathelement path="${compile.classpath}"/>
+ <pathelement path="${java14compile.classpath}"/>
Then the classes will be compiled against the 1.4 libraries, but
since source="1.3" and target="1.3", they will run on 1.3 too. With
this change, generateError() could be written as simple as this:
Error error = null;
if (JVMInfo.JDK_ID <= JVMInfo.J2SE_13) {
error = new AssertionFailedError(msg + " : " + cause.getMessage());
cause.printStackTrace();
} else {
error = new AssertionError(msg);
error.initCause(cause);
}
return error;
This approach is also used in the client driver.
> 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, 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