test/jdk/nio/zipfs/ZipFSTester.java

Print this page




  23 
  24 import java.io.*;
  25 import java.nio.*;
  26 import java.nio.channels.*;
  27 import java.nio.file.*;
  28 import java.nio.file.spi.*;
  29 import java.nio.file.attribute.*;
  30 import java.net.*;
  31 import java.util.*;
  32 import java.util.concurrent.TimeUnit;
  33 import java.util.zip.*;
  34 
  35 import static java.nio.file.StandardOpenOption.*;
  36 import static java.nio.file.StandardCopyOption.*;
  37 
  38 /*
  39  * Tests various zipfs operations.
  40  *
  41  * @test
  42  * @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596
  43  *      7157656 8002390 7012868 7012856 8015728 8038500
  44  * @summary Test Zip filesystem provider


  45  */
  46 
  47 public class ZipFSTester {
  48 
  49     public static void main(String[] args) throws Throwable {
  50         try (FileSystem fs = newZipFileSystem(
  51                  Paths.get(System.getProperty("test.jdk"), "jre/lib/ext/zipfs.jar"),
  52                  new HashMap<String, Object>()))
  53         {
  54             test0(fs);
  55             test1(fs);
  56             test2(fs);   // more tests
  57         }
  58         testTime(Paths.get(System.getProperty("test.jdk"), "jre/lib/ext/zipfs.jar"));
  59     }
  60 
  61     static void test0(FileSystem fs)
  62         throws Exception
  63     {
  64         List<String> list = new LinkedList<>();




  23 
  24 import java.io.*;
  25 import java.nio.*;
  26 import java.nio.channels.*;
  27 import java.nio.file.*;
  28 import java.nio.file.spi.*;
  29 import java.nio.file.attribute.*;
  30 import java.net.*;
  31 import java.util.*;
  32 import java.util.concurrent.TimeUnit;
  33 import java.util.zip.*;
  34 
  35 import static java.nio.file.StandardOpenOption.*;
  36 import static java.nio.file.StandardCopyOption.*;
  37 
  38 /*
  39  * Tests various zipfs operations.
  40  *
  41  * @test
  42  * @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596
  43  *      7157656 8002390 7012868 7012856 8015728 8038500 8040059
  44  * @summary Test Zip filesystem provider
  45  * @run main ZipFSTester
  46  * @run main/othervm/policy=test.policy ZipFSTester
  47  */
  48 
  49 public class ZipFSTester {
  50 
  51     public static void main(String[] args) throws Throwable {
  52         try (FileSystem fs = newZipFileSystem(
  53                  Paths.get(System.getProperty("test.jdk"), "jre/lib/ext/zipfs.jar"),
  54                  new HashMap<String, Object>()))
  55         {
  56             test0(fs);
  57             test1(fs);
  58             test2(fs);   // more tests
  59         }
  60         testTime(Paths.get(System.getProperty("test.jdk"), "jre/lib/ext/zipfs.jar"));
  61     }
  62 
  63     static void test0(FileSystem fs)
  64         throws Exception
  65     {
  66         List<String> list = new LinkedList<>();