1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* 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 {
54
54
"-Duser.language=en" , "-Duser.country=US" , className );
55
55
OutputAnalyzer output = new OutputAnalyzer (pb .start ());
56
56
output .shouldNotContain ("java.lang.ClassFormatError" );
57
- output .shouldContain ("Main method not found in class " + className );
58
57
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
+ }
59
64
60
65
// Test case #2:
61
66
// Try loading class with empty bootstrap_methods table where an
@@ -69,7 +74,12 @@ public static void main(String args[]) throws Throwable {
69
74
"-Duser.language=en" , "-Duser.country=US" , className );
70
75
output = new OutputAnalyzer (pb .start ());
71
76
output .shouldNotContain ("java.lang.ClassFormatError" );
72
- output .shouldContain ("Main method not found in class " + className );
73
77
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
+ }
74
84
}
75
85
}
0 commit comments