annotate test/java/util/ResourceBundle/modules/basic/basic.sh @ 13553:6a7e0309fa89

Update ResourceBundle tests specific target module to javac -XaddExports
author alanb
date Fri, 31 Jul 2015 08:10:32 +0100
parents 70d30ff90c0f
children 092748c0492c
rev   line source
mchung@12389 1 #
mchung@12389 2 # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
mchung@12389 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mchung@12389 4 #
mchung@12389 5 # This code is free software; you can redistribute it and/or modify it
mchung@12389 6 # under the terms of the GNU General Public License version 2 only, as
mchung@12389 7 # published by the Free Software Foundation.
mchung@12389 8 #
mchung@12389 9 # This code is distributed in the hope that it will be useful, but WITHOUT
mchung@12389 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mchung@12389 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mchung@12389 12 # version 2 for more details (a copy is included in the LICENSE file that
mchung@12389 13 # accompanied this code).
mchung@12389 14 #
mchung@12389 15 # You should have received a copy of the GNU General Public License version
mchung@12389 16 # 2 along with this work; if not, write to the Free Software Foundation,
mchung@12389 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mchung@12389 18 #
mchung@12389 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mchung@12389 20 # or visit www.oracle.com if you need additional information or have any
mchung@12389 21 # questions.
mchung@12389 22 #
mchung@12389 23
mchung@12389 24 # @test
mchung@12389 25 # @summary Basic test for ResourceBundle with modules;
mchung@12389 26 # resource bundles are grouped in main, EU, and Asia.
mchung@12389 27
mchung@12389 28 set -e
mchung@12389 29
mchung@12389 30 if [ -z "$TESTJAVA" ]; then
mchung@12389 31 if [ $# -lt 1 ]; then exit 1; fi
mchung@12389 32 TESTJAVA="$1"; shift
mchung@12389 33 COMPILEJAVA="${TESTJAVA}"
mchung@12389 34 TESTSRC="`pwd`"
mchung@12389 35 TESTCLASSES="`pwd`"
mchung@12389 36 fi
mchung@12389 37
mchung@12389 38 JAVAC="$COMPILEJAVA/bin/javac"
okutsu@13206 39 JAR="$COMPILEJAVA/bin/jar"
mchung@12389 40 JAVA="$TESTJAVA/bin/java"
mchung@12389 41
okutsu@13206 42 # This test is temporarily converted to use AbstractResourceBundleProvider class
mchung@12719 43 # to avoid calling Control.newBundle
alanb@13553 44 EXTRA_OPTS="-XaddExports:java.base/sun.util.locale.provider=mainbundles"
mchung@12389 45
mchung@12389 46 rm -rf mods
mchung@12389 47
mchung@12389 48 CP=
mchung@12389 49 for I in main eu asia
mchung@12389 50 do
mchung@12389 51 B=${I}bundles
mchung@12389 52 mkdir -p mods/$B
mchung@12389 53 CLASSES="`find $TESTSRC/src/$B -name '*.java'`"
mchung@12389 54 if [ "x$CLASSES" != x ]; then
alanb@13553 55 $JAVAC ${EXTRA_OPTS} -g -d mods -modulesourcepath $TESTSRC/src $CP $CLASSES
mchung@12389 56 fi
mchung@12389 57 PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`"
mchung@12389 58 if [ "x$PROPS" != x ]; then
mchung@12389 59 for P in $PROPS
mchung@12389 60 do
mchung@12389 61 D=`dirname $P`
mchung@12389 62 mkdir -p mods/$B/$D
mchung@12389 63 cp $TESTSRC/src/$B/$P mods/$B/$D/
mchung@12389 64 done
mchung@12389 65 fi
mchung@12389 66 CP="-cp mods/mainbundles"
mchung@12389 67 done
mchung@12389 68
mchung@12389 69 mkdir -p mods/test
alanb@13553 70 $JAVAC ${EXTRA_OPTS} -g -cp mods/mainbundles -d mods -modulesourcepath $TESTSRC/src \
mchung@12389 71 `find $TESTSRC/src/test -name "*.java"`
mchung@12389 72
okutsu@13319 73 # Create a jar to be added to the class path. Expected only properties files are
okutsu@13319 74 # picked up from the class path.
okutsu@13319 75 rm -f extra.jar
okutsu@13319 76 mkdir -p classes
okutsu@13319 77 $JAVAC -d classes $TESTSRC/src/extra/jdk/test/resources/eu/*.java
okutsu@13319 78 $JAR -cf extra.jar -C classes jdk/test/resources/eu \
okutsu@13319 79 -C $TESTSRC/src/extra jdk/test/resources/asia
okutsu@13319 80 $JAR -tvf extra.jar
okutsu@13319 81
alanb@13553 82 $JAVA ${EXTRA_OPTS} -mp mods -m test/jdk.test.Main de fr ja zh-tw en de &&
alanb@13352 83 # properties files on the class path should be picked up.
alanb@13553 84 $JAVA ${EXTRA_OPTS} -cp extra.jar -mp mods -m test/jdk.test.Main de fr ja zh-tw en de vi &&
alanb@13352 85 # classes on the class path shouldn't.
alanb@13553 86 ! $JAVA ${EXTRA_OPTS} -cp extra.jar -mp mods -m test/jdk.test.Main es
mchung@12389 87
mchung@12389 88 exit $?