< prev index next >

test/jdk/java/util/zip/EntryCount64k.java

Print this page
rev 51638 : [mq]: 8210112


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @summary Test java.util.zip behavior with ~64k entries
  27  * @library /lib/testlibrary
  28  * @run main/othervm EntryCount64k
  29  * @run main/othervm -Djdk.util.zip.inhibitZip64=true EntryCount64k
  30  * @run main/othervm -Djdk.util.zip.inhibitZip64=false EntryCount64k
  31  */
  32 
  33 import java.io.BufferedInputStream;
  34 import java.io.BufferedOutputStream;
  35 import java.io.File;
  36 import java.nio.file.Files;
  37 import java.io.FileInputStream;
  38 import java.io.FileOutputStream;
  39 import java.io.RandomAccessFile;
  40 import java.nio.file.Paths;
  41 import java.util.Enumeration;
  42 import java.util.zip.ZipEntry;
  43 import java.util.zip.ZipFile;
  44 import java.util.zip.ZipInputStream;
  45 import java.util.zip.ZipOutputStream;
  46 
  47 import jdk.testlibrary.OutputAnalyzer;
  48 import jdk.testlibrary.ProcessTools;
  49 
  50 public class EntryCount64k {
  51     public static class Main {
  52         public static void main(String[] args) {
  53             System.out.print("Main");
  54         }
  55     }
  56 
  57     static final String MAIN_CLASS = "EntryCount64k$Main";
  58     static final String THIS_CLASS = "EntryCount64k";
  59     static final String[] SPECIAL_CLASSES = { MAIN_CLASS, THIS_CLASS };
  60     // static final String[] SPECIAL_CLASSES = { MAIN_CLASS };
  61     static final int SPECIAL_COUNT = 1 + SPECIAL_CLASSES.length;
  62 
  63     public static void main(String[] args) throws Throwable {
  64         for (int i = (1 << 16) - 3; i < (1 << 16) + 2; i++)
  65             test(i);
  66     }
  67 
  68     static void test(int entryCount) throws Throwable {




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @summary Test java.util.zip behavior with ~64k entries
  27  * @library /test/lib
  28  * @run main/othervm EntryCount64k
  29  * @run main/othervm -Djdk.util.zip.inhibitZip64=true EntryCount64k
  30  * @run main/othervm -Djdk.util.zip.inhibitZip64=false EntryCount64k
  31  */
  32 
  33 import java.io.BufferedInputStream;
  34 import java.io.BufferedOutputStream;
  35 import java.io.File;
  36 import java.nio.file.Files;
  37 import java.io.FileInputStream;
  38 import java.io.FileOutputStream;
  39 import java.io.RandomAccessFile;
  40 import java.nio.file.Paths;
  41 import java.util.Enumeration;
  42 import java.util.zip.ZipEntry;
  43 import java.util.zip.ZipFile;
  44 import java.util.zip.ZipInputStream;
  45 import java.util.zip.ZipOutputStream;
  46 
  47 import jdk.test.lib.process.OutputAnalyzer;
  48 import jdk.test.lib.process.ProcessTools;
  49 
  50 public class EntryCount64k {
  51     public static class Main {
  52         public static void main(String[] args) {
  53             System.out.print("Main");
  54         }
  55     }
  56 
  57     static final String MAIN_CLASS = "EntryCount64k$Main";
  58     static final String THIS_CLASS = "EntryCount64k";
  59     static final String[] SPECIAL_CLASSES = { MAIN_CLASS, THIS_CLASS };
  60     // static final String[] SPECIAL_CLASSES = { MAIN_CLASS };
  61     static final int SPECIAL_COUNT = 1 + SPECIAL_CLASSES.length;
  62 
  63     public static void main(String[] args) throws Throwable {
  64         for (int i = (1 << 16) - 3; i < (1 << 16) + 2; i++)
  65             test(i);
  66     }
  67 
  68     static void test(int entryCount) throws Throwable {


< prev index next >