8145417: JInfoSanityTest failed with Error attaching to remote server: java.rmi.ConnectException: Connection refused
authorjbachorik
Fri, 18 Dec 2015 14:43:24 +0100
changeset 34715 efac989a60dd
parent 34714 2637c9a952c2
child 34716 7477a052aecc
8145417: JInfoSanityTest failed with Error attaching to remote server: java.rmi.ConnectException: Connection refused Reviewed-by: sspitsyn
jdk/test/sun/tools/jinfo/JInfoSanityTest.java
jdk/test/sun/tools/jps/TestJpsSanity.java
--- a/jdk/test/sun/tools/jinfo/JInfoSanityTest.java	Fri Dec 18 09:59:25 2015 +0100
+++ b/jdk/test/sun/tools/jinfo/JInfoSanityTest.java	Fri Dec 18 14:43:24 2015 +0100
@@ -71,7 +71,7 @@
         String unknownHost = "Oja781nh2ev7vcvbajdg-Sda1-C";
         OutputAnalyzer output = JInfoHelper.jinfoNoPid("med@" + unknownHost);
         assertNotEquals(output.getExitValue(), 0, "A non-zero exit code should be returned for invalid operation");
-        output.shouldContain("UnknownHostException: " + unknownHost);
+        output.shouldMatch(".*(Connection refused to host\\:|UnknownHostException\\:) " + unknownHost + ".*");
     }
 
 }
--- a/jdk/test/sun/tools/jps/TestJpsSanity.java	Fri Dec 18 09:59:25 2015 +0100
+++ b/jdk/test/sun/tools/jps/TestJpsSanity.java	Fri Dec 18 14:43:24 2015 +0100
@@ -62,7 +62,7 @@
         OutputAnalyzer output = JpsHelper.jps(invalidHostName);
         Asserts.assertNotEquals(output.getExitValue(), 0, "Exit code shouldn't be 0");
         Asserts.assertFalse(output.getStderr().isEmpty(), "Error output should not be empty");
-        output.shouldContain("Unknown host: " + invalidHostName);
+        output.shouldMatch(".*(RMI Registry not available at|Unknown host\\:) " + invalidHostName + ".*");
     }
 
 }