Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/sun/net/www/protocol/jar/jarbug/run.sh
38889 views
#! /bin/sh12#3# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5#6# This code is free software; you can redistribute it and/or modify it7# under the terms of the GNU General Public License version 2 only, as8# published by the Free Software Foundation.9#10# This code is distributed in the hope that it will be useful, but WITHOUT11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13# version 2 for more details (a copy is included in the LICENSE file that14# accompanied this code).15#16# You should have received a copy of the GNU General Public License version17# 2 along with this work; if not, write to the Free Software Foundation,18# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19#20# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21# or visit www.oracle.com if you need additional information or have any22# questions.23#2425# @test26# @bug 4361044 4388202 4418643 4523159 473064227# @summary various resource and classloading bugs related to jar files28#set -x29DEST=`pwd`3031OS=`uname -s`32case "$OS" in33SunOS | Linux | Darwin | AIX )34PS=":"35FS="/"36CHMOD="${FS}bin${FS}chmod"37;;38Windows* )39PS=";"40FS="\\"41CHMOD="chmod"42;;43CYGWIN* )44PS=";"45FS="/"46CHMOD="chmod"47#48# javac does not like /cygdrive produced by `pwd`.49#50DEST=`cygpath -d ${DEST}`51;;52* )53echo "Unrecognized system!"54exit 1;55;;56esac5758#59# build jar160#61mkdir -p ${DEST}${FS}jar162cd ${TESTSRC}${FS}etc${FS}jar163cp -r . ${DEST}${FS}jar164${CHMOD} -R u+w ${DEST}${FS}jar165${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${DEST}${FS}jar1 \66${TESTSRC}${FS}src${FS}jar1${FS}LoadResourceBundle.java67${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${DEST}${FS}jar1 \68${TESTSRC}${FS}src${FS}jar1${FS}GetResource.java69cd ${DEST}${FS}jar170${COMPILEJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS} cfM jar1.jar jar1 res1.txt71mv jar1.jar ..72#73# build the test sources and run them74#75${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${DEST} ${TESTSRC}${FS}src${FS}test${FS}*.java76cd ${DEST}77${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} RunAllTests78result=$?79if [ "$result" -ne "0" ]; then80exit 181fi82rm -rf *83exit 0848586