On 24/11/2011 6:04 AM, Brandon Passanisi wrote:
I'm currently looking at a bug report: http://monaco.sfbay.sun.com/detail.jsf?cr=5066854 which describes an issue where a simple program was run with the option -esa to enable system assertions. The bug author describes that, in the provided sample code, an AssertionError occurs when the spec says a MissingFormatArgumentException should be thrown. When running the sample program without the -esa option, a MissingFormatArgumentException is thrown. It seems to me that it shouldn't be unexpected to see an AssertionError when -esa is used, instead of the MissingFormatArgumentException. In fact, this behavior appears to not be limited to this particular test case, and can possibly occur with other APIs if an AssertionError is seen before an expected exception. I was hoping to see some sort of explanation in the evaluation or comments section of the bug report, but the bug report was only updated with references about how the bug was filed too late for a release. Can someone clarify if this behavior with -esa is actually a bug?
I would say it is a bug. Asserts should not be checking conditions that are part of the defined contract for a method. So TCK style tests should still work/pass whether -esa is set or not.
David
