changeset 11349:de6a496ab38c

8067945: SVC jdk/test/* should be cleaned from JRE layout dependency Reviewed-by: sla Contributed-by: alexander.kulyakhtin@oracle.com
author ykantser
date Fri, 23 Jan 2015 14:20:52 +0100
parents af693fcc542f
children 4be838061c3b
files test/com/sun/jdi/ImmutableResourceTest.sh test/com/sun/jdi/JITDebug.sh test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java test/com/sun/tools/attach/BasicTests.java test/com/sun/tools/attach/PermissionTest.java test/com/sun/tools/attach/ProviderTest.java test/com/sun/tools/attach/TempDirTest.java test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
diffstat 11 files changed, 16 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/jdi/ImmutableResourceTest.sh	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/jdi/ImmutableResourceTest.sh	Fri Jan 23 14:20:52 2015 +0100
@@ -92,7 +92,7 @@
 #
 echo "JDK under test is: $TESTJAVA"
 #
-CP="-classpath ${TESTCLASSES}${PATHSEP}${TESTJAVA}/lib/tools.jar"
+CP="-classpath ${TESTCLASSES}"
 # Compile the test class using the classpath we need:
 #
 env
--- a/test/com/sun/jdi/JITDebug.sh	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/jdi/JITDebug.sh	Fri Jan 23 14:20:52 2015 +0100
@@ -103,15 +103,15 @@
    #if running standalone (no test harness of any kind), compile the
    #support files and the test case
    ${TESTJAVA}/bin/javac -d ${TESTCLASSES} \
-            -classpath "$TESTJAVA/lib/tools.jar${PATHSEP}${TESTSRC}" \
+            -classpath "${TESTSRC}" \
             TestScaffold.java VMConnection.java TargetListener.java TargetAdapter.java
    ${TESTJAVA}/bin/javac  -d ${TESTCLASSES} \
-            -classpath "$TESTJAVA/lib/tools.jar${PATHSEP}${TESTSRC}" -g \
+            -classpath "${TESTSRC}" -g \
             JITDebug.java
 fi
 echo "JDK under test is: $TESTJAVA"
 #
-CLASSPATH="$TESTJAVA/lib/tools.jar${PATHSEP}${TESTCLASSES}"
+CLASSPATH="${TESTCLASSES}"
 export CLASSPATH
 CP="-classpath \"${CLASSPATH}\""
 #
--- a/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java	Fri Jan 23 14:20:52 2015 +0100
@@ -22,9 +22,8 @@
  */
 
 /*
- * Creates a URLClassLoader from 2 file URLs. The first
- * file URL is constructed from the given argument. The
- * second is the SDK tools.jar. Once created the test
+ * Creates a URLClassLoader from a file URL. The file URL
+ * is constructed from the given argument. Once created the test
  * attempts to load another test case (ListConnectors)
  * using the class loader and then it invokes the list()
  * method.
@@ -39,13 +38,9 @@
     public static void main(String args[]) throws Exception {
         // create files from given arguments and tools.jar
         File f1 = new File(args[0]);
-        String home = System.getProperty("java.home");
-        String tools = ".." + File.separatorChar + "lib" +
-            File.separatorChar + "tools.jar";
-        File f2 = (new File(home, tools)).getCanonicalFile();
 
         // create class loader
-        URL[] urls = { f1.toURL(), f2.toURL() };
+        URL[] urls = { f1.toURL() };
         URLClassLoader cl = new URLClassLoader(urls);
 
         // load ListConnectors using the class loader
--- a/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh	Fri Jan 23 14:20:52 2015 +0100
@@ -68,7 +68,7 @@
 $JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/JdiLoadedByCustomLoader.java
 
 mkdir "${SOMEOTHERDIR}"
-$JAVAC -d "${SOMEOTHERDIR}" -classpath "${TESTSRC}${PS}${TESTJAVA}/lib/tools.jar" \
+$JAVAC -d "${SOMEOTHERDIR}" -classpath "${TESTSRC}" \
     "${TESTSRC}"/ListConnectors.java
 
 # Run the test
--- a/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Fri Jan 23 14:20:52 2015 +0100
@@ -62,7 +62,7 @@
                     "-XX:+UseConcMarkSweepGC",  // this will cause UseParNewGC to be FLAG_SET_ERGO
                     "-XX:+PrintGCDetails",
                     "-XX:Flags=" + flagsFile.getAbsolutePath(),
-                    "-cp", System.getProperty("test.class.path") + File.pathSeparator + getToolsJarPath(),
+                    "-cp", System.getProperty("test.class.path"),
                     "CheckOrigin",
                     "-runtests");
 
@@ -137,8 +137,4 @@
         vm.detach();
     }
 
-    private static String getToolsJarPath() {
-        return System.getProperty("java.home") +
-            "/../lib/tools.jar".replace("/", File.separator);
-    }
 }
--- a/test/com/sun/tools/attach/BasicTests.java	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/tools/attach/BasicTests.java	Fri Jan 23 14:20:52 2015 +0100
@@ -80,8 +80,7 @@
 
         // Need to add jdk/lib/tools.jar to classpath.
         String classpath =
-            System.getProperty("test.class.path", "") + File.pathSeparator +
-            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+            System.getProperty("test.class.path", "");
         String testClassDir = System.getProperty("test.classes", "") + sep;
 
         // Argumenta : -classpath cp BasicTests$TestMain pid agent badagent redefineagent
--- a/test/com/sun/tools/attach/PermissionTest.java	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/tools/attach/PermissionTest.java	Fri Jan 23 14:20:52 2015 +0100
@@ -71,10 +71,8 @@
     private static void runTests(long pid) throws Throwable {
         final String sep = File.separator;
 
-        // Need to add jdk/lib/tools.jar to classpath.
         String classpath =
-            System.getProperty("test.class.path", "") + File.pathSeparator +
-            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+            System.getProperty("test.class.path", "");
         String testSrc = System.getProperty("test.src", "") + sep;
 
         // Use a policy that will NOT allow attach. Test will verify exception.
--- a/test/com/sun/tools/attach/ProviderTest.java	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/tools/attach/ProviderTest.java	Fri Jan 23 14:20:52 2015 +0100
@@ -68,11 +68,10 @@
         String testClasses = System.getProperty("test.classes", "") + sep;
         String jdkLib = System.getProperty("test.jdk", ".") + sep + "lib" + sep;
 
-        // Need to add SimpleProvider.jar and tools.jar to classpath.
+        // Need to add SimpleProvider.jar to classpath.
         String classpath =
                 testClassPath + File.pathSeparator +
-                testClasses + "SimpleProvider.jar" + File.pathSeparator +
-                jdkLib + "tools.jar";
+                testClasses + "SimpleProvider.jar";
 
         String[] args = {
                 "-classpath",
--- a/test/com/sun/tools/attach/TempDirTest.java	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/com/sun/tools/attach/TempDirTest.java	Fri Jan 23 14:20:52 2015 +0100
@@ -120,10 +120,8 @@
     private static void launchTests(long pid, Path clientTmpDir) throws Throwable {
         final String sep = File.separator;
 
-        // Need to add jdk/lib/tools.jar to classpath.
         String classpath =
-            System.getProperty("test.class.path", "") + File.pathSeparator +
-            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+            System.getProperty("test.class.path", "");
 
         String[] tmpDirArg = null;
         if (clientTmpDir != null) {
--- a/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Fri Jan 23 14:20:52 2015 +0100
@@ -145,13 +145,7 @@
 
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
                 "-cp",
-                TEST_CLASSPATH +
-                    File.pathSeparator +
-                    TEST_JDK +
-                    File.separator +
-                    "lib" +
-                    File.separator +
-                    "tools.jar",
+                TEST_CLASSPATH,
                 "TestManager",
                 String.valueOf(serverPrc.getPid()),
                 port.get(),
--- a/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Wed Jan 21 15:06:31 2015 +0100
+++ b/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Fri Jan 23 14:20:52 2015 +0100
@@ -132,13 +132,7 @@
 
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
                 "-cp",
-                TEST_CLASSPATH +
-                    File.pathSeparator +
-                    TEST_JDK +
-                    File.separator +
-                    "lib" +
-                    File.separator +
-                    "tools.jar",
+                TEST_CLASSPATH,
                 "TestManager",
                 String.valueOf(serverPrc.getPid()),
                 port.get(),