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

Separate stderr and stdout in Executor class from jpackage test lib

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • tools
    • b20
    • generic
    • generic

      Currently, the Executor class from the jpackage test lib [1] runs commands in a way that stdout and stderr streams are merged in uncontrolled order.
      There is no way to access the contents of stdout and stderr streams individually. The class also doesn't offer an API to disable stderr or stdout individually.

      Lack of flexibility causes workarounds. E.g.: BasicTest.testErrorsAlwaysPrinted() [2] would be cleaner if it were possible to analyze the contents of the stderr stream and ignore the contents of the stdout stream.

      Rework the Executor class to allow control over stdout and stderr streams. Do not merge these streams in an uncontrolled order. If merged output is requested, it should consist of the contents of the stdout followed by the contents of the stderr stream.

      [1] https://github.com/openjdk/jdk/blob/4eae9b5ba61bfe262b43346a7499c98c1a54d2fe/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/Executor.java
      [2] https://github.com/openjdk/jdk/blob/7b0618859a7764b0d4c8b893a19dfb64f4351c07/test/jdk/tools/jpackage/share/BasicTest.java#L236

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

              Created:
              Updated:
              Resolved: