8056994: sun/tools/jstatd/TestJstatdPortAndServer.java and sun/tools/jstatd/TestJstatdServer.java miss correct check of RMI server availability
authorykantser
Tue, 02 Sep 2014 11:05:41 +0200
changeset 26338 dcfb4d3ce992
parent 26337 39f3ee5364e5
child 26359 50d45d375866
8056994: sun/tools/jstatd/TestJstatdPortAndServer.java and sun/tools/jstatd/TestJstatdServer.java miss correct check of RMI server availability Reviewed-by: jbachorik, dsamersoff
jdk/test/sun/tools/jstatd/JstatdTest.java
--- a/jdk/test/sun/tools/jstatd/JstatdTest.java	Tue Sep 02 05:48:55 2014 +0000
+++ b/jdk/test/sun/tools/jstatd/JstatdTest.java	Tue Sep 02 11:05:41 2014 +0200
@@ -148,11 +148,12 @@
     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 {