11/*
2- * Copyright (c) 2014, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2014, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -54,8 +54,13 @@ public static void main(String args[]) throws Throwable {
5454 "-Duser.language=en" , "-Duser.country=US" , className );
5555 OutputAnalyzer output = new OutputAnalyzer (pb .start ());
5656 output .shouldNotContain ("java.lang.ClassFormatError" );
57- output .shouldContain ("Main method not found in class " + className );
5857 output .shouldHaveExitValue (1 );
58+ boolean vthreadMode = pb .command ().toString ().contains ("test.thread.factory=Virtual" );
59+ if (vthreadMode ) {
60+ output .shouldContain ("java.lang.NoSuchMethodException: " + className + ".main" );
61+ } else {
62+ output .shouldContain ("Main method not found in class " + className );
63+ }
5964
6065 // Test case #2:
6166 // Try loading class with empty bootstrap_methods table where an
@@ -69,7 +74,12 @@ public static void main(String args[]) throws Throwable {
6974 "-Duser.language=en" , "-Duser.country=US" , className );
7075 output = new OutputAnalyzer (pb .start ());
7176 output .shouldNotContain ("java.lang.ClassFormatError" );
72- output .shouldContain ("Main method not found in class " + className );
7377 output .shouldHaveExitValue (1 );
78+ vthreadMode = pb .command ().toString ().contains ("test.thread.factory=Virtual" );
79+ if (vthreadMode ) {
80+ output .shouldContain ("java.lang.NoSuchMethodException: " + className + ".main" );
81+ } else {
82+ output .shouldContain ("Main method not found in class " + className );
83+ }
7484 }
7585}
0 commit comments