Path: blob/master/test/jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh
41153 views
#1# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#2223# @test24# @bug 505529325# @summary Test non US-ASCII characters in the value of the Boot-Class-Path26# attribute.27#28# @key intermittent29# @run shell/timeout=240 BootClassPathTest.sh3031if [ "${TESTJAVA}" = "" ]32then33echo "TESTJAVA not set. Test cannot execute. Failed."34exit 135fi3637if [ "${COMPILEJAVA}" = "" ]38then39COMPILEJAVA="${TESTJAVA}"40fi41echo "COMPILEJAVA=${COMPILEJAVA}"4243if [ "${TESTSRC}" = "" ]44then45echo "TESTSRC not set. Test cannot execute. Failed."46exit 147fi4849if [ "${TESTCLASSES}" = "" ]50then51echo "TESTCLASSES not set. Test cannot execute. Failed."52exit 153fi5455JAVAC="${COMPILEJAVA}"/bin/javac56JAVA="${TESTJAVA}"/bin/java57JAR="${COMPILEJAVA}"/bin/jar5859echo "Creating manifest file..."6061"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}"/Setup.java6263# java Setup <workdir> <premain-class>64# - outputs boot class path to boot.dir6566"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent67BOOTDIR=`cat ${TESTCLASSES}/boot.dir`6869echo "Created ${BOOTDIR}"7071echo "Building test classes..."7273"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" \74"${TESTSRC}"/Agent.java "${TESTSRC}"/DummyMain.java75"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${BOOTDIR}" \76"${TESTSRC}"/AgentSupport.java7778echo "Creating agent jar file..."7980"$JAR" ${TESTTOOLVMOPTS} -cvfm "${TESTCLASSES}"/Agent.jar "${TESTCLASSES}"/MANIFEST.MF \81-C "${TESTCLASSES}" Agent.class || exit 18283echo "Running test..."8485"${JAVA}" ${TESTVMOPTS} -javaagent:"${TESTCLASSES}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain86result=$?8788echo "Cleanup..."8990"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" \91"${TESTSRC}"/Cleanup.java92"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Cleanup "${BOOTDIR}"9394exit $result959697