DeleteFont.sh revision 2362
5544N/A# Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
5544N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5544N/A#
5544N/A# This code is free software; you can redistribute it and/or modify it
5544N/A# under the terms of the GNU General Public License version 2 only, as
5544N/A# published by the Free Software Foundation.
5544N/A#
5544N/A# This code is distributed in the hope that it will be useful, but WITHOUT
5544N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5544N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5544N/A# version 2 for more details (a copy is included in the LICENSE file that
5544N/A# accompanied this code).
5544N/A#
5544N/A# You should have received a copy of the GNU General Public License version
5544N/A# 2 along with this work; if not, write to the Free Software Foundation,
5544N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5544N/A#
5544N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5544N/A# or visit www.oracle.com if you need additional information or have any
5544N/A# questions.
5544N/A
5544N/A# @test
5544N/A# @bug 6189812 6380357 6632886
5544N/A# @summary Verify that temporary font files are deleted on exit.
5544N/A
5544N/Aif [ -z "${TESTSRC}" ]; then
5544N/A echo "TESTSRC undefined: defaulting to ."
5544N/A TESTSRC=.
5544N/Afi
5544N/A
5544N/Aif [ -z "${TESTCLASSES}" ]; then
5544N/A echo "TESTCLASSES undefined: defaulting to ."
5544N/A TESTCLASSES=.
5544N/Afi
5544N/A
5544N/Aif [ -z "${TESTJAVA}" ]; then
5544N/A echo "TESTJAVA undefined: can't continue."
5544N/A exit 1
5544N/Afi
5544N/A
5544N/Aecho "TESTJAVA=${TESTJAVA}"
5544N/Aecho "TESTSRC=${TESTSRC}"
5544N/Aecho "TESTCLASSES=${TESTCLASSES}"
5544N/Acd ${TESTSRC}
5544N/A${TESTJAVA}/bin/javac -d ${TESTCLASSES} DeleteFont.java
5544N/A
5544N/Acd ${TESTCLASSES}
5544N/A
5544N/Anumfiles0=`ls ${TESTCLASSES} | wc -l`
5544N/A${TESTJAVA}/bin/java -Djava.io.tmpdir=${TESTCLASSES} DeleteFont
5544N/A
5544N/Aif [ $? -ne 0 ]
5544N/A then
5544N/A echo "Test fails: exception thrown!"
5544N/A exit 1
5544N/Afi
5544N/A
5544N/Anumfiles1=`ls ${TESTCLASSES} | wc -l`
5544N/A
5544N/Aif [ $numfiles0 -ne $numfiles1 ]
5544N/A then
5544N/A echo "Test fails: tmp file exists!"
5544N/A ls ${TESTCLASSES}
5544N/A exit 1
5544N/Afi
5544N/Aexit 0
5544N/A