RFR: 8351372: Improve negative tests coverage of jpackage [v2]

Alexey Semenyuk asemenyuk at openjdk.org
Mon Mar 10 15:54:56 UTC 2025


> Changes to tests:
>  - Added more test cases to ErrorTest.
>  - Added functionality to jpackage test lib to facilitate new ErrorTest test cases.
>  - Make all other negative tests use the `CannedFormattedString` class to validate error messages in jpackage output strictly.
>  - Removed redundant negative tests/test cases duplicating ErrorTest.
>  - Give unique descriptions to macos signing tests.
>  
> Changes to jpackage:
>  - Main.java: Catch `java.nio.file.NoSuchFileException` as `jdk.internal.opt.CommandLine.parse()` throws this exception instead of  `java.io.FileNotFoundException` to indicate missing command file. The issue was uncovered with the new ErrorTest test case for `ERR_CannotParseOptions` error ID.
>  - DeployParams.java: replace `ERR_MissingArgument` with `error.no-input-parameter` as the error is not missing argument of `--input` parameter, but missing `--input` parameter itself. The issue was uncovered with the new ErrorTest test cases for `ERR_MissingArgument` and ``error.no-input-parameter` error IDs.
>  - LauncherData.java: remove dead code as missing `--input` parameter is handled earlier in DeployParams.
>  - DottedVersion.java: fix exception messages based on the new test cases in ErrorTest.
>  - TokenRepalce.java/TokenRepalceTest.java: picked from https://github.com/openjdk/jdk/pull/23923 PR. It is needed for ErrorTest as well.

Alexey Semenyuk has updated the pull request incrementally with two additional commits since the last revision:

 - Fix typo
 - Fix Unicode signing certificate index

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23936/files
  - new: https://git.openjdk.org/jdk/pull/23936/files/eda0efec..54585147

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23936&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23936&range=00-01

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/23936.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23936/head:pull/23936

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


More information about the core-libs-dev mailing list