test/java/lang/instrument/ManifestTest.sh
Print this page
*** 310,320 ****
if [ -n "$can_set_nmp_line" ]; then
echo "${can_set_nmp_line}" >> ${AGENT}.mf
fi
rm -f ${AGENT}.jar
! ${JAR} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}.class
echo "$expect_boot_cp_line" > expect_boot_cp_line
echo "$expect_redef_line" > expect_redef_line
echo "$expect_retrans_line" > expect_retrans_line
echo "$expect_set_nmp_line" > expect_set_nmp_line
--- 310,320 ----
if [ -n "$can_set_nmp_line" ]; then
echo "${can_set_nmp_line}" >> ${AGENT}.mf
fi
rm -f ${AGENT}.jar
! ${JAR} ${TESTTOOLVMOPTS} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}.class
echo "$expect_boot_cp_line" > expect_boot_cp_line
echo "$expect_redef_line" > expect_redef_line
echo "$expect_retrans_line" > expect_retrans_line
echo "$expect_set_nmp_line" > expect_set_nmp_line
*** 324,333 ****
--- 324,339 ----
then
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
+ if [ "${COMPILEJAVA}" = "" ]
+ then
+ COMPILEJAVA="${TESTJAVA}"
+ fi
+ echo "COMPILEJAVA=${COMPILEJAVA}"
+
if [ "${TESTSRC}" = "" ]
then
echo "TESTSRC not set. Test cannot execute. Failed."
exit 1
fi
*** 336,347 ****
then
echo "TESTCLASSES not set. Test cannot execute. Failed."
exit 1
fi
! JAR="${TESTJAVA}/bin/jar"
! JAVAC="${TESTJAVA}"/bin/javac
JAVA="${TESTJAVA}"/bin/java
# Now that ManifestTestApp.class is built, we move
# ExampleForBootClassPath.class so that it cannot be found
# by default
--- 342,353 ----
then
echo "TESTCLASSES not set. Test cannot execute. Failed."
exit 1
fi
! JAR="${COMPILEJAVA}/bin/jar"
! JAVAC="${COMPILEJAVA}"/bin/javac
JAVA="${TESTJAVA}"/bin/java
# Now that ManifestTestApp.class is built, we move
# ExampleForBootClassPath.class so that it cannot be found
# by default
*** 351,371 ****
# create a bad version of ExampleForBootClassPath.class
# so we can tell when the wrong version is run
sed 's/return 15/return 42/' "${TESTSRC}"/ExampleForBootClassPath.java \
> ExampleForBootClassPath.java
! "$JAVAC" ExampleForBootClassPath.java
mv ExampleForBootClassPath.class \
$OUT_OF_THE_WAY/ExampleForBootClassPath.class.bad
mv ExampleForBootClassPath.java \
$OUT_OF_THE_WAY/ExampleForBootClassPath.java.bad
AGENT=ManifestTestAgent
# We compile the agent in the working directory instead of with
# a build task because we construct a different agent JAR file
# for each test case.
! ${JAVAC} -d . ${TESTSRC}/${AGENT}.java
FAIL_MARKER=fail_marker
rm -f $FAIL_MARKER
while read token; do
--- 357,377 ----
# create a bad version of ExampleForBootClassPath.class
# so we can tell when the wrong version is run
sed 's/return 15/return 42/' "${TESTSRC}"/ExampleForBootClassPath.java \
> ExampleForBootClassPath.java
! "$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ExampleForBootClassPath.java
mv ExampleForBootClassPath.class \
$OUT_OF_THE_WAY/ExampleForBootClassPath.class.bad
mv ExampleForBootClassPath.java \
$OUT_OF_THE_WAY/ExampleForBootClassPath.java.bad
AGENT=ManifestTestAgent
# We compile the agent in the working directory instead of with
# a build task because we construct a different agent JAR file
# for each test case.
! ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/${AGENT}.java
FAIL_MARKER=fail_marker
rm -f $FAIL_MARKER
while read token; do