ReadOldClass.sh revision 0
430N/A#!/bin/sh
430N/A
430N/A#
430N/A# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
430N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
430N/A#
430N/A# This code is free software; you can redistribute it and/or modify it
430N/A# under the terms of the GNU General Public License version 2 only, as
430N/A# published by the Free Software Foundation.
430N/A#
430N/A# This code is distributed in the hope that it will be useful, but WITHOUT
430N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
430N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
430N/A# version 2 for more details (a copy is included in the LICENSE file that
430N/A# accompanied this code).
430N/A#
430N/A# You should have received a copy of the GNU General Public License version
430N/A# 2 along with this work; if not, write to the Free Software Foundation,
430N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
430N/A#
430N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
430N/A# CA 95054 USA or visit www.sun.com if you need additional information or
430N/A# have any questions.
430N/A#
430N/A
430N/A#
430N/A# @test
430N/A# @bug 4164450
430N/A# @summary Ensure that javah/javadoc doesn't try to read (new) source files
430N/A# @author Peter von der Ah\u00e9
430N/A# @run shell ReadOldClass.sh
430N/A#
430N/A
430N/ATS=${TESTSRC-.}
430N/ATC=${TESTCLASSES-.}
430N/A
430N/Aif [ "${TESTJAVA}" = "" ]
430N/Athen
430N/A echo "TESTJAVA not set. Test cannot execute. Failed."
430N/A exit 1
430N/Afi
430N/A
430N/A# set platform-dependent variables
430N/AOS=`uname -s`
430N/Acase "$OS" in
430N/A SunOS | Linux )
430N/A NULL=/dev/null
430N/A PS=":"
430N/A FS="/"
430N/A ;;
430N/A Windows* )
430N/A NULL=NUL
430N/A PS=";"
430N/A FS="\\"
430N/A ;;
430N/A * )
430N/A echo "Unrecognized system!"
430N/A exit 1;
430N/A ;;
430N/Aesac
430N/A
430N/Acat > "${TC}/ReadOldClass.java" <<EOF
430N/Apublic class ReadOldClass {
430N/A public static void main(String[] args) {
430N/A }
430N/A}
430N/AEOF
430N/A
430N/Arm -f ${TC}/ReadOldClass.h
430N/A
430N/Aset -e
430N/A
430N/A# compile the file
430N/A"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d "${TC}" "${TC}/ReadOldClass.java"
430N/A# ensure the source file is newer than the class file
430N/Atouch "${TC}/ReadOldClass.java"
430N/A"${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} -jni -classpath "${TC}" -d "${TC}" ReadOldClass
430N/A
430N/Atest -f "${TC}/ReadOldClass.h"
430N/A