6491461: 3/3 TEST: java/lang/instrument .sh tests need to use $TESTVMOPTS in their java commands
Add ${TESTVMOPTS} to java test execution command(s). Reviewed-by: sspitsyn
This commit is contained in:
parent
a3114e931c
commit
7d1d2b63c1
jdk/test/java/lang/instrument
BootClassPath
PremainClass
appendToClassLoaderSearch
@ -23,7 +23,7 @@
|
||||
|
||||
# @test
|
||||
# @bug 5055293
|
||||
# @summary Test non US-ASCII characters in the value of the Boot-Class-Path
|
||||
# @summary Test non US-ASCII characters in the value of the Boot-Class-Path
|
||||
# attribute.
|
||||
|
||||
if [ "${TESTJAVA}" = "" ]
|
||||
@ -72,7 +72,7 @@ echo "Creating agent jar file..."
|
||||
|
||||
echo "Running test..."
|
||||
|
||||
"${JAVA}" -javaagent:"${TESTCLASSES}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:"${TESTCLASSES}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
|
||||
result=$?
|
||||
|
||||
echo "Cleanup..."
|
||||
|
@ -49,7 +49,7 @@ JAVA="${TESTJAVA}"/bin/java
|
||||
|
||||
"$JAVAC" -d "${TESTCLASSES}" "${TESTSRC}"/DummyMain.java
|
||||
|
||||
"${JAVA}" -javaagent:"${TESTSRC}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:"${TESTSRC}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
|
||||
result=$?
|
||||
|
||||
exit $result
|
||||
|
@ -33,7 +33,7 @@ then
|
||||
echo "TESTSRC not set. Test cannot execute. Failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
. ${TESTSRC}/CommonSetup.sh
|
||||
|
||||
# Setup to create circularity condition
|
||||
@ -71,5 +71,5 @@ $JAR -cfm "${TESTCLASSES}"/CircularityErrorTest.jar "${MANIFEST}" \
|
||||
-C "${TESTCLASSES}" CircularityErrorTest.class
|
||||
|
||||
# Finally we run the test
|
||||
(cd "${TESTCLASSES}";
|
||||
$JAVA -javaagent:CircularityErrorTest.jar CircularityErrorTest)
|
||||
(cd "${TESTCLASSES}";
|
||||
$JAVA ${TESTVMOPTS} -javaagent:CircularityErrorTest.jar CircularityErrorTest)
|
||||
|
@ -34,11 +34,11 @@ then
|
||||
echo "TESTSRC not set. Test cannot execute. Failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
. ${TESTSRC}/CommonSetup.sh
|
||||
|
||||
# Create Foo and Bar
|
||||
# Foo has a reference to Bar but we deleted Bar so that
|
||||
# Foo has a reference to Bar but we deleted Bar so that
|
||||
# a NoClassDefFoundError will be thrown when Foo tries to
|
||||
# resolve the reference to Bar
|
||||
|
||||
@ -53,11 +53,11 @@ cat << EOF > "${FOO}"
|
||||
public class Foo {
|
||||
public static boolean doSomething() {
|
||||
try {
|
||||
Bar b = new Bar();
|
||||
return true;
|
||||
} catch (NoClassDefFoundError x) {
|
||||
return false;
|
||||
}
|
||||
Bar b = new Bar();
|
||||
return true;
|
||||
} catch (NoClassDefFoundError x) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
@ -79,5 +79,5 @@ $JAR -cfm "${TESTCLASSES}"/ClassUnloadTest.jar "${MANIFEST}" \
|
||||
|
||||
# Finally we run the test
|
||||
(cd "${TESTCLASSES}"; \
|
||||
$JAVA -Xverify:none -XX:+TraceClassUnloading -javaagent:ClassUnloadTest.jar \
|
||||
ClassUnloadTest "${OTHERDIR}" Bar.jar)
|
||||
$JAVA ${TESTVMOPTS} -Xverify:none -XX:+TraceClassUnloading \
|
||||
-javaagent:ClassUnloadTest.jar ClassUnloadTest "${OTHERDIR}" Bar.jar)
|
||||
|
@ -24,7 +24,6 @@
|
||||
#
|
||||
|
||||
|
||||
#%E
|
||||
#
|
||||
# Common setup for unit tests. Setups up the following variables:
|
||||
#
|
||||
@ -66,7 +65,7 @@ then
|
||||
echo "TESTSRC not set. Test cannot execute. Failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [ "${TESTCLASSES}" = "" ]
|
||||
then
|
||||
echo "TESTCLASSES not set. Test cannot execute. Failed."
|
||||
|
@ -23,10 +23,10 @@
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
|
||||
|
||||
# @test
|
||||
# @bug 6173575 6388987
|
||||
# @summary Unit tests for appendToBootstrapClassLoaderSearch and
|
||||
# @summary Unit tests for appendToBootstrapClassLoaderSearch and
|
||||
# appendToSystemClasLoaderSearch methods.
|
||||
#
|
||||
# @build Agent AgentSupport BootSupport BasicTest PrematureLoadTest DynamicTest
|
||||
@ -37,10 +37,10 @@ then
|
||||
echo "TESTSRC not set. Test cannot execute. Failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
. ${TESTSRC}/CommonSetup.sh
|
||||
|
||||
|
||||
|
||||
# Simple tests
|
||||
|
||||
echo "Creating jar files for simple tests..."
|
||||
@ -50,13 +50,13 @@ cd ${TESTCLASSES}
|
||||
"$JAR" -cfm Agent.jar "${TESTSRC}"/manifest.mf Agent.class
|
||||
"$JAR" -cf AgentSupport.jar AgentSupport.class
|
||||
"$JAR" -cf BootSupport.jar BootSupport.class
|
||||
"$JAR" -cf SimpleTests.jar BasicTest.class PrematureLoadTest.class
|
||||
"$JAR" -cf SimpleTests.jar BasicTest.class PrematureLoadTest.class
|
||||
|
||||
failures=0
|
||||
|
||||
go() {
|
||||
echo ''
|
||||
sh -xc "$JAVA -javaagent:Agent.jar -classpath SimpleTests.jar $1 $2 $3" 2>&1
|
||||
sh -xc "$JAVA ${TESTVMOPTS} -javaagent:Agent.jar -classpath SimpleTests.jar $1 $2 $3" 2>&1
|
||||
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ mkdir tmp
|
||||
"${JAVAC}" -d tmp "${TESTSRC}"/Tracer.java
|
||||
(cd tmp; "${JAR}" cf ../Tracer.jar org/tools/Tracer.class)
|
||||
|
||||
# InstrumentedApplication is Application+instrmentation - don't copy as
|
||||
# InstrumentedApplication is Application+instrmentation - don't copy as
|
||||
# we don't want the original file permission
|
||||
|
||||
cat "${TESTSRC}"/InstrumentedApplication.java > ./Application.java
|
||||
@ -85,11 +85,11 @@ mv Application.class InstrumentedApplication.bytes
|
||||
cp "${TESTSRC}"/Application.java .
|
||||
"${JAVAC}" -d . Application.java
|
||||
|
||||
sh -xc "$JAVA -classpath . -javaagent:Agent.jar DynamicTest" 2>&1
|
||||
sh -xc "$JAVA ${TESTVMOPTS} -classpath . -javaagent:Agent.jar DynamicTest" 2>&1
|
||||
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
|
||||
|
||||
# Repeat test with security manager
|
||||
sh -xc "$JAVA -classpath . -javaagent:Agent.jar -Djava.security.manager DynamicTest" 2>&1
|
||||
sh -xc "$JAVA ${TESTVMOPTS} -classpath . -javaagent:Agent.jar -Djava.security.manager DynamicTest" 2>&1
|
||||
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
|
||||
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user