提交 ba8e9c24 编写于 作者: S sherman

8006773: test/java/util/zip/ZipFile/FinalizeZipFile.java failing intermittently

Summary: fixed the test case
Reviewed-by: alanb
上级 15d949f3
...@@ -67,9 +67,14 @@ public class FinalizeZipFile { ...@@ -67,9 +67,14 @@ public class FinalizeZipFile {
new InstrumentedZipFile(jars[rnd.nextInt(jars.length)]).close(); new InstrumentedZipFile(jars[rnd.nextInt(jars.length)]).close();
// Create a ZipFile and get an input stream from it // Create a ZipFile and get an input stream from it
ZipFile zf = new InstrumentedZipFile(jars[rnd.nextInt(jars.length)]); for (int i = 0; i < jars.length + 10; i++) {
ZipEntry ze = zf.getEntry("META-INF/MANIFEST.MF"); ZipFile zf = new InstrumentedZipFile(jars[rnd.nextInt(jars.length)]);
InputStream is = zf.getInputStream(ze); ZipEntry ze = zf.getEntry("META-INF/MANIFEST.MF");
if (ze != null) {
InputStream is = zf.getInputStream(ze);
break;
}
}
} }
public static void realMain(String[] args) throws Throwable { public static void realMain(String[] args) throws Throwable {
...@@ -97,4 +102,3 @@ public class FinalizeZipFile { ...@@ -97,4 +102,3 @@ public class FinalizeZipFile {
System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
if (failed > 0) throw new AssertionError("Some tests failed");} if (failed > 0) throw new AssertionError("Some tests failed");}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册