Skip to content

Commit bddda4e

Browse files
authored
Merge pull request #50770 from gsmet/add-more-cl-info
Add more information when class loader issue in tests
2 parents b82e4d7 + 40d1c57 commit bddda4e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test-framework/junit5/src/main/java/io/quarkus/test/junit/AbstractJvmQuarkusTestExtension.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,17 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
192192

193193
}
194194
log.debug("Underlying exception: " + e);
195-
log.debug("Thread Context Classloader: " + Thread.currentThread().getContextClassLoader());
196-
log.debug("The class of the class we use for mapping is " + TestConfig.class.getClassLoader());
195+
log.debug("Thread Context ClassLoader: " + Thread.currentThread().getContextClassLoader());
196+
log.debug("The classloader of the class we use for mapping is " + TestConfig.class.getClassLoader());
197197
String message = isVSCode || isMaybeVSCode
198198
? "Could not execute test class because it was loaded with the wrong classloader by the VS Code test runner. Try running test methods individually instead."
199199
: isEclipse
200200
? "Could not execute test class because it was loaded with the wrong classloader by the Eclipse test runner. Try running test methods individually, or edit the run configuration and add `-uniqueId [engine:junit-jupiter]/[class:"
201201
+ context.getRequiredTestClass().getName()
202202
+ "]` in the program arguments. "
203-
: "Internal error: Test class was loaded with an unexpected classloader or the thread context classloader was incorrect.";
203+
: "Internal error: Test class was loaded with an unexpected classloader ("
204+
+ TestConfig.class.getClassLoader() + ") or the thread context classloader ("
205+
+ Thread.currentThread().getContextClassLoader() + ") was incorrect.";
204206
throw new IllegalStateException(message, e);
205207
} finally {
206208
if (!isFlatClasspath) {

0 commit comments

Comments
 (0)