On Tue, 25 Nov 2025 03:58:17 GMT, Alexander Matveev <[email protected]> 
wrote:

> Added following tests:
> - Verify mac app store PKG doesn't have scripts (added to 
> `PkgScriptsTest.java`).
> - `--launcher-as-service` ignored for mac app store PKG  (added to 
> `ServiceTest.java`).
> - `--launcher-as-service` for additional launcher ignored for mac app store 
> PKG (added to `ServiceTest.java`).

test/jdk/tools/jpackage/macosx/PkgScriptsTest.java line 73:

> 71:             },
> 72:             { new PkgInstallScript[]{
> 73:                     PkgInstallScript.POSTINSTALL }, true,

Can we avoid the copy/paste? Something like:

    public static Collection<Object[]> input() {
        List<Object[]> data = new ArrayList<>();
        for (var appStore : List.of(true, false)) {
            for (var scriptRoles : List.of(
                    List.of(PkgInstallScript.PREINSTALL, 
PkgInstallScript.POSTINSTALL),
                    List.of(PkgInstallScript.PREINSTALL),
                    List.of(PkgInstallScript.POSTINSTALL)
            )) {
                data.add(new Object[] 
{scriptRoles.toArray(PkgInstallScript[]::new), appStore});
            }
        }
        return data;
    }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28487#discussion_r2560682990

Reply via email to