8054343: Nashorn: Some tests fails on windows with AccessControlException
Reviewed-by: lagergren, sundar
Contributed-by: Sergey Lugovoy <sergey.lugovoy@oracle.com>
--- a/nashorn/test/script/basic/compile-octane-normal.js Thu Aug 28 16:38:23 2014 +0200
+++ b/nashorn/test/script/basic/compile-octane-normal.js Mon Sep 01 17:34:37 2014 +0400
@@ -38,5 +38,5 @@
*/
var fn = __DIR__ + 'compile-octane.js';
-var url = "file://" + fn;
-loadWithNewGlobal(new java.net.URL(url));
+var url = new java.io.File(fn).toURL();
+loadWithNewGlobal(url);
--- a/nashorn/test/script/basic/compile-octane-splitter.js Thu Aug 28 16:38:23 2014 +0200
+++ b/nashorn/test/script/basic/compile-octane-splitter.js Mon Sep 01 17:34:37 2014 +0400
@@ -40,5 +40,5 @@
*/
var fn = __DIR__ + 'compile-octane.js';
-var url = "file://" + fn;
-loadWithNewGlobal(new java.net.URL(url));
+var url = new java.io.File(fn).toURL();
+loadWithNewGlobal(url);
--- a/nashorn/test/script/basic/compile-octane.js Thu Aug 28 16:38:23 2014 +0200
+++ b/nashorn/test/script/basic/compile-octane.js Mon Sep 01 17:34:37 2014 +0400
@@ -132,7 +132,7 @@
str2 += " processing file: " + file + "...";
print_if_verbose(str2);
}
- newGlobal.load("file://" + path + file);
+ newGlobal.load(new java.io.File(path + file).toURL());
}
}
print("Done.");