8028060: test/java/net/URLPermission/nstest/lookup.sh failing (win)
authormichaelm
Mon, 11 Nov 2013 16:06:16 +0000
changeset 21644 12edcc716b48
parent 21643 dd4f80b0590d
child 21645 1276aab8ff2f
8028060: test/java/net/URLPermission/nstest/lookup.sh failing (win) Reviewed-by: alanb
jdk/test/java/net/URLPermission/nstest/LookupTest.java
jdk/test/java/net/URLPermission/nstest/lookup.sh
--- a/jdk/test/java/net/URLPermission/nstest/LookupTest.java	Mon Nov 11 10:33:02 2013 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/LookupTest.java	Mon Nov 11 16:06:16 2013 +0000
@@ -66,7 +66,7 @@
         String cmd = args[0];
         if (cmd.equals("-getport")) {
             port = Utils.getFreePort();
-            System.out.println(port);
+            System.out.print(port);
         } else if (cmd.equals("-runtest")) {
             port = Integer.parseInt(args[1]);
             SimpleNameService.put("allowedAndFound.com", "127.0.0.1");
--- a/jdk/test/java/net/URLPermission/nstest/lookup.sh	Mon Nov 11 10:33:02 2013 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/lookup.sh	Mon Nov 11 16:06:16 2013 +0000
@@ -1,5 +1,4 @@
 #!/bin/sh
-
 #
 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +28,19 @@
 #            LookupTest.java SimpleNameServiceDescriptor.java
 # @run shell/timeout=50 lookup.sh
 #
-DIR=`pwd`
+
+OS=`uname -s`
+case ${OS} in
+Windows_* | CYGWIN*)
+    PS=";"
+    FS="\\"
+    ;;
+*)
+    PS=":"
+    FS="/"
+    ;;
+esac
+
 
 port=`${TESTJAVA}/bin/java -cp ${TESTCLASSES} LookupTest -getport`
 
@@ -45,4 +56,4 @@
 };
 POLICY
 
-${TESTJAVA}/bin/java -Djava.security.policy=file://${DIR}/policy -Dsun.net.spi.nameservice.provider.1=simple,sun -cp ${TESTCLASSES}:${TESTSRC} LookupTest -runtest $port
+${TESTJAVA}/bin/java -Djava.security.policy=file:./policy -Dsun.net.spi.nameservice.provider.1=simple,sun -cp ${TESTCLASSES}${PS}${TESTSRC} LookupTest -runtest ${port}