mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 08:41:22 +00:00
Make sure TCCL is correct for outer test class
We still need to create an instance of the original test, make sure the TCCL is correct to avoid problems
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package io.quarkus.it.jsonb;
|
||||
|
||||
import javax.json.bind.spi.JsonbProvider;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
|
||||
@QuarkusTest
|
||||
class JsonInStaticBlockTestCase {
|
||||
static {
|
||||
JsonbProvider.provider().create();
|
||||
}
|
||||
|
||||
@Test
|
||||
void get() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -252,7 +252,14 @@ public class QuarkusTestExtension
|
||||
if (isNativeTest(extensionContext)) {
|
||||
return invocation.proceed();
|
||||
}
|
||||
T result = invocation.proceed();
|
||||
T result;
|
||||
ClassLoader old = Thread.currentThread().getContextClassLoader();
|
||||
try {
|
||||
Thread.currentThread().setContextClassLoader(extensionContext.getRequiredTestClass().getClassLoader());
|
||||
result = invocation.proceed();
|
||||
} finally {
|
||||
Thread.currentThread().setContextClassLoader(old);
|
||||
}
|
||||
ExtensionState state = ensureStarted(extensionContext);
|
||||
initTestState(extensionContext, state);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user