annotate test/demo/zipfs/basic.sh @ 6083:c23785615010

7157656: (zipfs) SeekableByteChannel to entry in zip file always reports its position as 0 Summary: updated SeekableByteChannel.read() to count the bytes read correctly Reviewed-by: sherman Contributed-by: paul.sandoz@oracle.com
author sherman
date Tue, 08 May 2012 11:16:36 -0700
parents 272483f6650b
children 1dcdd2e31524
rev   line source
sherman@2830 1 #
ohair@3909 2 # Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
sherman@2830 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
sherman@2830 4 #
sherman@2830 5 # This code is free software; you can redistribute it and/or modify it
sherman@2830 6 # under the terms of the GNU General Public License version 2 only, as
sherman@2830 7 # published by the Free Software Foundation.
sherman@2830 8 #
sherman@2830 9 # This code is distributed in the hope that it will be useful, but WITHOUT
sherman@2830 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sherman@2830 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sherman@2830 12 # version 2 for more details (a copy is included in the LICENSE file that
sherman@2830 13 # accompanied this code).
sherman@2830 14 #
sherman@2830 15 # You should have received a copy of the GNU General Public License version
sherman@2830 16 # 2 along with this work; if not, write to the Free Software Foundation,
sherman@2830 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
sherman@2830 18 #
sherman@2830 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sherman@2830 20 # or visit www.oracle.com if you need additional information or have any
sherman@2830 21 # questions.
sherman@2830 22 #
sherman@2830 23 # @test
sherman@3569 24 # @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596
sherman@6083 25 # 7157656
sherman@2830 26 # @summary Test ZipFileSystem demo
sherman@2830 27 # @build Basic PathOps ZipFSTester
sherman@2830 28 # @run shell basic.sh
sherman@2830 29
sherman@2830 30 if [ -z "${TESTJAVA}" ]; then
sherman@2830 31 echo "Test must be run with jtreg"
sherman@2830 32 exit 0
sherman@2830 33 fi
sherman@2830 34
sherman@2830 35 ZIPFS="${TESTJAVA}/demo/nio/zipfs/zipfs.jar"
sherman@2830 36 if [ ! -r "${ZIPFS}" ]; then
sherman@2830 37 echo "${ZIPFS} not found"
sherman@2830 38 exit 0
sherman@2830 39 fi
sherman@2830 40
sherman@2830 41 OS=`uname -s`
sherman@2830 42 case "$OS" in
sherman@2830 43 Windows_* )
sherman@2830 44 CLASSPATH="${TESTCLASSES};${ZIPFS}"
sherman@2830 45 ;;
sherman@2830 46 * )
sherman@2830 47 CLASSPATH="${TESTCLASSES}:${ZIPFS}"
sherman@2830 48 ;;
sherman@2830 49 esac
sherman@2830 50 export CLASSPATH
sherman@2830 51
sherman@2830 52 failures=0
sherman@2830 53
sherman@2830 54 go() {
sherman@2830 55 echo ""
sherman@2830 56 ${TESTJAVA}/bin/java $1 $2 $3 2>&1
sherman@2830 57 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
sherman@2830 58 }
sherman@2830 59
sherman@2830 60 # Run the tests
sherman@2830 61
sherman@2830 62 go Basic "${ZIPFS}"
sherman@2830 63 go PathOps "${ZIPFS}"
sherman@2830 64 go ZipFSTester "${ZIPFS}"
sherman@2830 65
sherman@2830 66 #
sherman@2830 67 # Results
sherman@2830 68 #
sherman@2830 69
sherman@2830 70 if [ $failures -gt 0 ];
sherman@2830 71 then echo "$failures tests failed";
sherman@2830 72 else echo "All tests passed";
sherman@2830 73 fi
sherman@2830 74 exit $failures