# HG changeset patch # User jgish # Date 1366144454 14400 # Node ID 066a89e5a91111f534a39120e9d89b1a048004f0 # Parent a318a41ecb0b07a35ce12a8a9c6ab4c01c935aa1 8011990: TEST_BUG: java/util/logging/bundlesearch/ResourceBundleSearchTest.java fails on Windows Summary: Fix URL to reliably work on all platforms Reviewed-by: duke diff -r a318a41ecb0b -r 066a89e5a911 test/java/util/logging/bundlesearch/IndirectlyLoadABundle.java --- a/test/java/util/logging/bundlesearch/IndirectlyLoadABundle.java Wed Jun 26 22:44:03 2013 -0500 +++ b/test/java/util/logging/bundlesearch/IndirectlyLoadABundle.java Tue Apr 16 16:34:14 2013 -0400 @@ -21,6 +21,7 @@ * questions. */ +import java.io.File; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; @@ -45,11 +46,13 @@ String testClassesDir = System.getProperty("test.classes", System.getProperty("user.dir")); String sep = System.getProperty("file.separator"); + URL[] urls = new URL[2]; // Allow for both jtreg and standalone cases here - urls[0] = new URL("file://" + testDir + sep + "resources" + sep); - urls[1] = new URL("file://" + testClassesDir + sep ); + urls[0] = new File( testDir + sep + "resources" + sep ).toURI().toURL(); + urls[1] = new File( testClassesDir + sep ).toURI().toURL(); + System.out.println("INFO: urls[0] = " + urls[0]); System.out.println("INFO: urls[1] = " + urls[1]); diff -r a318a41ecb0b -r 066a89e5a911 test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java --- a/test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java Wed Jun 26 22:44:03 2013 -0500 +++ b/test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java Tue Apr 16 16:34:14 2013 -0400 @@ -29,6 +29,7 @@ * @build ResourceBundleSearchTest IndirectlyLoadABundle LoadItUp * @run main ResourceBundleSearchTest */ +import java.io.File; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; @@ -70,7 +71,8 @@ String sep = System.getProperty("file.separator"); URL[] urls = new URL[1]; - urls[0] = new URL("file://" + testDir + sep + "resources" + sep); + + urls[0] = new File( testDir + sep + "resources" + sep ).toURI().toURL(); URLClassLoader rbClassLoader = new URLClassLoader(urls); // Test 1 - can we find a Logger bundle from doing a stack search?