jdk/test/demo/zipfs/basic.sh
author sherman
Tue, 01 Feb 2011 14:20:01 -0800
changeset 8165 b67d8b1f4e46
parent 8159 f710beb7e29a
child 8180 ac21bc160e79
permissions -rw-r--r--
7015391: (zipfs) Update zip provider for 1/2011 changes 7014948: (zipfs) ZipFileSystem.newFileSystem(Path...) should not throw FileSystemAlreadyExistsException 7015139: (zipfs) ZipPath.delete() should throw DirectoryNotEmptyException when handling "real, non-empty" dir Summary: zip filesystem provider update Reviewed-by: alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6699
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     1
#
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     2
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     4
# 
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     7
# published by the Free Software Foundation.
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     8
# 
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    13
# accompanied this code).
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    14
# 
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    18
# 
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    21
# questions.
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    22
#
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    23
# @test
8165
b67d8b1f4e46 7015391: (zipfs) Update zip provider for 1/2011 changes
sherman
parents: 8159
diff changeset
    24
# @bug 6990846 7009092 7009085 7015391 7014948
6699
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    25
# @summary Test ZipFileSystem demo
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    26
# @build Basic PathOps ZipFSTester
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    27
# @run shell basic.sh
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    28
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    29
if [ -z "${TESTJAVA}" ]; then
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    30
    echo "Test must be run with jtreg"
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    31
    exit 0
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    32
fi
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    33
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    34
ZIPFS="${TESTJAVA}/demo/nio/zipfs/zipfs.jar"
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    35
if [ ! -r "${ZIPFS}" ]; then
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    36
    echo "${ZIPFS} not found"
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    37
    exit 0
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    38
fi
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    39
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    40
OS=`uname -s`
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    41
case "$OS" in
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    42
    Windows_* )
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    43
        CLASSPATH="${TESTCLASSES};${ZIPFS}"
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    44
        ;;
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    45
    * )
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    46
        CLASSPATH="${TESTCLASSES}:${ZIPFS}"
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    47
        ;;
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    48
esac
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    49
export CLASSPATH
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    50
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    51
failures=0
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    52
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    53
go() {
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    54
    echo ""
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    55
    ${TESTJAVA}/bin/java $1 $2 $3 2>&1
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    56
    if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    57
}
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    58
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    59
# Run the tests
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    60
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    61
go Basic "${ZIPFS}"
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    62
go PathOps "${ZIPFS}"
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    63
go ZipFSTester "${ZIPFS}"
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    64
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    65
#
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    66
# Results
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    67
#
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    68
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    69
if [ $failures -gt 0 ];
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    70
then echo "$failures tests failed";
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    71
else echo "All tests passed";
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    72
fi
d8229570529d 6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff changeset
    73
exit $failures