On Mon, 23 Mar 2026 19:23:33 GMT, David Beaumont <[email protected]> wrote:

>> Similar to other recent JAXP test migration PRs, but simpler in most cases.
>> 
>> Edge cases include:
>> * Lots of tests needing the PER_CLASS life-cycle due to having a base class 
>> with non-trivial test setup
>> * Tests with incorrect expectations about thrown exceptions
>> * Tests needlessly catching test framework exceptions when they should be 
>> left to fail normally
>
> David Beaumont has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Be consistent with static imports

test/jaxp/javax/xml/jaxp/unittest/sax/Bug6889654Test.java line 46:

> 44:  */
> 45: public class Bug6889654Test {
> 46: 

Worth mentioning this change. If you look at what's being tested-for in this 
test, it amounts to nothing more than:
"the wrapped exception's toString() contains the message of the exception it 
wraps"

This can be tested for without the setting up of a parser, and with the wrapped 
exception not needing to also be a SAXException.

test/jaxp/javax/xml/jaxp/unittest/sax/Bug6949607Test.java line 45:

> 43:  */
> 44: public class Bug6949607Test {
> 45: 

This test was adjusted so that it's actually tested that the assertion in the 
handle was called (otherwise it could silently pass).

test/jaxp/javax/xml/jaxp/unittest/sax/Bug7057778Test.java line 58:

> 56:  */
> 57: public class Bug7057778Test {
> 58: 

I decided to just rewrite this test after figuring out what it does. It simply 
ensures that after a failed parse, the file is not left open (which would make 
in non-deleteable on Windows).
There's no need for the handler (that's only writing to stdout), or the manual 
file copy, or the test file itself.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30283#discussion_r2976998784
PR Review Comment: https://git.openjdk.org/jdk/pull/30283#discussion_r2977006678
PR Review Comment: https://git.openjdk.org/jdk/pull/30283#discussion_r2977021361

Reply via email to