1659N/A#
2362N/A# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1659N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1659N/A#
1659N/A# This code is free software; you can redistribute it and/or modify it
1659N/A# under the terms of the GNU General Public License version 2 only, as
1659N/A# published by the Free Software Foundation.
1659N/A#
1659N/A# This code is distributed in the hope that it will be useful, but WITHOUT
1659N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1659N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1659N/A# version 2 for more details (a copy is included in the LICENSE file that
1659N/A# accompanied this code).
1659N/A#
1659N/A# You should have received a copy of the GNU General Public License version
1659N/A# 2 along with this work; if not, write to the Free Software Foundation,
1659N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1659N/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.
1659N/A#
1659N/A
1659N/A
1678N/A# @test Test6842838.sh
1678N/A# @bug 6842838
1678N/A# @summary Test 6842838 64-bit launcher failure due to corrupt jar
1678N/A# @compile CreateBadJar.java
1678N/A# @run shell Test6842838.sh
1678N/A
1678N/Aset -x
1678N/A
1678N/Aif [ "${TESTJAVA}" = "" ]; then
1659N/A PARENT=`dirname \`which java\``
1659N/A TESTJAVA=`dirname ${PARENT}`
1678N/A printf "TESTJAVA not set. Test cannot execute. Failed.\n"
1659N/Afi
1659N/A
1678N/Aif [ "${TESTCLASSES}" = "" ]; then
1678N/A printf "TESTCLASSES not set. Test cannot execute. Failed.\n"
1659N/A exit 1
1659N/Afi
1659N/A
1659N/A# set platform-dependent variables
1659N/AOS=`uname -s`
1659N/Acase "$OS" in
1659N/A SunOS )
1659N/A NULL=/dev/null
1659N/A PS=":"
1659N/A FS="/"
1659N/A JAVA_EXE=${TESTJAVA}${FS}bin${FS}sparcv9${FS}java
1659N/A ;;
1659N/A * )
1678N/A printf "Only testing on sparcv9 (use libumem to reliably catch buffer overrun)\n"
1659N/A exit 0;
1659N/A ;;
1659N/Aesac
1659N/A
1678N/Aif [ ! -x ${JAVA_EXE} ]; then
1678N/A printf "Warning: sparcv9 components not installed - skipping test.\n"
1678N/A exit 0
1678N/Afi
1678N/A
1678N/ALIBUMEM=/lib/64/libumem.so
1678N/Aif [ ! -x ${LIBUMEM} ]; then
1678N/A printf "Warning: libumem not installed - skipping test.\n"
1678N/A exit 0
1678N/Afi
1678N/A
1659N/ABADFILE=newbadjar.jar
1659N/A${JAVA_EXE} -version
1678N/A${JAVA_EXE} -cp ${TESTCLASSES} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
1678N/ALD_PRELOAD=${LIBUMEM} ${JAVA_EXE} -jar ${BADFILE} > test.out 2>&1
1659N/A
1659N/Agrep "Invalid or corrupt jarfile" test.out
1659N/Aexit $?