8023555: test/java/net/Socks/SocksProxyVersion.java fails when machine name is localhost
authortyan
Mon, 14 Oct 2013 11:47:54 +0100
changeset 20783 c0806cb8d4ae
parent 20782 2711da7ccd30
child 20784 c0864e216d36
8023555: test/java/net/Socks/SocksProxyVersion.java fails when machine name is localhost Reviewed-by: chegar, alanb
jdk/test/java/net/Socks/SocksProxyVersion.java
--- a/jdk/test/java/net/Socks/SocksProxyVersion.java	Mon Oct 14 10:42:36 2013 +0200
+++ b/jdk/test/java/net/Socks/SocksProxyVersion.java	Mon Oct 14 11:47:54 2013 +0100
@@ -41,6 +41,10 @@
     volatile boolean failed;
 
     public static void main(String[] args) throws Exception {
+        if (InetAddress.getLocalHost().isLoopbackAddress()) {
+            System.out.println("Test cannot run. getLocalHost returns a loopback address");
+            return;
+        }
         new SocksProxyVersion();
     }