RFR: 8350011: Convert jpackage test lib tests in JUnit format
Alexander Matveev
almatvee at openjdk.org
Thu Feb 13 23:55:10 UTC 2025
On Thu, 13 Feb 2025 14:37:50 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:
> Convert jpackage test library tests in JUnit format. This simplifies running them in IDE.
>
> Added [JUnitAdapter](https://github.com/openjdk/jdk/pull/23615/files#diff-8719943fb769c04daf413427dc812650763f588cbd0ef6b50cccd11260353c0a) class to simplify running jpackage test-lib tests with JUnit. `JUnitAdapter.runJPackageTests()` will run the jpackage test-lib test as a JUnit test. The test work directory will be created in a temporary directory supplied by JUnit.
>
> All jpackage test-lib test classes changed to extend `JUnitAdapter`. As they didn't have a default ctor, they were converted accordingly.
>
> Important: Set `test.src` system property if run these tests outside of jtreg (from IDE) or ad-hoc replace `@@openJdkDir@@` token with the path to local OpenJDK repo at [JUnitAdapter.java:46](https://github.com/openjdk/jdk/pull/23615/files#diff-8719943fb769c04daf413427dc812650763f588cbd0ef6b50cccd11260353c0a).
Looks good with one minor comment.
test/jdk/tools/jpackage/helpers-test/jdk/jpackage/test/AnnotationsTest.java line 322:
> 320: t.printStackTrace(System.err);
> 321: System.exit(1);
> 322: return;
Do we need `return` here?
-------------
PR Review: https://git.openjdk.org/jdk/pull/23615#pullrequestreview-2616454453
PR Review Comment: https://git.openjdk.org/jdk/pull/23615#discussion_r1955361325
More information about the core-libs-dev
mailing list