On Tue, 10 Mar 2026 11:32:12 GMT, David Beaumont <[email protected]> wrote:
> Refactor tests in test/jaxp/javax/xml/jaxp/functional/javax/xml to use junit, > along with ancillary utilities and a handful of related tests elsewhere. > > The difficulty in these refactorings is the use of common utilities which > themselves depend on TestNG classes, which are not available when running > JUnit tests. Thus, several bits of functionality in utility classes (esp. > classes in `jaxp.library`) has had to be re-implemented and inlined. This > isn't terrible, since most of these were one line functions (or complex > functions which could be replaced with one line). > > Another complexity is accounting for the differences in test lifecycle > management between TestNG and JUnit. A few classes needed to exploit the > lifecycle and execution modes for single setup and single threaded operation. > > Finally, the move from "expected exceptions" on the whole test method to > using `assertThrows` threw up a lot of issues where tests weren't testing > what they claimed (the exception was not being thrown by the final statement > in the test). For these tests I've simplified them (rewriting them entirely > in some cases) but they now test what they claim to be testing and are much > clearer about where assertions are made. > > However, because these tests affect the thrown exceptions in test method > signatures, I ran a tidyup to remove all unused exceptions from method > signatures (rather than spending hours manually removing the effected subset). This pull request has now been integrated. Changeset: 318646a6 Author: David Beaumont <[email protected]> URL: https://git.openjdk.org/jdk/commit/318646a6b4559e93722937c97329a9d710b59479 Stats: 2495 lines in 48 files changed: 442 ins; 814 del; 1239 mod 8379626: Refactor jaxp/functional/javax/xml tests to use JUnit Reviewed-by: vyazici, joehw ------------- PR: https://git.openjdk.org/jdk/pull/30165
