test/sun/management/jdp/JdpTest.sh

Print this page




  45 _last_pid=""
  46 
  47 _ip="224.0.23.178"
  48 _port="7095"
  49 _jmxport="4545"
  50 
  51 _do_compile(){
  52     # If the test run without JTReg, we have to compile it by our self
  53     # Under JTReg see @compile statement above
  54     # sun.* packages is not included to symbol file lib/ct.sym so we have
  55     # to ignore it
  56 
  57     if [ ! -d ${_testclasses} ]
  58     then
  59        mkdir -p ${_testclasses}
  60     fi
  61 
  62     rm -f ${_testclasses}/*.class
  63 
  64     # Compile testcase
  65     ${COMPILEJAVA}/bin/javac -XDignore.symbol.file -d ${_testclasses} \
  66                                              JdpUnitTest.java \
  67                                              JdpDoSomething.java \
  68                                              JdpClient.java
  69 
  70 
  71     if [ ! -f ${_testclasses}/JdpDoSomething.class -o ! -f ${_testclasses}/JdpClient.class -o ! -f ${_testclasses}/JdpUnitTest.class ]
  72     then
  73       echo "ERROR: Can't compile"
  74       exit 255
  75     fi
  76 }
  77 
  78 
  79 _app_start(){
  80 
  81   testappname=$1
  82   shift
  83 
  84   ${TESTJAVA}/bin/java -server $* -cp ${_testclasses} ${testappname}  >> ${_logname} 2>&1 &
  85  _last_pid=$!
  86 
  87 # wait until VM is actually starts.
  88 # please note, if vm doesn't start for some reason
  89 # jtreg kills the test by timeout. Don't file a bug.
  90   cnt=1
  91   while true
  92   do
  93     npid=`_get_pid`
  94     if [ "${npid}" != "" ]
  95     then
  96       break
  97     fi
  98     if [ "${cnt}" = "10" ]
  99     then
 100       echo "ERROR: Test app not started. Please check machine resources before filing a bug."
 101       if [ "${_jtreg}" = "yes" ]
 102       then
 103           exit 255
 104       fi




  45 _last_pid=""
  46 
  47 _ip="224.0.23.178"
  48 _port="7095"
  49 _jmxport="4545"
  50 
  51 _do_compile(){
  52     # If the test run without JTReg, we have to compile it by our self
  53     # Under JTReg see @compile statement above
  54     # sun.* packages is not included to symbol file lib/ct.sym so we have
  55     # to ignore it
  56 
  57     if [ ! -d ${_testclasses} ]
  58     then
  59        mkdir -p ${_testclasses}
  60     fi
  61 
  62     rm -f ${_testclasses}/*.class
  63 
  64     # Compile testcase
  65     ${COMPILEJAVA}/bin/javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} -XDignore.symbol.file -d ${_testclasses} \
  66                                              JdpUnitTest.java \
  67                                              JdpDoSomething.java \
  68                                              JdpClient.java
  69 
  70 
  71     if [ ! -f ${_testclasses}/JdpDoSomething.class -o ! -f ${_testclasses}/JdpClient.class -o ! -f ${_testclasses}/JdpUnitTest.class ]
  72     then
  73       echo "ERROR: Can't compile"
  74       exit 255
  75     fi
  76 }
  77 
  78 
  79 _app_start(){
  80 
  81   testappname=$1
  82   shift
  83 
  84   ${TESTJAVA}/bin/java ${TESTVMOPTS} ${TESTJAVAOPTS} -server $* -cp ${_testclasses} ${testappname}  >> ${_logname} 2>&1 &
  85  _last_pid=$!
  86 
  87 # wait until VM is actually starts.
  88 # please note, if vm doesn't start for some reason
  89 # jtreg kills the test by timeout. Don't file a bug.
  90   cnt=1
  91   while true
  92   do
  93     npid=`_get_pid`
  94     if [ "${npid}" != "" ]
  95     then
  96       break
  97     fi
  98     if [ "${cnt}" = "10" ]
  99     then
 100       echo "ERROR: Test app not started. Please check machine resources before filing a bug."
 101       if [ "${_jtreg}" = "yes" ]
 102       then
 103           exit 255
 104       fi