jdk/test/java/util/PluggableLocale/ExecTest.sh
author naoto
Tue, 16 Dec 2014 12:48:31 -0800
changeset 28093 270b6925cbc8
parent 22602 0d9a07b0d7e9
child 30047 63b6a16968d5
permissions -rw-r--r--
8062588: Support java.util.spi.*, java.text.spi.*, java.awt.im.spi loaded from classpath Reviewed-by: alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17933
b18cda672b79 8014834: shell tests don't begin with #!/bin/sh
emc
parents: 15254
diff changeset
     1
#!/bin/sh
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
     2
#
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 12047
diff changeset
     3
# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
     5
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# published by the Free Software Foundation.
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
     9
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# accompanied this code).
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    15
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    19
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4662
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4662
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4662
diff changeset
    22
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# This script is the actual launcher of each locale service provider test.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# fooprovider.jar contains localized object providers and barprovider.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
# contains localized name providers.  This way, we can test providers that
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    30
# can relate to each other (such as, DateFormatSymbolsProvider and
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
# TimeZoneNameProvider) separately.
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    32
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
# Parameters:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#    providersToTest: [foo|bar|foobar]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#    java class name: <class name>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#    providersInExtDir: [true|false]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
if [ "${TESTSRC}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
  echo "TESTSRC not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
echo "TESTSRC=${TESTSRC}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
if [ "${TESTJAVA}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
fi
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    49
if [ "${COMPILEJAVA}" = "" ]
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    50
then
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    51
  COMPILEJAVA="${TESTJAVA}"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    52
fi
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
echo "TESTJAVA=${TESTJAVA}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
if [ "${TESTCLASSES}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
echo "TESTCLASSES=${TESTCLASSES}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
echo "CLASSPATH=${CLASSPATH}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
# set platform-dependent variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
OS=`uname -s`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
case "$OS" in
22602
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 17933
diff changeset
    65
  SunOS | Linux | Darwin | AIX )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    PS=":"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    FS="/"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    ;;
4662
49b8cbe45e6a 6911108: These tests do not work with CYGWIN: java/util
ohair
parents: 2
diff changeset
    69
  Windows* | CYGWIN* )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    PS=";"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    FS="\\"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
  * )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    echo "Unrecognized system!"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    exit 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
esac
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    79
case "$1" in
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
  "foo" )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    cp ${TESTSRC}${FS}fooprovider.jar ${TESTCLASSES}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    CLASSPATHARG=".${PS}${TESTSRC}${PS}${TESTSRC}${FS}fooprovider.jar"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
  "bar" )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    cp ${TESTSRC}${FS}barprovider.jar ${TESTCLASSES}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    CLASSPATHARG=".${PS}${TESTSRC}${PS}${TESTSRC}${FS}barprovider.jar"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
  "foobar" )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    cp ${TESTSRC}${FS}fooprovider.jar ${TESTCLASSES}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    cp ${TESTSRC}${FS}barprovider.jar ${TESTCLASSES}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    CLASSPATHARG=".${PS}${TESTSRC}${PS}${TESTSRC}${FS}fooprovider.jar${PS}${TESTSRC}${PS}${TESTSRC}${FS}barprovider.jar"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
esac
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    94
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
# compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
cp ${TESTSRC}${FS}ProviderTest.java .
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
cp ${TESTSRC}${FS}$2.java .
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    98
COMPILE="${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    99
    -XDignore.symbol.file -d . -classpath ${CLASSPATHARG} $2.java"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
echo ${COMPILE}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
${COMPILE}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
result=$?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
if [ $result -eq 0 ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
  echo "Compilation of the test case was successful."
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
   107
else
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
  echo "Compilation of the test case failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
  # Cleanup
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
  rm -f ${TESTCLASSES}${FS}$2*.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
  rm -f ${TESTCLASSES}${FS}fooprovider.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
  rm -f ${TESTCLASSES}${FS}barprovider.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
  exit $result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
# run
28093
270b6925cbc8 8062588: Support java.util.spi.*, java.text.spi.*, java.awt.im.spi loaded from classpath
naoto
parents: 22602
diff changeset
   117
RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${CLASSPATHARG} $2 "
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
echo ${RUNCMD}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
${RUNCMD}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
result=$?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
if [ $result -eq 0 ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
  echo "Execution successful"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
  echo "Execution of the test case failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
# Cleanup
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
rm -f ${TESTCLASSES}${FS}$2*.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
rm -f ${TESTCLASSES}${FS}fooprovider.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
rm -f ${TESTCLASSES}${FS}barprovider.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
exit $result