35 * @bug 8029646 |
35 * @bug 8029646 |
36 * @summary tests that native unpacker produces the same result as Java one |
36 * @summary tests that native unpacker produces the same result as Java one |
37 * @compile -XDignore.symbol.file Utils.java PackTestZip64.java |
37 * @compile -XDignore.symbol.file Utils.java PackTestZip64.java |
38 * @run main PackTestZip64 |
38 * @run main PackTestZip64 |
39 * @author kizune |
39 * @author kizune |
40 * @key intermittent |
|
41 */ |
40 */ |
42 |
41 |
43 public class PackTestZip64 { |
42 public class PackTestZip64 { |
|
43 |
|
44 private static final boolean bigJarEnabled |
|
45 = Boolean.getBoolean("PackTestZip64.enableBigJar"); |
|
46 |
44 public static void main(String... args) throws Exception { |
47 public static void main(String... args) throws Exception { |
45 testPacking(); |
48 testPacking(); |
46 Utils.cleanup(); |
49 Utils.cleanup(); |
47 } |
50 } |
48 |
51 |
49 // 1KB buffer is enough to copy jar content |
52 // 1KB buffer is enough to copy jar content |
50 private static final byte[] BUFFER = new byte[1024]; |
53 private static final byte[] BUFFER = new byte[1024]; |
51 |
54 |
52 static void testPacking() throws IOException { |
55 static void testPacking() throws IOException { |
53 // make a copy of the test specimen to local directory |
|
54 File testFile = new File("tools_java.jar"); |
56 File testFile = new File("tools_java.jar"); |
55 // Add a large number of small files to the golden jar |
57 if (bigJarEnabled) { |
56 generateLargeJar(testFile, Utils.getGoldenJar()); |
58 // Add a large number of small files to the golden jar |
|
59 generateLargeJar(testFile, Utils.getGoldenJar()); |
|
60 } else { |
|
61 // make a copy of the test specimen to local directory |
|
62 Utils.copyFile(Utils.getGoldenJar(), testFile); |
|
63 } |
57 |
64 |
58 List<String> cmdsList = new ArrayList<>(); |
65 List<String> cmdsList = new ArrayList<>(); |
59 |
66 |
60 // Repack file to get the Java-based result |
67 // Repack file to get the Java-based result |
61 cmdsList.add(Utils.getPack200Cmd()); |
68 cmdsList.add(Utils.getPack200Cmd()); |