# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
# @test
# @bug 7169888
# @run shell JdpTest.sh --jtreg --no-compile
# @summary No word Failed expected in the test output
# temporary disable jcmd related tests
# _testsuite="01,02,03,04,05"
_testsuite="01,02,04"
_pwd=`pwd`
_testclasses=".classes"
_testsrc="${_pwd}"
_last_pid=""
_ip="224.0.23.178"
_port="7095"
_jmxport="4545"
# If the test run without JTReg, we have to compile it by our self
# Under JTReg see @compile statement above
# to ignore it
if [ ! -d ${_testclasses} ]
then
mkdir -p ${_testclasses}
fi
rm -f ${_testclasses}/*.class
# Compile testcase
${COMPILEJAVA}/bin/javac -XDignore.symbol.file -d ${_testclasses} \
if [ ! -f ${_testclasses}/JdpDoSomething.class -o ! -f ${_testclasses}/JdpClient.class -o ! -f ${_testclasses}/JdpUnitTest.class ]
then
echo "ERROR: Can't compile"
exit 255
fi
}
testappname=$1
shift
${TESTJAVA}/bin/java -server $* -cp ${_testclasses} ${testappname} >> ${_logname} 2>&1 &
_last_pid=$!
if [ "${npid}" = "" ]
then
echo "ERROR: Test app not started. Please check machine resources before filing a bug."
if [ "${_jtreg}" = "yes" ]
then
exit 255
fi
fi
}
}
rm ${_lockFileName}
# wait until VM is actually shuts down
while true
do
if [ "${npid}" = "" ]
then
break
fi
sleep 1
done
}
-cp ${_testclasses} \
$* \
}
}
echo "$*"
}
# ============= TESTS ======================================
_echo "**** Test one ****"
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
}
_echo "**** Test two ****"
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
}
_echo "**** Test three ****"
jdp.address=${_ip} \
jdp.pause=5 \
jmxremote.port=${_jmxport} \
jmxremote.authenticate=false \
jmxremote.ssl=false
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
}
_echo "**** Test four ****"
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
}
_echo "**** Test five ****"
jmxremote.autodiscovery=true \
jmxremote.port=${_jmxport} \
jmxremote.authenticate=false \
jmxremote.ssl=false
OK*)
_echo "Passed"
;;
*)
_echo "Failed!"
;;
esac
}
# ============= MAIN =======================================
if [ "x${TESTJAVA}" = "x" ]
then
echo "TESTJAVA env have to be set"
exit
fi
# COMPILEJAVA variable is set when we test jre
if [ "x${COMPILEJAVA}" = "x" ]
then
COMPILEJAVA="${TESTJAVA}"
fi
#------------------------------------------------------------------------------
# reading parameters
do
*)
echo "Undefined parameter $parm. Try --help for help"
exit
;;
esac
done
if [ "${_compile}" = "yes" ]
then
fi
if [ "${_jtreg}" = "yes" ]
then
fi
# Make sure _tesclasses is absolute path
if [ "${tt}" = "${_testclasses}" ]
then
_testclasses="${_pwd}/${_testclasses}"
fi
_policyname="${_testclasses}/policy"
rm -f ${_policyname}
if [ -f ${_testsrc}/policy.tpl ]
then
> ${_policyname}
fi
# Local mode tests
do
test_${i}
done