Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.sh
38828 views
# Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.1# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2#3# This code is free software; you can redistribute it and/or modify it4# under the terms of the GNU General Public License version 2 only, as5# published by the Free Software Foundation.6#7# This code is distributed in the hope that it will be useful, but WITHOUT8# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License10# version 2 for more details (a copy is included in the LICENSE file that11# accompanied this code).12#13# You should have received a copy of the GNU General Public License version14# 2 along with this work; if not, write to the Free Software Foundation,15# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.16#17# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA18# or visit www.oracle.com if you need additional information or have any19# questions.2021# @test22# @bug 6189812 6380357 663288623# @summary Verify that temporary font files are deleted on exit.2425if [ -z "${TESTSRC}" ]; then26echo "TESTSRC undefined: defaulting to ."27TESTSRC=.28fi2930if [ -z "${TESTCLASSES}" ]; then31echo "TESTCLASSES undefined: defaulting to ."32TESTCLASSES=.33fi3435if [ -z "${TESTJAVA}" ]; then36echo "TESTJAVA undefined: can't continue."37exit 138fi3940echo "TESTJAVA=${TESTJAVA}"41echo "TESTSRC=${TESTSRC}"42echo "TESTCLASSES=${TESTCLASSES}"43cd ${TESTSRC}44${TESTJAVA}/bin/javac -d ${TESTCLASSES} DeleteFont.java4546cd ${TESTCLASSES}4748numfiles0=`ls ${TESTCLASSES} | wc -l`49${TESTJAVA}/bin/java -Djava.io.tmpdir=${TESTCLASSES} DeleteFont5051if [ $? -ne 0 ]52then53echo "Test fails: exception thrown!"54exit 155fi5657numfiles1=`ls ${TESTCLASSES} | wc -l`5859if [ $numfiles0 -ne $numfiles1 ]60then61echo "Test fails: tmp file exists!"62ls ${TESTCLASSES}63exit 164fi65exit 0666768