8258057: serviceability/attach/RemovingUnixDomainSocketTest.java doesn't ignore VM warnings
Reviewed-by: cjplummer, amenkov, dholmes
This commit is contained in:
parent
143998e46c
commit
7b05439dcc
@ -51,7 +51,8 @@ public class RemovingUnixDomainSocketTest {
|
|||||||
jcmd.addToolArg(Long.toString(pid));
|
jcmd.addToolArg(Long.toString(pid));
|
||||||
jcmd.addToolArg("VM.version");
|
jcmd.addToolArg("VM.version");
|
||||||
|
|
||||||
Process jcmdProc = ProcessTools.startProcess("jcmd", new ProcessBuilder(jcmd.getCommand()));
|
ProcessBuilder pb = new ProcessBuilder(jcmd.getCommand());
|
||||||
|
Process jcmdProc = pb.start();
|
||||||
|
|
||||||
OutputAnalyzer out = new OutputAnalyzer(jcmdProc);
|
OutputAnalyzer out = new OutputAnalyzer(jcmdProc);
|
||||||
|
|
||||||
@ -66,7 +67,7 @@ public class RemovingUnixDomainSocketTest {
|
|||||||
"jcmd exitValue = " + out.getExitValue());
|
"jcmd exitValue = " + out.getExitValue());
|
||||||
|
|
||||||
out.shouldHaveExitValue(0);
|
out.shouldHaveExitValue(0);
|
||||||
out.stderrShouldBeEmptyIgnoreVMWarnings();
|
out.stderrShouldBeEmptyIgnoreDeprecatedWarnings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String... args) throws Exception {
|
public static void main(String... args) throws Exception {
|
||||||
|
@ -40,6 +40,8 @@ public final class OutputAnalyzer {
|
|||||||
|
|
||||||
private static final String jvmwarningmsg = ".* VM warning:.*";
|
private static final String jvmwarningmsg = ".* VM warning:.*";
|
||||||
|
|
||||||
|
private static final String deprecatedmsg = ".* VM warning:.* deprecated.*";
|
||||||
|
|
||||||
private final OutputBuffer buffer;
|
private final OutputBuffer buffer;
|
||||||
/**
|
/**
|
||||||
* Create an OutputAnalyzer, a utility class for verifying output and exit
|
* Create an OutputAnalyzer, a utility class for verifying output and exit
|
||||||
@ -147,6 +149,21 @@ public final class OutputAnalyzer {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify that the stderr contents of output buffer is empty,
|
||||||
|
* after filtering out the Hotspot deprecation warning messages
|
||||||
|
*
|
||||||
|
* @throws RuntimeException
|
||||||
|
* If stderr was not empty
|
||||||
|
*/
|
||||||
|
public OutputAnalyzer stderrShouldBeEmptyIgnoreDeprecatedWarnings() {
|
||||||
|
if (!getStderr().replaceAll(deprecatedmsg + "\\R", "").isEmpty()) {
|
||||||
|
reportDiagnosticSummary();
|
||||||
|
throw new RuntimeException("stderr was not empty");
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify that the stdout contents of output buffer is not empty
|
* Verify that the stdout contents of output buffer is not empty
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user