< prev index next >
test/jdk/lib/testlibrary/OutputAnalyzerTest.java
Print this page
rev 51638 : [mq]: 8210112
rev 51639 : [mq]: 8210112-1
@@ -149,21 +149,27 @@
"stderrShouldMatch() failed to throw exception");
} catch (RuntimeException e) {
// 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
try {
output.shouldNotMatch(nonExistingPattern);
< prev index next >