RFR: 8288013: jpackage: test utility Windows registry enhancement

Alex Kasko akasko at openjdk.org
Tue Jun 28 11:33:42 UTC 2022


On Wed, 8 Jun 2022 11:46:42 GMT, Alex Kasko <akasko at openjdk.org> wrote:

> In jpackage test suite there is a test utility WindowsHelper.queryRegistryValue . It is used to verify changes to Windows registry that can be done by installer packages. It spawns `reg.exe query` process and parses its output. This patch adds support for quering empty values and additional REG_* datatypes.
> 
> Correctness was verified manually with the following registry values:
> 
> 
>         //    (Default)    REG_SZ    test1
>         //    string_val    REG_SZ    test2
>         //    string_val_empty    REG_SZ
>         //    bin_val    REG_BINARY    4242
>         //    bin_val_empty    REG_BINARY
>         //    dword_val    REG_DWORD    0x2a
>         //    qword_val    REG_QWORD    0x2a
>         //    multi_string_val    REG_MULTI_SZ    test3\0test4
>         //    multi_string_val_empty    REG_MULTI_SZ
>         //    expand_string_val    REG_EXPAND_SZ    test5
>         //    expand_string_val_empty    REG_EXPAND_SZ
> 
> 
> Corresponding utility output:
> 
> 
> [04:36:38.190] TRACE: Registry value [] at [...] path is [test1]
> [04:36:38.220] TRACE: Registry value [string_val] at [...] path is [test2]
> [04:36:38.251] TRACE: Registry value [string_val_empty] at [...] path is []
> [04:36:38.282] TRACE: Registry value [bin_val] at [...] path is [4242]
> [04:36:38.315] TRACE: Registry value [bin_val_empty] at [...] path is []
> [04:36:38.347] TRACE: Registry value [dword_val] at [...] path is [0x2a]
> [04:36:38.378] TRACE: Registry value [qword_val] at [...] path is [0x2a]
> [04:36:38.410] TRACE: Registry value [multi_string_val] at [...] path is [test3\\0test4]
> [04:36:38.441] TRACE: Registry value [multi_string_val_empty] at [...] path is []
> [04:36:38.473] TRACE: Registry value [expand_string_val] at [...] path is [test5]
> [04:36:38.506] TRACE: Registry value [expand_string_val_empty] at [...] path is []
> 
> 
> Testing:
> 
>  - [x] ran "jtreg:jdk/tools/jpackage/windows" before and after the patch

Thanks for the reviews! I don't have Committer role in JDK Project, would appreciate if someone can push it.

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

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


More information about the core-libs-dev mailing list