RFR: 8376038: Refactor java/sql tests to use JUnit [v2]
Lance Andersen
lancea at openjdk.org
Tue Jan 27 20:00:15 UTC 2026
On Tue, 27 Jan 2026 17:44:55 GMT, Justin Lu <jlu at openjdk.org> wrote:
> The latest batch of commits updates the _javax/sql_ testNG files to use JUnit as well. `BaseTest` which the majority of tests rely on remain `Lifecycle.PER_CLASS` (as needed) but the non `BaseTest` extending classes were able to migrate to the default life cycle. Note that the parameterized tests were updated to have their `autoCloseArgument` attribute set to false, since there were failures when left on the default value of true. For example, `close()` is a no-op for many of the `Stub` classes which get tested.
>
> > AutoCloseable arguments
> > Arguments that implement java.lang.AutoCloseable (or java.io.Closeable which extends java.lang.AutoCloseable) will be
> > automatically closed after the parameterized class or test invocation. To prevent this from happening, set the autoCloseArguments attribute in @ParameterizedTest to false.
>
> _JavaTimeTest_ was also updated to use JUnit and moved under the folder accordingly. Do we want the _jdk/test/jdk/javax/sql/rowset_ tests to also be migrated to use JUnit as well?
Yes these should be migrated at the same time, thank you for asking
Also, is it appropriate to place _jdk/test/jdk/java/sql/driverModuleTests/DriverManagerModuleTests.java_ under _jdk/test/jdk/java/sql/junit/test/sql/othervm_ since it is now a JUnit test?
No harm in that.
As I mentioned previously we probably can get rid of the junit directory(previously testing) given all of the tests are junit now. Or we can do it at a later time.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29354#issuecomment-3807241756
More information about the core-libs-dev
mailing list