diff --git a/test-framework/junit5-config/src/main/java/io/quarkus/test/config/QuarkusClassOrderer.java b/test-framework/junit5-config/src/main/java/io/quarkus/test/config/QuarkusClassOrderer.java index 857c13a842548..38e4b2d408602 100644 --- a/test-framework/junit5-config/src/main/java/io/quarkus/test/config/QuarkusClassOrderer.java +++ b/test-framework/junit5-config/src/main/java/io/quarkus/test/config/QuarkusClassOrderer.java @@ -3,9 +3,7 @@ import org.eclipse.microprofile.config.ConfigProvider; import org.junit.jupiter.api.ClassOrderer; import org.junit.jupiter.api.ClassOrdererContext; -import org.junit.platform.commons.util.ReflectionUtils; -import io.quarkus.deployment.dev.testing.TestConfig; import io.smallrye.config.SmallRyeConfig; /** @@ -16,15 +14,22 @@ public class QuarkusClassOrderer implements ClassOrderer { private final ClassOrderer delegate; public QuarkusClassOrderer() { + System.out.println("HOLLY class orderer TCCL is " + Thread.currentThread().getContextClassLoader()); + System.out.println("HOLLY I AM " + this.getClass().getClassLoader()); + ClassLoader original = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); SmallRyeConfig config = ConfigProvider.getConfig().unwrap(SmallRyeConfig.class); - TestConfig testConfig = config.getConfigMapping(TestConfig.class); - - delegate = testConfig.classOrderer() - .map(klass -> ReflectionUtils.tryToLoadClass(klass) - .andThenTry(ReflectionUtils::newInstance) - .andThenTry(instance -> (ClassOrderer) instance) - .toOptional().orElse(EMPTY)) - .orElse(EMPTY); + // TODO obviously a bad idea, diagnostic + delegate = EMPTY; + // TestConfig testConfig = config.getConfigMapping(TestConfig.class); + // + // delegate = testConfig.classOrderer() + // .map(klass -> ReflectionUtils.tryToLoadClass(klass) + // .andThenTry(ReflectionUtils::newInstance) + // .andThenTry(instance -> (ClassOrderer) instance) + // .toOptional().orElse(EMPTY)) + // .orElse(EMPTY); + Thread.currentThread().setContextClassLoader(original); } @Override