Class StandardStreamsHandler

java.lang.Object
org.junit.platform.console.command.StandardStreamsHandler
All Implemented Interfaces:
AutoCloseable

class StandardStreamsHandler extends Object implements AutoCloseable
  • Field Details

  • Constructor Details

    • StandardStreamsHandler

      public StandardStreamsHandler()
  • Method Details

    • redirectStandardStreams

      public void redirectStandardStreams(Path stdoutPath, Path stderrPath)
      Redirect standard output (stdout) and standard error (stderr) to the specified file paths.

      If the paths are the same, both streams are redirected to the same file.

      The default charset is used for writing to the files.

      Parameters:
      stdoutPath - the file path for standard output, or null to indicate no redirection
      stderrPath - the file path for standard error, or null to indicate no redirection
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • isSameFile

      private static boolean isSameFile(Path path1, Path path2)