test/java/lang/instrument/RedefineMethodWithAnnotations.sh

Print this page




  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}"/RedefineMethodWithAnnotationsTarget_2.java \
  62     RedefineMethodWithAnnotationsTarget.java
  63 cp "${TESTSRC}"/RedefineMethodWithAnnotationsAnnotations.java \
  64     RedefineMethodWithAnnotationsAnnotations.java
  65 
  66 "${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
  67     RedefineMethodWithAnnotationsTarget.java \
  68     RedefineMethodWithAnnotationsAnnotations.java
  69 
  70 "${JAVA}" ${TESTVMOPTS} -javaagent:RedefineMethodWithAnnotationsAgent.jar \
  71     -XX:+StressLdcRewrite -XX:+IgnoreUnrecognizedVMOptions \
  72     -cp "${TESTCLASSES}" RedefineMethodWithAnnotationsApp > output.log 2>&1
  73 cat output.log
  74 
  75 MESG="Exception|fatal"
  76 egrep "$MESG" output.log
  77 result=$?
  78 if [ "$result" = 0 ]; then
  79     echo "FAIL: found '$MESG' in the test output"
  80     result=1
  81 else
  82     echo "PASS: did NOT find '$MESG' in the test output"
  83     result=0
  84 fi
  85 
  86 exit $result


  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}"/RedefineMethodWithAnnotationsTarget_2.java \
  62     RedefineMethodWithAnnotationsTarget.java
  63 cp "${TESTSRC}"/RedefineMethodWithAnnotationsAnnotations.java \
  64     RedefineMethodWithAnnotationsAnnotations.java
  65 
  66 "${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
  67     RedefineMethodWithAnnotationsTarget.java \
  68     RedefineMethodWithAnnotationsAnnotations.java
  69 
  70 "${JAVA}" ${TESTVMOPTS} ${TESTJAVAOPTS} -javaagent:RedefineMethodWithAnnotationsAgent.jar \
  71     -XX:+StressLdcRewrite -XX:+IgnoreUnrecognizedVMOptions \
  72     -cp "${TESTCLASSES}" RedefineMethodWithAnnotationsApp > output.log 2>&1
  73 cat output.log
  74 
  75 MESG="Exception|fatal"
  76 egrep "$MESG" output.log
  77 result=$?
  78 if [ "$result" = 0 ]; then
  79     echo "FAIL: found '$MESG' in the test output"
  80     result=1
  81 else
  82     echo "PASS: did NOT find '$MESG' in the test output"
  83     result=0
  84 fi
  85 
  86 exit $result