jdk-24/jdk/test/java/util/Currency/PropertiesTest.sh
Alan Bateman 3269d85838 7113349: Initial changeset for Macosx port to jdk
Co-authored-by: Alexander Potochkin <alexander.potochkin@oracle.com>
Co-authored-by: Alexander Zuev <alexander.zuev@oracle.com>
Co-authored-by: Andrew Brygin <andrew.brygin@oracle.com>
Co-authored-by: Artem Ananiev <artem.ananiev@oracle.com>
Co-authored-by: Alex Strange <astrange@apple.com>
Co-authored-by: Bino George <bino@apple.com>
Co-authored-by: Christine Lu <christine.lu@oracle.com>
Co-authored-by: David Katleman <david.katleman@oracle.com>
Co-authored-by: David Durrence <david_durrence@apple.com>
Co-authored-by: Dmitry Cherepanov <dmitry.cherepanov@oracle.com>
Co-authored-by: Greg Lewis <glewis@eyesbeyond.com>
Co-authored-by: Kevin Miller <kevin_m_miller@apple.com>
Co-authored-by: Kurt Miller <kurt@intricatesoftware.com>
Co-authored-by: Landon Fuller <landonf@plausiblelabs.com>
Co-authored-by: Leonid Romanov <leonid.romanov@oracle.com>
Co-authored-by: Loefty Walkowiak <loefty@apple.com>
Co-authored-by: Mark Reinhold <mark.reinhold@oracle.com>
Co-authored-by: Naoto Sato <naoto.sato@oracle.com>
Co-authored-by: Philip Race <philip.race@oracle.com>
Co-authored-by: Roger Hoover <rhoover@apple.com>
Co-authored-by: Scott Kovatch <scott.kovatch@oracle.com>
Co-authored-by: Sergey ByloKhov <sergey.bylokhov@oracle.com>
Co-authored-by: Mike Swingler <swingler@apple.com>
Co-authored-by: Tomas Hurka <tomas.hurka@oracle.com>
Reviewed-by: jjh, alanb, dholmes, anthony, ohrstrom, ksrini, jrose, weijun, smarks
2012-03-06 20:34:38 +00:00

123 lines
2.2 KiB
Bash

#!/bin/sh
#
# @test
# @bug 6332666
# @summary tests the capability of replacing the currency data with user
# specified currency properties file
# @build PropertiesTest
# @run shell/timeout=600 PropertiesTest.sh
if [ "${TESTSRC}" = "" ]
then
echo "TESTSRC not set. Test cannot execute. Failed."
exit 1
fi
echo "TESTSRC=${TESTSRC}"
if [ "${TESTJAVA}" = "" ]
then
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
echo "TESTJAVA=${TESTJAVA}"
if [ "${TESTCLASSES}" = "" ]
then
echo "TESTCLASSES not set. Test cannot execute. Failed."
exit 1
fi
echo "TESTCLASSES=${TESTCLASSES}"
echo "CLASSPATH=${CLASSPATH}"
# set platform-dependent variables
OS=`uname -s`
case "$OS" in
SunOS | Linux | Darwin )
PS=":"
FS="/"
;;
Windows* | CYGWIN* )
PS=";"
FS="\\"
;;
* )
echo "Unrecognized system!"
exit 1;
;;
esac
# Currency dump path #1. Just dump currencies with the bare JRE
# run
RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} PropertiesTest -d dump1"
echo ${RUNCMD}
${RUNCMD}
result=$?
if [ $result -eq 0 ]
then
echo "Execution successful"
else
echo "Execution of the test case failed."
fi
# Currency dump path #2. Dump currencies using the JRE with replacement currencies
# copy the test properties file
COPIED=0
if [ -w $TESTJAVA ]
then
WRITABLEJDK=$TESTJAVA
else
WRITABLEJDK=.${FS}testjava
cp -r $TESTJAVA $WRITABLEJDK
COPIED=1
fi
if [ -d ${WRITABLEJDK}${FS}jre ]
then
PROPLOCATION=${WRITABLEJDK}${FS}jre${FS}lib
else
PROPLOCATION=${WRITABLEJDK}${FS}lib
fi
cp ${TESTSRC}${FS}currency.properties $PROPLOCATION
# run
RUNCMD="${WRITABLEJDK}${FS}bin${FS}java -classpath ${TESTCLASSES} PropertiesTest -d dump2"
echo ${RUNCMD}
${RUNCMD}
result=$?
if [ $result -eq 0 ]
then
echo "Execution successful"
else
echo "Execution of the test case failed."
fi
# Now compare the two dump files
RUNCMD="${WRITABLEJDK}${FS}bin${FS}java -classpath ${TESTCLASSES} PropertiesTest -c dump1 dump2"
echo ${RUNCMD}
${RUNCMD}
result=$?
if [ $result -eq 0 ]
then
echo "Execution successful"
else
echo "Execution of the test case failed."
fi
# Cleanup
rm -f dump1
rm -f dump2
rm -f ${PROPLOCATION}${FS}currency.properties
if [ $COPIED -eq 1 ]
then
rm -rf $WRITABLEJDK
fi
exit $result