Skip to content
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

[WFCORE-7130] Enhancing CLI tests to don't fail on JDK24+ when JDK warning is being printed #6315

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ public void testMisspelledParameter() throws Exception {
String output = cli.getOutput();
try (BufferedReader reader = new BufferedReader(new StringReader(output))) {
String line = reader.readLine();
// WFCORE-7130 workaround
if (Runtime.version().feature() >= 24) {
// Ignore JDK warnings about sun.misc.Unsafe deprecated method usages on JDK24+
while (line.contains("WARNING: ")) {
line = reader.readLine();
}
}
while (line.contains("Picked up JDK_JAVA_OPTIONS:") || line.contains("Picked up JAVA_TOOL_OPTIONS:")) {
line = reader.readLine();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ public void longCommand() throws Exception {
String printableChars = Parser.stripAwayAnsiCodes(cli.getOutput());
try (BufferedReader reader = new BufferedReader(new StringReader(printableChars))) {
String line = reader.readLine();
// WFCORE-7130 workaround
if (Runtime.version().feature() >= 24) {
// Ignore JDK warnings about sun.misc.Unsafe deprecated method usages on JDK24+
while (line.contains("WARNING: ")) {
line = reader.readLine();
}
}
while (line.contains("Picked up JDK_JAVA_OPTIONS:") || line.contains("Picked up JAVA_TOOL_OPTIONS:")) {
line = reader.readLine();
}
Expand Down
Loading