RFR: 8350011: Convert jpackage test lib tests in JUnit format
Alexey Semenyuk
asemenyuk at openjdk.org
Fri Feb 14 01:30:15 UTC 2025
On Thu, 13 Feb 2025 23:49:24 GMT, Alexander Matveev <almatvee 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).
>
> 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?
No. It sneaked in by an accident. Will fix it
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23615#discussion_r1955430984
More information about the core-libs-dev
mailing list