RFR: 8355328: Improve negative tests coverage for jpackage signing

Alexey Semenyuk asemenyuk at openjdk.org
Tue Apr 22 19:29:50 UTC 2025


Add tests covering `error.explicit-sign-no-cert` error ID to ErrorTest.

If signing identity validation fails, jpackage outputs three messages constructed from the following string IDs: `error.cert.not.found`, `error.explicit-sign-no-cert`, and `error.explicit-sign-no-cert.advice`.

`TKit.TextStreamVerifier.andThen()` method doesn't work correctly when combining more than two instances of `TKit.TextStreamVerifier` class. To address this bug and analyze jpackage's output for three expected strings when a non-existent signing identity is specified, the `TKit.TextStreamVerifier.andThen()` method was replaced with the `TKit.TextStreamVerifier.Group` class. Changes in other tests are a result of this change.

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

Commit messages:
 - Fix bad merge
 - Fix compilation error
 - Better negative tests coverage
 - Rework TKit.TextStreamVerifier.andThen() as it didn't work if called multiple times. Change signature from TKit.TextStreamVerifier.apply(Stream<String>) to TKit.TextStreamVerifier.apply(Iterator<String>) and TKit.TextStreamVerifier.apply(List<String>)

Changes: https://git.openjdk.org/jdk/pull/24786/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24786&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8355328
  Stats: 188 lines in 19 files changed: 117 ins; 18 del; 53 mod
  Patch: https://git.openjdk.org/jdk/pull/24786.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24786/head:pull/24786

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


More information about the core-libs-dev mailing list