8076998: BadHandshakeTest.java fails due to warnings in output
authorykantser
Tue, 05 May 2015 20:09:52 +0200
changeset 30666 ed4a9b27a968
parent 30665 de1d43259890
child 30668 0a794f3b88c9
8076998: BadHandshakeTest.java fails due to warnings in output Reviewed-by: sla
jdk/test/com/sun/jdi/BadHandshakeTest.java
--- a/jdk/test/com/sun/jdi/BadHandshakeTest.java	Thu Apr 30 16:44:39 2015 +0200
+++ b/jdk/test/com/sun/jdi/BadHandshakeTest.java	Tue May 05 20:09:52 2015 +0200
@@ -82,14 +82,19 @@
             class_name,
             pb,
             (line) -> {
-                // The first thing that will get read is
-                //    Listening for transport dt_socket at address: xxxxx
-                // which shows the debuggee is ready to accept connections.
-                success.set(line.contains("Listening for transport dt_socket at address:"));
-                // If the first line contains 'Address already in use'
-                // that means the debuggee has failed to start due to busy port
-                bindFailed.set(line.contains("Address already in use"));
-                return true;
+                // 'Listening for transport dt_socket at address: xxxxx'
+                // indicates the debuggee is ready to accept connections
+                if (line.contains("Listening for transport dt_socket at address:")) {
+                    success.set(true);
+                    return true;
+                }
+                // 'Address already in use' indicates
+                // the debuggee has failed to start due to busy port.
+                if (line.contains("Address already in use")) {
+                    bindFailed.set(true);
+                    return true;
+                }
+                return false;
             },
             Integer.MAX_VALUE,
             TimeUnit.MILLISECONDS