jdk/test/java/util/zip/ZipFile/LargeZipFile.java
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 8553 46c2babb1e44
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2166
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
     1
/*
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8553
diff changeset
     2
 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
2166
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
     4
 *
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
     7
 * published by the Free Software Foundation.
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
     8
 *
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    13
 * accompanied this code).
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    14
 *
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2438
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2438
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2438
diff changeset
    21
 * questions.
2166
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    22
 */
e01c813f9552 6809463: Missing license header in test LargeZipFile.java
kevinw
parents: 2074
diff changeset
    23
2074
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    24
import java.io.*;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    25
import java.nio.*;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    26
import java.util.*;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    27
import java.util.zip.*;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    28
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    29
public class LargeZipFile {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    30
    // If true, don't delete large ZIP file created for test.
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    31
    static final boolean debug = System.getProperty("debug") != null;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    32
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    33
    static final int DATA_LEN = 1024 * 1024;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    34
    static final int DATA_SIZE = 8;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    35
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    36
    static long fileSize = 3L * 1024L * 1024L * 1024L; // 3GB
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    37
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    38
    static boolean userFile = false;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    39
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    40
    static byte[] data;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    41
    static File largeFile;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    42
    static String lastEntryName;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    43
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    44
    /* args can be empty, in which case check a 3 GB file which is created for
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    45
     * this test (and then deleted).  Or it can be a number, in which case
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    46
     * that designates the size of the file that's created for this test (and
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    47
     * then deleted).  Or it can be the name of a file to use for the test, in
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    48
     * which case it is *not* deleted.  Note that in this last case, the data
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    49
     * comparison might fail.
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    50
     */
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    51
    static void realMain (String[] args) throws Throwable {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    52
        if (args.length > 0) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    53
            try {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    54
                fileSize = Long.parseLong(args[0]);
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    55
                System.out.println("Testing with file of size " + fileSize);
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    56
            } catch (NumberFormatException ex) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    57
                largeFile = new File(args[0]);
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    58
                if (!largeFile.exists()) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    59
                    throw new Exception("Specified file " + args[0] + " does not exist");
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    60
                }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    61
                userFile = true;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    62
                System.out.println("Testing with user-provided file " + largeFile);
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    63
            }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    64
        }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    65
        File testDir = null;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    66
        if (largeFile == null) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    67
            testDir = new File(System.getProperty("test.scratch", "."),
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    68
                                    "LargeZip");
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    69
            if (testDir.exists()) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    70
                if (!testDir.delete()) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    71
                    throw new Exception("Cannot delete already-existing test directory");
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    72
                }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    73
            }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    74
            check(!testDir.exists() && testDir.mkdirs());
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    75
            largeFile = new File(testDir, "largezip.zip");
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    76
            createLargeZip();
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    77
        }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    78
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    79
        readLargeZip();
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    80
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    81
        if (!userFile && !debug) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    82
            check(largeFile.delete());
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    83
            check(testDir.delete());
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    84
        }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    85
    }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    86
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    87
    static void createLargeZip() throws Throwable {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    88
        int iterations = DATA_LEN / DATA_SIZE;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    89
        ByteBuffer bb = ByteBuffer.allocate(DATA_SIZE);
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    90
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    91
        for (int i = 0; i < iterations; i++) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    92
            bb.putDouble(0, Math.random());
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    93
            baos.write(bb.array(), 0, DATA_SIZE);
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    94
        }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
    95
        data = baos.toByteArray();
8553
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
    96
        try (FileOutputStream fos = new FileOutputStream(largeFile);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
    97
             BufferedOutputStream bos = new BufferedOutputStream(fos);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
    98
             ZipOutputStream zos = new ZipOutputStream(bos))
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
    99
        {
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   100
            long length = 0;
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   101
            while (length < fileSize) {
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   102
                ZipEntry ze = new ZipEntry("entry-" + length);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   103
                lastEntryName = ze.getName();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   104
                zos.putNextEntry(ze);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   105
                zos.write(data, 0, data.length);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   106
                zos.closeEntry();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   107
                length = largeFile.length();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   108
            }
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   109
            System.out.println("Last entry written is " + lastEntryName);
2074
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   110
        }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   111
    }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   112
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   113
    static void readLargeZip() throws Throwable {
8553
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   114
        try (ZipFile zipFile = new ZipFile(largeFile)) {
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   115
            ZipEntry entry = null;
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   116
            String entryName = null;
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   117
            int count = 0;
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   118
            Enumeration<? extends ZipEntry> entries = zipFile.entries();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   119
            while (entries.hasMoreElements()) {
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   120
                entry = entries.nextElement();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   121
                entryName = entry.getName();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   122
                count++;
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   123
            }
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   124
            System.out.println("Number of entries read: " + count);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   125
            System.out.println("Last entry read is " + entryName);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   126
            check(!entry.isDirectory());
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   127
            if (check(entryName.equals(lastEntryName))) {
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   128
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   129
                InputStream is = zipFile.getInputStream(entry);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   130
                byte buf[] = new byte[4096];
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   131
                int len;
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   132
                while ((len = is.read(buf)) >= 0) {
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   133
                    baos.write(buf, 0, len);
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   134
                }
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   135
                baos.close();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   136
                is.close();
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   137
                check(Arrays.equals(data, baos.toByteArray()));
46c2babb1e44 7021582: convert jar/zip code and tests to use try-with-resources
smarks
parents: 5506
diff changeset
   138
            }
2074
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   139
        }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   140
    }
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   141
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   142
    //--------------------- Infrastructure ---------------------------
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   143
    static volatile int passed = 0, failed = 0;
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   144
    static void pass() {passed++;}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   145
    static void pass(String msg) {System.out.println(msg); passed++;}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   146
    static void fail() {failed++; Thread.dumpStack();}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   147
    static void fail(String msg) {System.out.println(msg); fail();}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   148
    static void unexpected(Throwable t) {failed++; t.printStackTrace();}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   149
    static void unexpected(Throwable t, String msg) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   150
        System.out.println(msg); failed++; t.printStackTrace();}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   151
    static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   152
    static void equal(Object x, Object y) {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   153
        if (x == null ? y == null : x.equals(y)) pass();
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   154
        else fail(x + " not equal to " + y);}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   155
    public static void main(String[] args) throws Throwable {
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   156
        try {realMain(args);} catch (Throwable t) {unexpected(t);}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   157
        System.out.println("\nPassed = " + passed + " failed = " + failed);
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   158
        if (failed > 0) throw new AssertionError("Some tests failed");}
346a841b2dcc 6599383: Unable to open zip files more than 2GB in size
kevinw
parents:
diff changeset
   159
}