test/java/lang/instrument/ManifestTest.sh

Print this page




 362 "$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ExampleForBootClassPath.java
 363 mv ExampleForBootClassPath.class \
 364     $OUT_OF_THE_WAY/ExampleForBootClassPath.class.bad
 365 mv ExampleForBootClassPath.java \
 366     $OUT_OF_THE_WAY/ExampleForBootClassPath.java.bad
 367 
 368 AGENT=ManifestTestAgent
 369 # We compile the agent in the working directory instead of with
 370 # a build task because we construct a different agent JAR file
 371 # for each test case.
 372 ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/${AGENT}.java
 373 
 374 FAIL_MARKER=fail_marker
 375 rm -f $FAIL_MARKER
 376 
 377 while read token; do
 378     echo
 379     echo "===== begin test case: $token ====="
 380     make_a_JAR "$token"
 381 
 382     "${JAVA}" ${TESTVMOPTS} -javaagent:${AGENT}.jar \
 383         -classpath "${TESTCLASSES}" ManifestTestApp > output.log 2>&1
 384     result=$?
 385 
 386     cat output.log
 387 
 388     if [ "$result" = 0 ]; then
 389         echo "PASS: ManifestTestApp exited with status of 0."
 390     else
 391         echo "FAIL: ManifestTestApp exited with status of $result"
 392         touch $FAIL_MARKER
 393     fi
 394 
 395     MESG="Hello from ${AGENT}!"
 396     grep -s "$MESG" output.log > /dev/null
 397     result=$?
 398     if [ "$result" = 0 ]; then
 399         echo "PASS: found '$MESG' in the test output"
 400     else
 401         echo "FAIL: did NOT find '$MESG' in the test output"
 402         touch $FAIL_MARKER




 362 "$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ExampleForBootClassPath.java
 363 mv ExampleForBootClassPath.class \
 364     $OUT_OF_THE_WAY/ExampleForBootClassPath.class.bad
 365 mv ExampleForBootClassPath.java \
 366     $OUT_OF_THE_WAY/ExampleForBootClassPath.java.bad
 367 
 368 AGENT=ManifestTestAgent
 369 # We compile the agent in the working directory instead of with
 370 # a build task because we construct a different agent JAR file
 371 # for each test case.
 372 ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/${AGENT}.java
 373 
 374 FAIL_MARKER=fail_marker
 375 rm -f $FAIL_MARKER
 376 
 377 while read token; do
 378     echo
 379     echo "===== begin test case: $token ====="
 380     make_a_JAR "$token"
 381 
 382     "${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:${AGENT}.jar \
 383         -classpath "${TESTCLASSES}" ManifestTestApp > output.log 2>&1
 384     result=$?
 385 
 386     cat output.log
 387 
 388     if [ "$result" = 0 ]; then
 389         echo "PASS: ManifestTestApp exited with status of 0."
 390     else
 391         echo "FAIL: ManifestTestApp exited with status of $result"
 392         touch $FAIL_MARKER
 393     fi
 394 
 395     MESG="Hello from ${AGENT}!"
 396     grep -s "$MESG" output.log > /dev/null
 397     result=$?
 398     if [ "$result" = 0 ]; then
 399         echo "PASS: found '$MESG' in the test output"
 400     else
 401         echo "FAIL: did NOT find '$MESG' in the test output"
 402         touch $FAIL_MARKER