RFR: 8288495: [test] Make OutputAnalyzer exception more informative [v2]

Leonid Mesnik lmesnik at openjdk.org
Thu Jun 23 18:22:53 UTC 2022


On Thu, 23 Jun 2022 14:09:20 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> The RuntimeException from OutputAnalyzer for expected and unexpected exit values should include both the actual and expected values.
>> The method `shouldHaveExitvalue` and `shouldNotHaveExitValue` include the value expected and the value not expected instead of the actual value returned. The values provided in the exception are already known quantities in the code, what is not known is the actual value.  
>> The actual value is printed to stderr but not the expected value and in the logs, the exception report is frequently to stdout and therefor separated in the log from the output of stderr.  Including both expected and actual values in the exception makes it easier to understand.
>> 
>> Exception messages should not include newlines.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert change to shouldNotHaveExitValue
>   Correct OutputAnalyzerTest

Marked as reviewed by lmesnik (Reviewer).

Please update copyrights in the test file, otherwise, the last version looks good.

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

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


More information about the core-libs-dev mailing list