27 import java.util.Arrays; |
27 import java.util.Arrays; |
28 import java.util.List; |
28 import java.util.List; |
29 import static java.nio.file.StandardOpenOption.*; |
29 import static java.nio.file.StandardOpenOption.*; |
30 /* |
30 /* |
31 * @test |
31 * @test |
32 * @bug 6746111 8005252 |
32 * @bug 6746111 8005252 8008262 |
33 * @summary tests various classfile format and attribute handling by pack200 |
33 * @summary tests various classfile format and attribute handling by pack200 |
34 * @compile -XDignore.symbol.file Utils.java AttributeTests.java |
34 * @compile -XDignore.symbol.file Utils.java AttributeTests.java |
35 * @run main AttributeTests |
35 * @run main AttributeTests |
36 * @author ksrini |
36 * @author ksrini |
37 */ |
37 */ |
65 |
65 |
66 // jar the file up |
66 // jar the file up |
67 File testjarFile = new File(cwd, "test" + Utils.JAR_FILE_EXT); |
67 File testjarFile = new File(cwd, "test" + Utils.JAR_FILE_EXT); |
68 Utils.jar("cvf", testjarFile.getName(), javaClassName); |
68 Utils.jar("cvf", testjarFile.getName(), javaClassName); |
69 |
69 |
70 // pack using --repack |
70 // pack using native --repack |
71 File outjarFile = new File(cwd, "out" + Utils.JAR_FILE_EXT); |
71 File nativejarFile = new File(cwd, "out-n" + Utils.JAR_FILE_EXT); |
72 scratch.clear(); |
72 Utils.repack(testjarFile, nativejarFile, false, |
73 scratch.add(Utils.getPack200Cmd()); |
73 "--unknown-attribute=error"); |
74 scratch.add("--repack"); |
74 Utils.doCompareVerify(testjarFile, nativejarFile); |
75 scratch.add("--unknown-attribute=error"); |
|
76 scratch.add(outjarFile.getName()); |
|
77 scratch.add(testjarFile.getName()); |
|
78 Utils.runExec(scratch); |
|
79 |
75 |
80 Utils.doCompareVerify(testjarFile, outjarFile); |
76 // pack using java --repack |
|
77 File javajarFile = new File(cwd, "out-j" + Utils.JAR_FILE_EXT); |
|
78 Utils.repack(testjarFile, javajarFile, true, |
|
79 "--unknown-attribute=error"); |
|
80 Utils.doCompareBitWise(nativejarFile, javajarFile); |
81 } |
81 } |
82 /* |
82 /* |
83 * this test checks to see if we get the expected strings for output |
83 * this test checks to see if we get the expected strings for output |
84 */ |
84 */ |
85 static void test6746111() throws Exception { |
85 static void test6746111() throws Exception { |