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).

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

Commit messages:
 - Migrate jaxp/functional/javax/xml tests to JUnit

Changes: https://git.openjdk.org/jdk/pull/30165/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30165&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8379626
  Stats: 2470 lines in 47 files changed: 464 ins; 810 del; 1196 mod
  Patch: https://git.openjdk.org/jdk/pull/30165.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30165/head:pull/30165

PR: https://git.openjdk.org/jdk/pull/30165

Reply via email to