0N/A#! /bin/sh
0N/A
0N/A#
2362N/A# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
0N/A#
0N/A
0N/A# @test
0N/A# @bug 4361044 4388202 4418643 4523159 4730642
0N/A# @summary various resource and classloading bugs related to jar files
0N/A#set -x
0N/ADEST=`pwd`
1486N/A
1486N/AOS=`uname -s`
1486N/Acase "$OS" in
4638N/A SunOS | Linux | Darwin )
1486N/A PS=":"
1486N/A FS="/"
1486N/A ;;
1486N/A Windows* )
1486N/A PS=";"
1486N/A FS="\\"
1486N/A ;;
1486N/A CYGWIN* )
1486N/A PS=";"
1486N/A FS="/"
1486N/A #
1486N/A # javac does not like /cygdrive produced by `pwd`.
1486N/A #
1486N/A DEST=`cygpath -d ${DEST}`
1486N/A ;;
1486N/A * )
1486N/A echo "Unrecognized system!"
1486N/A exit 1;
1486N/A ;;
1486N/Aesac
1486N/A
0N/A#
4638N/A# build jar1
0N/A#
1486N/Amkdir -p ${DEST}${FS}jar1
4638N/Acd ${TESTSRC}${FS}etc${FS}jar1
1486N/Acp -r . ${DEST}${FS}jar1
1486N/A${TESTJAVA}${FS}bin${FS}javac -d ${DEST}${FS}jar1 \
1486N/A ${TESTSRC}${FS}src${FS}jar1${FS}LoadResourceBundle.java
1486N/A${TESTJAVA}${FS}bin${FS}javac -d ${DEST}${FS}jar1 \
1486N/A ${TESTSRC}${FS}src${FS}jar1${FS}GetResource.java
1486N/Acd ${DEST}${FS}jar1
1486N/A${TESTJAVA}${FS}bin${FS}jar cfM jar1.jar jar1 res1.txt
0N/Amv jar1.jar ..
0N/A#
0N/A# build the test sources and run them
0N/A#
1486N/A${TESTJAVA}${FS}bin${FS}javac -d ${DEST} ${TESTSRC}${FS}src${FS}test${FS}*.java
0N/Acd ${DEST}
1486N/A${TESTJAVA}${FS}bin${FS}java RunAllTests
0N/Aresult=$?
0N/Aif [ "$result" -ne "0" ]; then
0N/A exit 1
0N/Afi
0N/Arm -rf *
0N/Aexit 0