8067945: SVC jdk/test/* should be cleaned from JRE layout dependency

Reviewed-by: sla
This commit is contained in:
Alexander Kulyakthin 2015-01-23 14:20:52 +01:00 committed by Katja Kantserova
parent 8e93b53e3e
commit 167de7ae02
11 changed files with 16 additions and 43 deletions

View File

@ -92,7 +92,7 @@ fi
#
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

View File

@ -103,15 +103,15 @@ if [ -z "${TESTJAVA}" ] ; then
#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}\""
#

View File

@ -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 class JdiLoadedByCustomLoader {
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

View File

@ -68,7 +68,7 @@ SOMEOTHERDIR="${TESTCLASSES}"/someotherdir
$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

View File

@ -62,7 +62,7 @@ public class CheckOrigin {
"-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 @@ public class CheckOrigin {
vm.detach();
}
private static String getToolsJarPath() {
return System.getProperty("java.home") +
"/../lib/tools.jar".replace("/", File.separator);
}
}

View File

@ -80,8 +80,7 @@ public class BasicTests {
// 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

View File

@ -71,10 +71,8 @@ public class PermissionTest {
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.

View File

@ -68,11 +68,10 @@ public class ProviderTest {
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",

View File

@ -120,10 +120,8 @@ public class TempDirTest {
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) {

View File

@ -145,13 +145,7 @@ public class CustomLauncherTest {
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(),

View File

@ -132,13 +132,7 @@ public class LocalManagementTest {
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(),