On Wed, 31 May 2023 22:08:43 GMT, Chris Plummer <[email protected]> wrote:
>> Serguei Spitsyn has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> minor renaming in new test TestJcmdNoAgentLoad.java
>
> test/jdk/sun/tools/jcmd/TestJcmdNoAgentLoad.java line 68:
>
>> 66: System.out.println("Found output line with the expected
>> error message:\n" + line);
>> 67: }
>> 68: }
>
> Why not just use `OutputAnalyzer.shouldContain()`?
Good suggestion, thanks. I've not found this method. :)
> test/jdk/sun/tools/jcmd/TestJcmdNoAgentLoad.java line 70:
>
>> 68: }
>> 69: if (!seenPattern) {
>> 70: throw new RuntimeException("Not found expected error message
>> in output");
>
> "Not found" -> "Did not find"
>
> Also, you should include the expected error message in the output.
Okay. But I've replaced this code with `OutputAnalyzer.shouldContain()` as you
suggested.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14244#discussion_r1213750622
PR Review Comment: https://git.openjdk.org/jdk/pull/14244#discussion_r1213751619