8056994: sun/tools/jstatd/TestJstatdPortAndServer.java and sun/tools/jstatd/TestJstatdServer.java miss correct check of RMI server availability

Reviewed-by: jbachorik, dsamersoff
This commit is contained in:
Katja Kantserova 2014-09-02 11:05:41 +02:00
parent e0e332bdac
commit 2905bd08a6

View File

@ -148,11 +148,12 @@ public final class JstatdTest {
private OutputAnalyzer waitForJstatdRMI(ProcessBuilder pb) throws IOException, InterruptedException {
OutputAnalyzer output = new OutputAnalyzer(pb.start());
String remoteHost = (serverName != null) ? serverName : "JStatRemoteHost";
while (output.getExitValue() != 0) {
String out = output.getOutput();
if (out.contains("RMI Registry not available") ||
out.contains("RMI Server JStatRemoteHost not available")) {
out.contains("RMI Server " + remoteHost + " not available")) {
Thread.sleep(100);
output = new OutputAnalyzer(pb.start());
} else {