1# 2# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. 3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4# 5# This code is free software; you can redistribute it and/or modify it 6# under the terms of the GNU General Public License version 2 only, as 7# published by the Free Software Foundation. 8# 9# This code is distributed in the hope that it will be useful, but WITHOUT 10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12# version 2 for more details (a copy is included in the LICENSE file that 13# accompanied this code). 14# 15# You should have received a copy of the GNU General Public License version 16# 2 along with this work; if not, write to the Free Software Foundation, 17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18# 19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20# or visit www.oracle.com if you need additional information or have any 21# questions. 22# 23 24# @test 25# @summary Test unnamed module to find resource bundles exported 26# from a named module 27 28 29set -e 30 31if [ -z "$TESTJAVA" ]; then 32 if [ $# -lt 1 ]; then exit 1; fi 33 TESTJAVA="$1"; shift 34 COMPILEJAVA="${TESTJAVA}" 35 TESTSRC="`pwd`" 36 TESTCLASSES="`pwd`" 37fi 38 39JAVAC="$COMPILEJAVA/bin/javac" 40JAVA="$TESTJAVA/bin/java" 41 42rm -rf mods 43 44mkdir -p mods/test 45 46B=bundles 47mkdir -p mods/$B 48CLASSES="`find $TESTSRC/src/$B -name '*.java'`" 49if [ "x$CLASSES" != x ]; then 50 $JAVAC -g -d mods --module-source-path $TESTSRC/src $CLASSES 51fi 52PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`" 53if [ "x$PROPS" != x ]; then 54 for P in $PROPS 55 do 56 D=`dirname $P` 57 mkdir -p mods/$B/$D 58 cp $TESTSRC/src/$B/$P mods/$B/$D/ 59 done 60fi 61 62mkdir classes 63$JAVAC -d classes $TESTSRC/Main.java 64 65# access resource bundles that are exported private unconditionally 66$JAVA -cp classes --module-path mods --add-modules bundles \ 67 Main de fr ja zh-tw en de 68 69# --add-exports can't open resources 70$JAVA -cp classes --module-path mods --add-modules bundles \ 71 --add-opens bundles/jdk.test.internal.resources=ALL-UNNAMED \ 72 Main de fr ja zh-tw en de 73 74exit $? 75