mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-08 17:38:38 +00:00
8067945: SVC jdk/test/* should be cleaned from JRE layout dependency
Reviewed-by: sla
This commit is contained in:
parent
8e93b53e3e
commit
167de7ae02
@ -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
|
||||
|
||||
@ -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}\""
|
||||
#
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user