jpackage IconTest has some issues:
1. It should have caught JDK-8370155, but it didn't.
2. It expects wrong messages in jpackage log. E.g., IconTest(Package, CustomWithResourceDirIcon, CustomWithResourceDirIcon) test on Linux output:
---
...
Using custom package resource [icon] (loaded from file open/test/jdk/tools/jpackage/resources/icon2.png).
Using custom package resource [icon] (loaded from file open/test/jdk/tools/jpackage/resources/icon4.png).
...
TRACE: assertNotNull( Using custom package resource [icon] (loaded from file open/test/jdk/tools/jpackage/resources/icon2.png).): Check output contains [Using custom package resource [icon] (loaded from file] string
TRACE: assertNotNull( Using custom package resource [icon] (loaded from file open/test/jdk/tools/jpackage/resources/icon2.png).): Check output contains [Using custom package resource [icon] (loaded from file] string
---
It expects "open/test/jdk/tools/jpackage/resources/icon2.png" substring twice instead of expecting "open/test/jdk/tools/jpackage/resources/icon2.png" followed by "open/test/jdk/tools/jpackage/resources/icon4.png".
It doesn't fail because every time it looks up for a substring, it searches through the entire jpackage output.
3. It uses localization key values to look for substrings in the jpackage output [1]. It should format lookup strings using "message.using-custom-resource", "message.using-custom-resource-from-file", "message.using-default-resource" localization keys from [2] instead.
[1] https://github.com/openjdk/jdk/blob/eff6439e75d79c67370e79638024296e01101b48/test/jdk/tools/jpackage/share/IconTest.java#L223
[2] https://github.com/openjdk/jdk/blob/eff6439e75d79c67370e79638024296e01101b48/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties#L35
1. It should have caught JDK-8370155, but it didn't.
2. It expects wrong messages in jpackage log. E.g., IconTest(Package, CustomWithResourceDirIcon, CustomWithResourceDirIcon) test on Linux output:
---
...
Using custom package resource [icon] (loaded from file open/test/jdk/tools/jpackage/resources/icon2.png).
Using custom package resource [icon] (loaded from file open/test/jdk/tools/jpackage/resources/icon4.png).
...
TRACE: assertNotNull( Using custom package resource [icon] (loaded from file open/test/jdk/tools/jpackage/resources/icon2.png).): Check output contains [Using custom package resource [icon] (loaded from file] string
TRACE: assertNotNull( Using custom package resource [icon] (loaded from file open/test/jdk/tools/jpackage/resources/icon2.png).): Check output contains [Using custom package resource [icon] (loaded from file] string
---
It expects "open/test/jdk/tools/jpackage/resources/icon2.png" substring twice instead of expecting "open/test/jdk/tools/jpackage/resources/icon2.png" followed by "open/test/jdk/tools/jpackage/resources/icon4.png".
It doesn't fail because every time it looks up for a substring, it searches through the entire jpackage output.
3. It uses localization key values to look for substrings in the jpackage output [1]. It should format lookup strings using "message.using-custom-resource", "message.using-custom-resource-from-file", "message.using-default-resource" localization keys from [2] instead.
[1] https://github.com/openjdk/jdk/blob/eff6439e75d79c67370e79638024296e01101b48/test/jdk/tools/jpackage/share/IconTest.java#L223
[2] https://github.com/openjdk/jdk/blob/eff6439e75d79c67370e79638024296e01101b48/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties#L35
- relates to
-
JDK-8370155 jpackage misleading/ambigous logging on icons used in packaging
-
- Open
-
- links to
-
Review(master)
openjdk/jdk/27883