--- old/test/jdk/lib/testlibrary/OutputAnalyzerTest.java 2018-09-05 14:30:42.000000000 -0700 +++ new/test/jdk/lib/testlibrary/OutputAnalyzerTest.java 2018-09-05 14:30:41.000000000 -0700 @@ -151,17 +151,23 @@ // expected } - if (output.shouldMatchByLine(byLinePattern) != 1) { - throw new Exception("shouldMatchByLine() should find one line"); + try { + output.shouldMatchByLine(byLinePattern); + } catch (RuntimeException e) { + throw new Exception("shouldMatchByLine() failed", e); } + try { output.shouldMatchByLine(nonExistingPattern); throw new Exception("shouldMatchByLine() failed to throw exception"); } catch (RuntimeException e) { // expected } - if (output.stdoutShouldMatchByLine(stdoutByLinePattern) != 1) { - throw new Exception("stdoutShouldMatchByLine() should find one line"); + + try { + output.stdoutShouldMatchByLine(stdoutByLinePattern); + } catch (RuntimeException e) { + throw new Exception("stdoutShouldMatchByLine() failed", e); } // Should not match