Skip to content

8346871: Improve robustness of java/util/zip/EntryCount64k.java test #3651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: pr/3649
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions test/jdk/java/util/zip/EntryCount64k.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013 Google Inc. All rights reserved.
* Copyright (c) 2024, 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
Expand Down Expand Up @@ -47,9 +48,12 @@
import jdk.test.lib.process.ProcessTools;

public class EntryCount64k {

private static final String MAIN_CLASS_MSG = "foo bar hello world Main";

public static class Main {
public static void main(String[] args) {
System.out.print("Main");
System.out.println(MAIN_CLASS_MSG);
}
}

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