JDK-8072687 : Update OutputAnalyzer to work with files
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: test
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2015-02-06
  • Updated: 2019-11-02
  • Resolved: 2019-11-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Description
Currently the utility class OutputAnalyzer can work with streams and process outputs.
I suggest adding a simple ctor that will help working with file:

  /**
   * Create an OutputAnalyzer, a utility class for verifying output and exit
   * value from a Process
   *
   * @param file a text file to analyze
   * @throws IOException If an I/O error occurs.
   */
  public OutputAnalyzer(File txt) throws IOException {
      this(new String(Files.readAllBytes(Paths.get(txt)));
  }



Comments
JDK-8222713 added OutputAnalyzer(Path)
02-11-2019

RFR: http://mail.openjdk.java.net/pipermail/hotspot-dev/2015-February/017196.html
19-05-2017

fix: http://cr.openjdk.java.net/~dfazunen/dkononen/8072687/webrev.01/
27-05-2015