Skip to content
Closed
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
1 change: 0 additions & 1 deletion test/hotspot/jtreg/ProblemList-Virtual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemor

gc/arguments/TestNewSizeThreadIncrease.java 0000000 generic-all
gc/g1/TestSkipRebuildRemsetPhase.java 0000000 generic-all
runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java 8346442 generic-all
runtime/ErrorHandling/MachCodeFramesInErrorFile.java 0000000 generic-all
runtime/logging/LoaderConstraintsTest.java 8346442 generic-all
runtime/Thread/AsyncExceptionOnMonitorEnter.java 0000000 generic-all
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2025, 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 @@ -54,8 +54,13 @@ public static void main(String args[]) throws Throwable {
"-Duser.language=en", "-Duser.country=US", className);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldNotContain("java.lang.ClassFormatError");
output.shouldContain("Main method not found in class " + className);
output.shouldHaveExitValue(1);
boolean vthreadMode = pb.command().toString().contains("test.thread.factory=Virtual");
if (vthreadMode) {
output.shouldContain("java.lang.NoSuchMethodException: " + className + ".main");
} else {
output.shouldContain("Main method not found in class " + className);
}

// Test case #2:
// Try loading class with empty bootstrap_methods table where an
Expand All @@ -69,7 +74,12 @@ public static void main(String args[]) throws Throwable {
"-Duser.language=en", "-Duser.country=US", className);
output = new OutputAnalyzer(pb.start());
output.shouldNotContain("java.lang.ClassFormatError");
output.shouldContain("Main method not found in class " + className);
output.shouldHaveExitValue(1);
vthreadMode = pb.command().toString().contains("test.thread.factory=Virtual");
if (vthreadMode) {
output.shouldContain("java.lang.NoSuchMethodException: " + className + ".main");
} else {
output.shouldContain("Main method not found in class " + className);
}
}
}