8061442: Update jdk/tools tests to remove check for the "jre" directory
authorksrini
Wed, 17 Dec 2014 13:41:49 -0800
changeset 28115 3931c251d78f
parent 28114 7ab051865dd2
child 28116 71d09d4e1ca3
8061442: Update jdk/tools tests to remove check for the "jre" directory Reviewed-by: alanb, ksrini Contributed-by: felix.yang@oracle.com
jdk/test/tools/jar/JarEntryTime.java
jdk/test/tools/launcher/ExecutionEnvironment.java
jdk/test/tools/launcher/TestHelper.java
--- a/jdk/test/tools/jar/JarEntryTime.java	Wed Dec 17 13:03:29 2014 +0000
+++ b/jdk/test/tools/jar/JarEntryTime.java	Wed Dec 17 13:41:49 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,9 +51,6 @@
 
     static void extractJar(File jarFile, boolean useExtractionTime) throws Throwable {
         String javahome = System.getProperty("java.home");
-        if (javahome.endsWith("jre")) {
-            javahome = javahome.substring(0, javahome.length() - 4);
-        }
         String jarcmd = javahome + File.separator + "bin" + File.separator + "jar";
         String[] args;
         if (useExtractionTime) {
--- a/jdk/test/tools/launcher/ExecutionEnvironment.java	Wed Dec 17 13:03:29 2014 +0000
+++ b/jdk/test/tools/launcher/ExecutionEnvironment.java	Wed Dec 17 13:41:49 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
  *            a. if LD_LIBRARY_PATH64 is set it will override LD_LIBRARY_PATH
  *            b. LD_LIBRARY_PATH32 is ignored if set
  *   5. no extra symlink exists on Solaris ie.
- *      jre/lib/$arch/libjvm.so -> client/libjvm.so
+ *      lib/$arch/libjvm.so -> client/libjvm.so
  * TODO:
  *      a. perhaps we need to add a test to audit all environment variables are
  *         in pristine condition after the launch, there may be a few that the
@@ -267,7 +267,7 @@
         }
 
         File symLink = null;
-        String libPathPrefix = isSDK ? "jre/lib" : "/lib";
+        String libPathPrefix = "/lib";
         symLink = new File(JAVAHOME, libPathPrefix +
                 getJreArch() + "/" + LIBJVM);
         if (symLink.exists()) {
--- a/jdk/test/tools/launcher/TestHelper.java	Wed Dec 17 13:03:29 2014 +0000
+++ b/jdk/test/tools/launcher/TestHelper.java	Wed Dec 17 13:41:49 2014 -0800
@@ -67,10 +67,7 @@
 
     static final String JAVAHOME = System.getProperty("java.home");
     static final String JAVA_BIN;
-    static final String JAVA_JRE_BIN;
     static final String JAVA_LIB;
-    static final String JAVA_JRE_LIB;
-    static final boolean isSDK = JAVAHOME.endsWith("jre");
     static final String javaCmd;
     static final String javawCmd;
     static final String javacCmd;
@@ -135,17 +132,10 @@
         }
         compiler = ToolProvider.getSystemJavaCompiler();
 
-        File binDir = (isSDK)
-                ? new File((new File(JAVAHOME)).getParentFile(), "bin")
-                : new File(JAVAHOME, "bin");
+        File binDir = new File(JAVAHOME, "bin");
         JAVA_BIN = binDir.getAbsolutePath();
-        JAVA_JRE_BIN = new File(JAVAHOME, "bin").getAbsolutePath();
-
-        File libDir = (isSDK)
-                ? new File((new File(JAVAHOME)).getParentFile(), "lib")
-                : new File(JAVAHOME, "lib");
+        File libDir = new File(JAVAHOME, "lib");
         JAVA_LIB = libDir.getAbsolutePath();
-        JAVA_JRE_LIB = new File(JAVAHOME, "lib").getAbsolutePath();
 
         File javaCmdFile = (isWindows)
                 ? new File(binDir, "java.exe")
@@ -191,11 +181,11 @@
     }
     private static boolean haveVmVariant(String type) {
         if (isWindows) {
-            File vmDir = new File(JAVA_JRE_BIN, type);
+            File vmDir = new File(JAVA_BIN, type);
             File jvmFile = new File(vmDir, LIBJVM);
             return jvmFile.exists();
         } else {
-            File vmDir = new File(JAVA_JRE_LIB, type);
+            File vmDir = new File(JAVA_LIB, type);
             File vmArchDir = new File(vmDir, getJreArch());
             File jvmFile = new File(vmArchDir, LIBJVM);
             return jvmFile.exists();