Hi Katia, Please, find attached the jdk.patch containing the changes per your findings. The patch has been made by running the webrev tool.
Best regards, Alex ----- Original Message ----- From: yekaterina.kantser...@oracle.com To: alexander.kulyakh...@oracle.com, serviceability-dev@openjdk.java.net Sent: Wednesday, January 21, 2015 12:11:58 PM GMT +04:00 Abu Dhabi / Muscat Subject: Re: RFR: JDK-8067945: SVC jdk/test/* should be cleaned from JRE layout dependency (corrected per the review findings) Hi Alex, Comments bellow should be removed. You don't need to make a webrev for it, only the changes are included in the final patch. test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java 39 // create files from given arguments and tools.jar test/com/sun/tools/attach/BasicTests.java 81 // Need to add jdk/lib/tools.jar to classpath. Best regards, Katja (not a reviewer) On 01/19/2015 05:00 PM, Alexander Kulyakhtin wrote: > Hi, > > Could you, please, review the fix below. > > To adress the previous review findings any referenes to "test.jdk" have been > removed. > > bug: https://bugs.openjdk.java.net/browse/JDK-8067945 > webrev: http://cr.openjdk.java.net/~eistepan/~akulyakhtin/8067945/webrev.01/ > > References to tools.jar are removed from the tests as jdk9 drops tools.jar > > Thanks, > Alex
--- old/test/com/sun/jdi/ImmutableResourceTest.sh 2015-01-21 12:02:58.764932837 +0300 +++ new/test/com/sun/jdi/ImmutableResourceTest.sh 2015-01-21 12:02:58.636932840 +0300 @@ -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 --- old/test/com/sun/jdi/JITDebug.sh 2015-01-21 12:02:59.128932829 +0300 +++ new/test/com/sun/jdi/JITDebug.sh 2015-01-21 12:02:58.996932832 +0300 @@ -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}\"" # --- old/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java 2015-01-21 12:02:59.504932821 +0300 +++ new/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java 2015-01-21 12:02:59.368932824 +0300 @@ -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. @@ -37,15 +36,11 @@ public class JdiLoadedByCustomLoader { public static void main(String args[]) throws Exception { - // create files from given arguments and tools.jar + // create file from the argument given 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 --- old/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh 2015-01-21 12:02:59.868932813 +0300 +++ new/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh 2015-01-21 12:02:59.736932816 +0300 @@ -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 --- old/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java 2015-01-21 12:03:00.244932804 +0300 +++ new/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java 2015-01-21 12:03:00.108932807 +0300 @@ -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); - } } --- old/test/com/sun/tools/attach/BasicTests.java 2015-01-21 12:03:00.624932796 +0300 +++ new/test/com/sun/tools/attach/BasicTests.java 2015-01-21 12:03:00.492932799 +0300 @@ -78,10 +78,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 testClassDir = System.getProperty("test.classes", "") + sep; // Argumenta : -classpath cp BasicTests$TestMain pid agent badagent redefineagent --- old/test/com/sun/tools/attach/PermissionTest.java 2015-01-21 12:03:00.996932788 +0300 +++ new/test/com/sun/tools/attach/PermissionTest.java 2015-01-21 12:03:00.864932791 +0300 @@ -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. --- old/test/com/sun/tools/attach/ProviderTest.java 2015-01-21 12:03:01.368932780 +0300 +++ new/test/com/sun/tools/attach/ProviderTest.java 2015-01-21 12:03:01.236932783 +0300 @@ -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", --- old/test/com/sun/tools/attach/TempDirTest.java 2015-01-21 12:03:01.744932772 +0300 +++ new/test/com/sun/tools/attach/TempDirTest.java 2015-01-21 12:03:01.604932775 +0300 @@ -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) { --- old/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java 2015-01-21 12:03:02.128932763 +0300 +++ new/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java 2015-01-21 12:03:01.996932766 +0300 @@ -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(), --- old/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java 2015-01-21 12:03:02.496932755 +0300 +++ new/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java 2015-01-21 12:03:02.356932758 +0300 @@ -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(),