fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# This code is free software; you can redistribute it and/or modify it
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# under the terms of the GNU General Public License version 2 only, as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# published by the Free Software Foundation.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# This code is distributed in the hope that it will be useful, but WITHOUT
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# version 2 for more details (a copy is included in the LICENSE file that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# accompanied this code).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You should have received a copy of the GNU General Public License version
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# 2 along with this work; if not, write to the Free Software Foundation,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# or visit www.oracle.com if you need additional information or have any
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# questions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# @test
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# 7157656 8002390
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# @summary Test ZipFileSystem demo
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# @build Basic PathOps ZipFSTester
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# @run shell basic.sh
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteif [ -z "${TESTJAVA}" ]; then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo "Test must be run with jtreg"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte exit 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteZIPFS="${TESTJAVA}/demo/nio/zipfs/zipfs.jar"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteif [ ! -r "${ZIPFS}" ]; then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo "${ZIPFS} not found"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte exit 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteOS=`uname -s`
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecase "$OS" in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Windows_* )
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CLASSPATH="${TESTCLASSES};${ZIPFS}"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ;;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * )
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CLASSPATH="${TESTCLASSES}:${ZIPFS}"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ;;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteesac
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteexport CLASSPATH
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefailures=0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortego() {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo ""
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ${TESTJAVA}/bin/java $1 $2 $3 2>&1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Run the tests
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortego Basic "${ZIPFS}"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortego PathOps "${ZIPFS}"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortego ZipFSTester "${ZIPFS}"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Results
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteif [ $failures -gt 0 ];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortethen echo "$failures tests failed";
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteelse echo "All tests passed";
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteexit $failures
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte