8079769: tools/pack200/PackTestZip64.java may timeout at preparing the large test file

Reviewed-by: ksrini
This commit is contained in:
Amy Lu 2015-08-13 09:35:45 +03:00
parent ec15b70de5
commit 48b997d5b3
2 changed files with 44 additions and 4 deletions

View file

@ -37,10 +37,13 @@ import java.util.zip.ZipEntry;
* @compile -XDignore.symbol.file Utils.java PackTestZip64.java * @compile -XDignore.symbol.file Utils.java PackTestZip64.java
* @run main PackTestZip64 * @run main PackTestZip64
* @author kizune * @author kizune
* @key intermittent
*/ */
public class PackTestZip64 { public class PackTestZip64 {
private static final boolean bigJarEnabled
= Boolean.getBoolean("PackTestZip64.enableBigJar");
public static void main(String... args) throws Exception { public static void main(String... args) throws Exception {
testPacking(); testPacking();
Utils.cleanup(); Utils.cleanup();
@ -50,10 +53,14 @@ public class PackTestZip64 {
private static final byte[] BUFFER = new byte[1024]; private static final byte[] BUFFER = new byte[1024];
static void testPacking() throws IOException { static void testPacking() throws IOException {
// make a copy of the test specimen to local directory
File testFile = new File("tools_java.jar"); File testFile = new File("tools_java.jar");
if (bigJarEnabled) {
// Add a large number of small files to the golden jar // Add a large number of small files to the golden jar
generateLargeJar(testFile, Utils.getGoldenJar()); generateLargeJar(testFile, Utils.getGoldenJar());
} else {
// make a copy of the test specimen to local directory
Utils.copyFile(Utils.getGoldenJar(), testFile);
}
List<String> cmdsList = new ArrayList<>(); List<String> cmdsList = new ArrayList<>();

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8029646
* @summary tests that native unpacker produces the same result as Java one
* @compile -XDignore.symbol.file Utils.java PackTestZip64.java
* @run main/manual/othervm -DPackTestZip64.enableBigJar=true PackTestZip64
*/
public class PackTestZip64Manual {
}