test/java/lang/instrument/RedefineMethodInBacktrace.sh

Print this page




  49   exit 1
  50 fi
  51 
  52 if [ "${TESTCLASSES}" = "" ]
  53 then
  54   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  55   exit 1
  56 fi
  57 
  58 JAVAC="${COMPILEJAVA}"/bin/javac
  59 JAVA="${TESTJAVA}"/bin/java
  60 
  61 cp "${TESTSRC}"/RedefineMethodInBacktraceTarget_2.java \
  62     RedefineMethodInBacktraceTarget.java
  63 "${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodInBacktraceTarget.java
  64 
  65 cp "${TESTSRC}"/RedefineMethodInBacktraceTargetB_2.java \
  66     RedefineMethodInBacktraceTargetB.java
  67 "${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodInBacktraceTargetB.java
  68 
  69 "${JAVA}" ${TESTVMOPTS} -javaagent:RedefineMethodInBacktraceAgent.jar \
  70     -classpath "${TESTCLASSES}" RedefineMethodInBacktraceApp > output.log 2>&1
  71 RUN_RESULT=$?
  72 
  73 if [ $RUN_RESULT != 0 ]; then
  74     echo "FAIL: the run failed with exit code '$RUN_RESULT'"
  75         exit $RUN_RESULT
  76 fi
  77 
  78 cat output.log
  79 
  80 MESG="Exception"
  81 grep "$MESG" output.log
  82 result=$?
  83 if [ "$result" = 0 ]; then
  84     echo "FAIL: found '$MESG' in the test output"
  85     result=1
  86 else
  87     echo "PASS: did NOT find '$MESG' in the test output"
  88     result=0
  89 fi


  49   exit 1
  50 fi
  51 
  52 if [ "${TESTCLASSES}" = "" ]
  53 then
  54   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  55   exit 1
  56 fi
  57 
  58 JAVAC="${COMPILEJAVA}"/bin/javac
  59 JAVA="${TESTJAVA}"/bin/java
  60 
  61 cp "${TESTSRC}"/RedefineMethodInBacktraceTarget_2.java \
  62     RedefineMethodInBacktraceTarget.java
  63 "${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodInBacktraceTarget.java
  64 
  65 cp "${TESTSRC}"/RedefineMethodInBacktraceTargetB_2.java \
  66     RedefineMethodInBacktraceTargetB.java
  67 "${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodInBacktraceTargetB.java
  68 
  69 "${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:RedefineMethodInBacktraceAgent.jar \
  70     -classpath "${TESTCLASSES}" RedefineMethodInBacktraceApp > output.log 2>&1
  71 RUN_RESULT=$?
  72 
  73 if [ $RUN_RESULT != 0 ]; then
  74     echo "FAIL: the run failed with exit code '$RUN_RESULT'"
  75         exit $RUN_RESULT
  76 fi
  77 
  78 cat output.log
  79 
  80 MESG="Exception"
  81 grep "$MESG" output.log
  82 result=$?
  83 if [ "$result" = 0 ]; then
  84     echo "FAIL: found '$MESG' in the test output"
  85     result=1
  86 else
  87     echo "PASS: did NOT find '$MESG' in the test output"
  88     result=0
  89 fi