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

Improve capabilities of jpackage test lib to validate error output of jpackage

XMLWordPrintable

    • b25
    • generic
    • generic

      Some jpackage tests validate the output of jpackage if it fails. They look up specific strings in jpackage's stderr. English l10n strings are used. See [1].
      It would be handy to use jpackage l10n keys instead of string values in these tests.
      This would allow automatic synchronization of the tests and jpackage string resources.
      Also, this will simplify tracking of error conditions coverage.
      In [2] instead of:

      {"Hello",
      null,
      new String[]{"--main-jar"},
      "--main-jar or --module"},

      It would be handy to have:

      {"Hello",
      null,
      new String[]{"--main-jar"},
      "--main-jar or --module"},
      "ERR_NoEntryPoint"

      where "ERR_NoEntryPoint" is a key in jpackage l10n property file [3]. jackage test lib should provide API to convert a key into a formatted string and examine jpackage output for its presence if it fails.

      [1] https://github.com/openjdk/jdk/blob/master/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ErrorTest.java
      [2] https://github.com/openjdk/jdk/blob/52c0b09b62ca82f7e0cbe910cb92243131f06765/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ErrorTest.java#L69
      [3] https://github.com/openjdk/jdk/blob/52c0b09b62ca82f7e0cbe910cb92243131f06765/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties#L113

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

              Created:
              Updated:
              Resolved: