Skip to content

Commit 24c5ff7

Browse files
committed
8346871: Improve robustness of java/util/zip/EntryCount64k.java test
Reviewed-by: lancea
1 parent bd0fde7 commit 24c5ff7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/jdk/java/util/zip/EntryCount64k.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2013 Google Inc. All rights reserved.
3+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
34
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45
*
56
* This code is free software; you can redistribute it and/or modify it
@@ -47,9 +48,12 @@
4748
import jdk.test.lib.process.ProcessTools;
4849

4950
public class EntryCount64k {
51+
52+
private static final String MAIN_CLASS_MSG = "foo bar hello world Main";
53+
5054
public static class Main {
5155
public static void main(String[] args) {
52-
System.out.print("Main");
56+
System.out.println(MAIN_CLASS_MSG);
5357
}
5458
}
5559

@@ -162,7 +166,10 @@ static void checkCanRead(File zipFile, int entryCount) throws Throwable {
162166
// Check java -jar
163167
OutputAnalyzer a = ProcessTools.executeTestJava("-jar", zipFile.getName());
164168
a.shouldHaveExitValue(0);
165-
a.stdoutShouldMatch("\\AMain\\Z");
169+
// expect the message from the application on stdout
170+
a.stdoutContains(MAIN_CLASS_MSG);
171+
// nothing is expected on stderr (apart from any probable deprecation
172+
// warnings from the launcher/JVM)
166173
a.stderrShouldMatchIgnoreDeprecatedWarnings("\\A\\Z");
167174
}
168175
}

0 commit comments

Comments
 (0)