Alternatively, we could print out the stack trace ourselves. The logic to do this could be re-usable by a general-purpose assertEquals() overload which compares two Throwables. Failing by calling assertEquals() seems like the way the JUnit wants to track errors.

Regards,
-Rick

Knut Anders Hatlen wrote:

Currently, BaseJDBCTestCase.assertSQLState() and JDBC.assertSQLState()
basically do an assertEquals() on the SQL state. If the SQL state
doesn't match the expected value, an AssertionFailure is raised, but
the original exception is thrown away.

Should we instead do something like this
 if (!expected.equals(sqle.getSQLState())) throw sqle;
?

This way, we preserve the stack trace and the error message, not only
the SQL state.


Reply via email to