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

Minor improvements of jpackage test library

XMLWordPrintable

    • b24
    • generic
    • generic

      Minor improvements to jpackage test lib:

      1. There are a few dependencies on java.io.File in jpackage test library. They can be fairly easily eliminated. java.io.File.pathSeparator may be still used.

      2. TKit.assert...() functions allow additional messages appended to log records. But some of these functions (e.g.: TKit.assertTrue(), TKit.assertEquals()) don't use TKit.concatMessages() function to build log string, instead they use String.format() [1]. This results in the wrong output if the additional log message is an empty string or null. E.g.:

      `TKit.assertTrue(true, "Foo")` and `TKit.assertTrue(false, "Foo")` calls will output:
      ---
      TRACE: assertTrue(): Foo <<<< Correct, output as expected
      ERROR: Failed: Foo <<<< Correct, output as expected
      ---

      `TKit.assertTrue(true, null)` and `TKit.assertTrue(false, null)` calls will output:
      ---
      TRACE: assertTrue(): null <<<< This is wrong, should be "TRACE: assertTrue()"
      ERROR: Failed <<<< Correct, output as expected
      ---

      [1] https://github.com/openjdk/jdk/blob/52c0b09b62ca82f7e0cbe910cb92243131f06765/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java#L676

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

              Created:
              Updated:
              Resolved: