8319578: Few java/lang/instrument ignore test.java.opts and accept test.vm.opts only
Reviewed-by: kevinw, cjplummer
This commit is contained in:
parent
d39b7bab27
commit
3ebe6c192a
test/jdk/java/lang/instrument
BootClassPath
ManifestTest.shRedefineBigClass.shRedefineClassWithNativeMethod.shRedefineMethodAddInvoke.shRedefineMethodDelInvoke.shRedefineMethodInBacktrace.shRedefineMethodWithAnnotations.shRedefineSubclassWithTwoInterfaces.shRetransformBigClass.shStressGetObjectSizeTest.shappendToClassLoaderSearch
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -74,7 +74,7 @@ case ${OS} in
|
||||
;;
|
||||
esac
|
||||
|
||||
"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent "${CYGWIN}"
|
||||
"$JAVA" ${TESTVMOPTS} ${TESTJAVAOPTS} -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent "${CYGWIN}"
|
||||
|
||||
BOOTDIR=`cat ${TESTCLASSES}/boot.dir`
|
||||
|
||||
@ -94,13 +94,13 @@ echo "Creating agent jar file..."
|
||||
|
||||
echo "Running test..."
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:"${TESTCLASSES}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:"${TESTCLASSES}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
|
||||
result=$?
|
||||
|
||||
echo "Cleanup..."
|
||||
|
||||
"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" \
|
||||
"${TESTSRC}"/Cleanup.java
|
||||
"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Cleanup "${BOOTDIR}"
|
||||
"$JAVA" ${TESTVMOPTS} ${TESTJAVAOPTS} -classpath "${TESTCLASSES}" Cleanup "${BOOTDIR}"
|
||||
|
||||
exit $result
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -380,7 +380,7 @@ while read token; do
|
||||
echo "===== begin test case: $token ====="
|
||||
make_a_JAR "$token"
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:${AGENT}.jar \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:${AGENT}.jar \
|
||||
-classpath "${TESTCLASSES}" ManifestTestApp > output.log 2>&1
|
||||
result=$?
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -62,14 +62,14 @@ JAVAC="${COMPILEJAVA}"/bin/javac
|
||||
JAVA="${TESTJAVA}"/bin/java
|
||||
|
||||
# Does this VM support the 'detail' level of NMT?
|
||||
"${JAVA}" ${TESTVMOPTS} -XX:NativeMemoryTracking=detail -version
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -XX:NativeMemoryTracking=detail -version
|
||||
if [ "$?" = 0 ]; then
|
||||
NMT=-XX:NativeMemoryTracking=detail
|
||||
else
|
||||
NMT=-XX:NativeMemoryTracking=summary
|
||||
fi
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} \
|
||||
-Xlog:redefine+class+load=debug,redefine+class+load+exceptions=info ${NMT} \
|
||||
-javaagent:RedefineBigClassAgent.jar=BigClass.class \
|
||||
-classpath "${TESTCLASSES}" RedefineBigClassApp \
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -58,7 +58,7 @@ fi
|
||||
JAVAC="${COMPILEJAVA}"/bin/javac
|
||||
JAVA="${TESTJAVA}"/bin/java
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} \
|
||||
-javaagent:RedefineClassWithNativeMethodAgent.jar=java/lang/Thread.class \
|
||||
-classpath "${TESTCLASSES}" RedefineClassWithNativeMethodApp \
|
||||
> output.log 2>&1
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -70,7 +70,7 @@ cp "${TESTSRC}"/RedefineMethodAddInvokeTarget_2.java \
|
||||
mv RedefineMethodAddInvokeTarget.java RedefineMethodAddInvokeTarget_2.java
|
||||
mv RedefineMethodAddInvokeTarget.class RedefineMethodAddInvokeTarget_2.class
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:RedefineMethodAddInvokeAgent.jar \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:RedefineMethodAddInvokeAgent.jar \
|
||||
-XX:+AllowRedefinitionToAddDeleteMethods \
|
||||
-classpath "${TESTCLASSES}" RedefineMethodAddInvokeApp > output.log 2>&1
|
||||
cat output.log
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -71,7 +71,7 @@ cp "${TESTSRC}"/RedefineMethodDelInvokeTarget_2.java \
|
||||
mv RedefineMethodDelInvokeTarget.java RedefineMethodDelInvokeTarget_2.java
|
||||
mv RedefineMethodDelInvokeTarget.class RedefineMethodDelInvokeTarget_2.class
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:RedefineMethodDelInvokeAgent.jar \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:RedefineMethodDelInvokeAgent.jar \
|
||||
-XX:+AllowRedefinitionToAddDeleteMethods \
|
||||
-classpath "${TESTCLASSES}" RedefineMethodDelInvokeApp > output.log 2>&1
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -68,7 +68,7 @@ cp "${TESTSRC}"/RedefineMethodInBacktraceTargetB_2.java \
|
||||
RedefineMethodInBacktraceTargetB.java
|
||||
"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodInBacktraceTargetB.java
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:RedefineMethodInBacktraceAgent.jar \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:RedefineMethodInBacktraceAgent.jar \
|
||||
-XX:+AllowRedefinitionToAddDeleteMethods \
|
||||
-classpath "${TESTCLASSES}" RedefineMethodInBacktraceApp > output.log 2>&1
|
||||
RUN_RESULT=$?
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -67,7 +67,7 @@ cp "${TESTSRC}"/RedefineMethodWithAnnotationsAnnotations.java \
|
||||
RedefineMethodWithAnnotationsTarget.java \
|
||||
RedefineMethodWithAnnotationsAnnotations.java
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:RedefineMethodWithAnnotationsAgent.jar \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:RedefineMethodWithAnnotationsAgent.jar \
|
||||
-XX:+UnlockDiagnosticVMOptions -XX:+StressLdcRewrite -XX:+IgnoreUnrecognizedVMOptions \
|
||||
-cp "${TESTCLASSES}" RedefineMethodWithAnnotationsApp > output.log 2>&1
|
||||
cat output.log
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -69,7 +69,7 @@ cp "${TESTSRC}"/RedefineSubclassWithTwoInterfacesImpl_1.java \
|
||||
"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
|
||||
-cp "${TESTCLASSES}" -d . \
|
||||
RedefineSubclassWithTwoInterfacesTarget.java \
|
||||
RedefineSubclassWithTwoInterfacesImpl.java
|
||||
RedefineSubclassWithTwoInterfacesImpl.java
|
||||
status="$?"
|
||||
if [ "$status" != 0 ]; then
|
||||
echo "FAIL: compile of *_1.java files failed."
|
||||
@ -87,7 +87,7 @@ mv RedefineSubclassWithTwoInterfacesImpl.class \
|
||||
|
||||
echo "INFO: launching RedefineSubclassWithTwoInterfacesApp"
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} \
|
||||
-Xlog:redefine+class+load=trace,redefine+class+load+exceptions=trace,redefine+class+timer=trace,redefine+class+obsolete=trace,redefine+class+obsolete+metadata=trace,redefine+class+constantpool=trace \
|
||||
-javaagent:RedefineSubclassWithTwoInterfacesAgent.jar \
|
||||
-classpath "${TESTCLASSES}" \
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -62,14 +62,14 @@ JAVAC="${COMPILEJAVA}"/bin/javac
|
||||
JAVA="${TESTJAVA}"/bin/java
|
||||
|
||||
# Does this VM support the 'detail' level of NMT?
|
||||
"${JAVA}" ${TESTVMOPTS} -XX:NativeMemoryTracking=detail -version
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -XX:NativeMemoryTracking=detail -version
|
||||
if [ "$?" = 0 ]; then
|
||||
NMT=-XX:NativeMemoryTracking=detail
|
||||
else
|
||||
NMT=-XX:NativeMemoryTracking=summary
|
||||
fi
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} \
|
||||
-Xlog:redefine+class+load=debug,redefine+class+load+exceptions=info ${NMT} \
|
||||
-javaagent:RetransformBigClassAgent.jar=BigClass.class \
|
||||
-classpath "${TESTCLASSES}" RetransformBigClassApp \
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -51,7 +51,7 @@ fi
|
||||
|
||||
JAVA="${TESTJAVA}"/bin/java
|
||||
|
||||
"${JAVA}" ${TESTVMOPTS} -javaagent:basicAgent.jar \
|
||||
"${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:basicAgent.jar \
|
||||
-classpath "${TESTCLASSES}" StressGetObjectSizeApp StressGetObjectSizeApp \
|
||||
> output.log 2>&1
|
||||
cat output.log
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -77,4 +77,4 @@ $JAR ${TESTTOOLVMOPTS} -cfm "${TESTCLASSES}"/CircularityErrorTest.jar "${MANIFES
|
||||
|
||||
# Finally we run the test
|
||||
(cd "${TESTCLASSES}";
|
||||
$JAVA ${TESTVMOPTS} -javaagent:CircularityErrorTest.jar CircularityErrorTest)
|
||||
$JAVA ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:CircularityErrorTest.jar CircularityErrorTest)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -80,5 +80,5 @@ $JAR ${TESTTOOLVMOPTS} -cfm "${TESTCLASSES}"/ClassUnloadTest.jar "${MANIFEST}" \
|
||||
|
||||
# Finally we run the test
|
||||
(cd "${TESTCLASSES}"; \
|
||||
$JAVA ${TESTVMOPTS} -Xlog:class+unload \
|
||||
$JAVA ${TESTVMOPTS} ${TESTJAVAOPTS} -Xlog:class+unload \
|
||||
-javaagent:ClassUnloadTest.jar ClassUnloadTest "${OTHERDIR}" Bar.jar)
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -56,7 +56,7 @@ failures=0
|
||||
|
||||
go() {
|
||||
echo ''
|
||||
sh -xc "$JAVA ${TESTVMOPTS} -javaagent:Agent.jar -classpath SimpleTests.jar $1 $2 $3" 2>&1
|
||||
sh -xc "$JAVA ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:Agent.jar -classpath SimpleTests.jar $1 $2 $3" 2>&1
|
||||
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
|
||||
}
|
||||
|
||||
@ -85,11 +85,11 @@ mv Application.class InstrumentedApplication.bytes
|
||||
cp "${TESTSRC}"/Application.java .
|
||||
"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . Application.java
|
||||
|
||||
sh -xc "$JAVA ${TESTVMOPTS} -classpath . -javaagent:Agent.jar DynamicTest" 2>&1
|
||||
sh -xc "$JAVA ${TESTVMOPTS} ${TESTJAVAOPTS} -classpath . -javaagent:Agent.jar DynamicTest" 2>&1
|
||||
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
|
||||
|
||||
# Repeat test with security manager
|
||||
sh -xc "$JAVA ${TESTVMOPTS} -classpath . -javaagent:Agent.jar -Djava.security.manager DynamicTest" 2>&1
|
||||
sh -xc "$JAVA ${TESTVMOPTS} ${TESTJAVAOPTS} -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