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

Execute test plan with the deployment classloader as the TCCL #24440

Merged
merged 1 commit into from
Mar 22, 2022
Merged
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 @@ -195,6 +195,7 @@ public FilterResult apply(TestDescriptor testDescriptor) {
return new Runnable() {
@Override
public void run() {
final ClassLoader origCl = Thread.currentThread().getContextClassLoader();
try {
synchronized (JunitTestRunner.this) {
testsRunning = true;
Expand Down Expand Up @@ -222,6 +223,8 @@ public void quarkusStarting() {

Map<String, Map<UniqueId, TestResult>> resultsByClass = new HashMap<>();
AtomicReference<TestIdentifier> currentNonDynamicTest = new AtomicReference<>();

Thread.currentThread().setContextClassLoader(tcl);
launcher.execute(testPlan, new TestExecutionListener() {

@Override
Expand Down Expand Up @@ -396,6 +399,7 @@ public void reportingEntryPublished(TestIdentifier testIdentifier, ReportEntry e
throw new RuntimeException(e);
}
} finally {
Thread.currentThread().setContextClassLoader(origCl);
synchronized (JunitTestRunner.this) {
testsRunning = false;
if (aborted) {
Expand Down