changeset 11256:32e5cb13a06b

8061448: Cleanup sun/misc/JarIndex tests to remove the check for the jre directory Reviewed-by: chegar
author xiaofeya
date Tue, 20 Jan 2015 13:49:28 +0000
parents a3233570bc4e
children 4fa8d83cfa5e
files test/sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java test/sun/misc/JarIndex/metaInfFilenames/Basic.java
diffstat 2 files changed, 2 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java	Mon Jan 19 19:12:11 2015 +0300
+++ b/test/sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java	Tue Jan 20 13:49:28 2015 +0000
@@ -48,14 +48,7 @@
     static final File tmpFolder = new File(testClassesDir);
 
     static {
-        String javaHome = System.getProperty("java.home");
-        if (javaHome.endsWith("jre")) {
-            int index = javaHome.lastIndexOf(slash);
-            if (index != -1)
-                javaHome = javaHome.substring(0, index);
-        }
-
-        jar = javaHome + slash + "bin" + slash + "jar";
+        jar = System.getProperty("java.home") + slash + "bin" + slash + "jar";
     }
 
     public static void main(String[] args) throws Exception {
--- a/test/sun/misc/JarIndex/metaInfFilenames/Basic.java	Mon Jan 19 19:12:11 2015 +0300
+++ b/test/sun/misc/JarIndex/metaInfFilenames/Basic.java	Tue Jan 20 13:49:28 2015 +0000
@@ -78,7 +78,6 @@
  * URLClassLoader. Each request to the HTTP server is recorded to ensure
  * only the correct amount of requests are being made.
  *
- * Note: Needs jdk/lib/tools.jar in the classpath to compile and run.
  */
 
 public class Basic {
@@ -160,14 +159,7 @@
 
     static String jar;
     static {
-        String javaHome = System.getProperty("java.home");
-        if (javaHome.endsWith("jre")) {
-            int index = javaHome.lastIndexOf(slash);
-            if (index != -1)
-                javaHome = javaHome.substring(0, index);
-        }
-
-        jar = javaHome + slash+  "bin" + slash + "jar";
+        jar = System.getProperty("java.home") + slash+  "bin" + slash + "jar";
     }
 
     /* create the index */