RFR: 8334238: Enhance AddLShortcutTest jpackage test
Alexey Semenyuk
asemenyuk at openjdk.org
Fri Aug 1 00:30:23 UTC 2025
- Enhance AddLShortcutTest to cover more combinations of shortcut configurations of the main and additional launchers.
- Test shortcuts in the predefined app image.
Additionally, rework launcher verification: move launcher icon and shortcut verification code from AdditionalLauncher into LauncherVerifier. This way launcher verification code is encapsulated in a single class that is applied to the main and additional launchers.
Rework launcher shortcut verification on Windows: Read shortcuts from MSI tables. This allows testing of expected and actual shortcuts without installing the MSI. This refactoring removed duplicated checks of file associations: It was performed for every additional launcher; now it is executed for the main launcher only. File association is bound to the main launcher, there is no point to verify it as many times as the number of launchers.
Implement launching launchers through shortcuts on Linux and Windows. The new `AddLShortcutTest.testInvokeShortcuts` test uses this new functionality.
Compared traces of IconTest, AddlauncherTest, and AddLShortcutTest tests with and without this patch to verify no unexpected changes in the coverage.
-------------
Commit messages:
- LauncherShortcut: bugfix
- LinuxHelper: Use `gtk-launch` command to launch .desktop files
- AddLShortcutTest: make it work on Linux
- WinShortcutVerifier: fix bad merge
- AddLShortcutTest: add testStartupDirectory() tests to exercise combinations of startup directory in the main launcher and in the additional launcher; add testInvokeShortcuts() to invoke launchers through shortcuts and verify work directory; cover shortcuts in the predefined app image
- WinShortcutVerifier: add getInvokeShortcutSpecs(); streamline expectLauncherShortcuts()
- LinuxHelper: add getInvokeShortcutSpecs(); add DesktopFile type to streamline verifyDesktopFile()
- PrintEnv: support `--print-workdir` CLI option and `jpackage.test.appOutput` Java property to redirect output
- Rework .desktop files verification: Always verify .desktop files are installed in the system folder on package install and uninstalled on package uninstall. Always verify contents of .desktop files.
- LauncherAsServiceVerifier: follow-up for the changes in the AdditionalLauncher
- ... and 12 more: https://git.openjdk.org/jdk/compare/3d74cbe0...8d8e7d8f
Changes: https://git.openjdk.org/jdk/pull/26584/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26584&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8334238
Stats: 2676 lines in 21 files changed: 1976 ins; 481 del; 219 mod
Patch: https://git.openjdk.org/jdk/pull/26584.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26584/head:pull/26584
PR: https://git.openjdk.org/jdk/pull/26584
More information about the core-libs-dev
mailing list