On Thu, 28 May 2026 06:28:53 GMT, Ashay Rane <[email protected]> wrote:

>> Previously, the test expected a precise match between the produced and
>> expected error messages, but such a check fails when the test fails for
>> more than the expected reason, like when WiX is not available on
>> Windows.   With this patch, specific test cases that require WiX are
>> skipped when WiX is unavailable.  To probe if WiX is available, we use
>> reflection to call `jdk.jpackage.internal.WixTool.createToolSet()` and
>> check whether the call resulted in an `InvocationTargetException`.  The
>> reason for using reflection as opposed to a static reference is that the
>> `WixTool` package exists only in the Windows builds.
>> 
>> Validated this patch on a Windows box that doesn't have WiX available.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Ashay Rane has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Skip test if WiX isn't available or the test spec doesn't care about WiX
>   
>   Instead of relaxing the error check, this patch selectively skips test
>   cases when the test case either doesn't care about WiX (like the
>   `--help` or `--version` test cases) or when WiX is necessary to run the
>   test case but WiX isn't available.  To probe if WiX is available, we use
>   reflection to call `jdk.jpackage.internal.WixTool.createToolSet()` and
>   check whether the call resulted in an `InvocationTargetException`.  The
>   reason for using reflection as opposed to a static reference is that the
>   `WixTool` package exists only in the Windows builds.

Thanks for the patch; I checked that the test passes on a few different 
machines at my end.

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

PR Comment: https://git.openjdk.org/jdk/pull/31282#issuecomment-4580204696

Reply via email to