RFR: 8350011: Convert jpackage test lib tests in JUnit format
Alexey Semenyuk
asemenyuk at openjdk.org
Thu Feb 13 22:57:24 UTC 2025
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 change `@@openJdkDir@@` token with the path to local OpenJDK repo at [JUnitAdapter.java:46](https://github.com/openjdk/jdk/pull/23615/files#diff-8719943fb769c04daf413427dc812650763f588cbd0ef6b50cccd11260353c0a).
-------------
Commit messages:
- Remove TKit.assertEquals(boolean) and TKit.assertNotEquals(boolean). They belong to different branch
- Minor
- Undo unrelated change
- Fix AnnotationsTest to create test work directory in temp directory supplied by JUnit
- Manual merge
- Make junit pass
- Convert helpers-test tests to junit format. It is easier to debug them in IDE this way.
Changes: https://git.openjdk.org/jdk/pull/23615/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23615&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8350011
Stats: 328 lines in 10 files changed: 142 ins; 127 del; 59 mod
Patch: https://git.openjdk.org/jdk/pull/23615.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23615/head:pull/23615
PR: https://git.openjdk.org/jdk/pull/23615
More information about the core-libs-dev
mailing list