diff --git a/test/jdk/tools/jpackage/windows/WinResourceTest.java b/test/jdk/tools/jpackage/windows/WinResourceTest.java index 72e805d0a48..db897e1aa69 100644 --- a/test/jdk/tools/jpackage/windows/WinResourceTest.java +++ b/test/jdk/tools/jpackage/windows/WinResourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,8 @@ import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.Annotations.Parameters; import java.util.List; +import static jdk.jpackage.test.WindowsHelper.WixType.WIX3; +import static jdk.jpackage.test.WindowsHelper.getWixTypeFromVerboseJPackageOutput; /** * Test --resource-dir option. The test should set --resource-dir to point to @@ -83,11 +85,18 @@ public void test() throws IOException { .addBundleVerifier((cmd, result) -> { // Assert jpackage picked custom main.wxs and failed as expected by // examining its output + final String expectedWixErrorMsg; + if (getWixTypeFromVerboseJPackageOutput(result) == WIX3) { + expectedWixErrorMsg = "error CNDL0104 : Not a valid source file"; + } else { + expectedWixErrorMsg = "error WIX0104: Not a valid source file"; + } + TKit.assertTextStream(expectedLogMessage) .predicate(String::startsWith) .apply(JPackageCommand.stripTimestamps( result.getOutput().stream())); - TKit.assertTextStream("error CNDL0104 : Not a valid source file") + TKit.assertTextStream(expectedWixErrorMsg) .apply(result.getOutput().stream()); }) .setExpectedExitCode(1)