4638N/A#
3261N/A# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4638N/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.
4638N/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).
4638N/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.
4638N/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#!/bin/sh
0N/A#
0N/A# @test
0N/A# @bug 6299235
0N/A# @summary test Bug 6299235 to make sure the third-party provided sun resources could be picked up.
0N/A# @build Bug6299235Test
0N/A# @run shell Bug6299235Test.sh
0N/A
0N/A# set platform-dependent variables
0N/AOS=`uname -s`
0N/Acase "$OS" in
4638N/A SunOS | Linux | Darwin )
0N/A PATHSEP=":"
0N/A FILESEP="/"
0N/A ;;
2077N/A Windows* | CYGWIN* )
0N/A PATHSEP=";"
0N/A FILESEP="\\"
0N/A ;;
0N/A * )
0N/A echo "${OS} is unrecognized system!"
0N/A exit 1;
0N/A ;;
0N/Aesac
0N/A
0N/Aif [ -z "${TESTSRC}" ]; then
0N/A echo "TESTSRC undefined: defaulting to ."
0N/A TESTSRC=.
0N/Afi
0N/A
0N/Aif [ -z "${TESTJAVA}" ]; then
0N/A echo "TESTJAVA undefined: can't continue."
0N/A exit 1
0N/Afi
0N/A
0N/A# See if TESTJAVA points to JRE or JDK
0N/Aif [ -d "${TESTJAVA}${FILESEP}jre" ]; then
0N/A JRE_EXT_DIR=${TESTJAVA}${FILESEP}jre${FILESEP}lib${FILESEP}ext
0N/Aelse
0N/A JRE_EXT_DIR=${TESTJAVA}${FILESEP}lib${FILESEP}ext
0N/Afi
0N/A
0N/Aif [ -d "${JRE_EXT_DIR}" ]; then
2077N/A NEW_EXT_DIR="${JRE_EXT_DIR}${PATHSEP}${TESTSRC}"
0N/Aelse
0N/A NEW_EXT_DIR=${TESTSRC}
0N/Afi
0N/A
0N/Aecho "TESTJAVA=${TESTJAVA}"
0N/Aecho "TESTSRC=${TESTSRC}"
0N/Aecho "TESTCLASSES=${TESTCLASSES}"
0N/Aecho "NEW_EXT_DIR=${NEW_EXT_DIR}"
0N/A
0N/Acd ${TESTSRC}
0N/A
0N/A${TESTJAVA}/bin/java -cp ${TESTCLASSES} -Djava.ext.dirs=${NEW_EXT_DIR} Bug6299235Test
0N/A
0N/Aif [ $? -ne 0 ]
0N/A then
0N/A echo "Test fails: exception thrown!"
0N/A exit 1
0N/Afi
0N/A
0N/Aexit 0