Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8370156

Fix jpackage IconTest

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • 17, 21, 25, 26
    • tools
    • None
    • Fix Understood
    • generic
    • generic

      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

            asemenyuk Alexey Semenyuk
            asemenyuk Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: