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