1 #
   2 # Copyright (c) 2015, 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 case for having resource bundles in a local named module
  26 #          with no ResourceBundleProviders.
  27 
  28 
  29 set -e
  30 
  31 if [ -z "$TESTJAVA" ]; then
  32   if [ $# -lt 1 ]; then exit 1; fi
  33   TESTJAVA="$1"; shift
  34   COMPILEJAVA="${TESTJAVA}"
  35   TESTSRC="`pwd`"
  36   TESTCLASSES="`pwd`"
  37 fi
  38 
  39 JAVAC="$COMPILEJAVA/bin/javac"
  40 JAR="$COMPILEJAVA/bin/jar"
  41 JAVA="$TESTJAVA/bin/java"
  42 
  43 rm -rf mods
  44 mkdir -p mods/test
  45 
  46 #
  47 # Copy .properties files
  48 #
  49 PROPS="`(cd $TESTSRC/src; find . -name '*.properties')`"
  50 if [ "x$PROPS" != x ]; then
  51     for P in $PROPS
  52     do
  53       D=`dirname $P`
  54       mkdir -p mods/$D
  55       cp $TESTSRC/src/$P mods/$D/
  56     done
  57 fi
  58 
  59 $JAVAC -g -d mods -modulesourcepath $TESTSRC/src \
  60        -cp mods/bundles `find $TESTSRC/src/test -name "*.java"`
  61 
  62 # Create a jar to be added to the class path. Expected properties files are
  63 # picked up from the class path.
  64 rm -f extra.jar
  65 mkdir -p classes
  66 $JAR -cf extra.jar -C $TESTSRC/src/extra jdk/test/resources
  67 $JAR -tvf extra.jar
  68 
  69 $JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de &&
  70    # properties files on the class path should be picked up.
  71    $JAVA -cp extra.jar -mp mods -m test/jdk.test.Main de fr ja zh-tw en vi
  72 
  73 exit $?