On Wed, 22 Jun 2022 18:19:56 GMT, Roger Riggs <rri...@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.

test/lib/jdk/test/lib/process/OutputAnalyzer.java line 505:

> 503:             reportDiagnosticSummary();
> 504:             throw new RuntimeException("Unexpected to get exit value of 
> ["
> 505:                     + notExpectedExitValue + "], exit value is: [" + 
> getExitValue() + "]");

This seems redundant to me. "Unexpected to get exit value of 
[notExpectedExitValue]." should suffice?

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

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

Reply via email to