Rework Executor class from jpackage test lib to support separate configuration 
of stdout and stderr streams handling:
 - New `Executor.discardStdout(boolean)` and `Executor.discardStderr(boolean)` 
methods enable/disable stdout and stderr streams, respectively;
 - New `Executor.Result.stdout()` accesses saved stdout stream;
 - New `Executor.Result.stderr()` accesses saved stderr stream;
 - `Executor.Result.getOutput()` returns merged stdout and stderr streams. 
Contents of the stdout go first, contents of the stderr follow;
 - New `JPackageCommand.discardStdout(boolean)` and 
`JPackageCommand.discardStderr(boolean)` methods enable/disable stdout and 
stderr streams produced by jpackage, respectively.

Additionally:
 - Streamline `BasicTest.testErrorsAlwaysPrinted()`;
 - Fix WindowsHelper and Win8301247Test as they stopped working as expected due 
to reordering the contents of stdout and stderr streams in the merged stream 
returned by `Executor.Result.getOutput()`.

-------------

Commit messages:
 - Fix Win8301247Test to make it log exception if any occurs after the laucnher 
is started. Prior this change test just hang with no output.
 - Add JPackageCommand.discardStdout(boolean) and 
JPackageCommand.discardStderr(boolean). Better 
BasicTest.testErrorsAlwaysPrinted()
 - Add Executor.discardStdout() and Executor.discardStderr(). stsdout and 
stвerr are captured individually and dumped sequentially (no stderr redirection 
into stdout any more for process builder). Bugfix 
WindowsHelper.findAppLauncherPIDs() that relied on specific order or merged 
stderr and stdout.

Changes: https://git.openjdk.org/jdk/pull/24745/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24745&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354988
  Stats: 659 lines in 7 files changed: 488 ins; 58 del; 113 mod
  Patch: https://git.openjdk.org/jdk/pull/24745.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24745/head:pull/24745

PR: https://git.openjdk.org/jdk/pull/24745

Reply via email to