diff --git a/core/test-extension/deployment/src/test/java/io/quarkus/extest/AdditionalLocationsTest.java b/core/test-extension/deployment/src/test/java/io/quarkus/extest/AdditionalLocationsTest.java index 79df8c730296c..e66a4cf5f2ecf 100644 --- a/core/test-extension/deployment/src/test/java/io/quarkus/extest/AdditionalLocationsTest.java +++ b/core/test-extension/deployment/src/test/java/io/quarkus/extest/AdditionalLocationsTest.java @@ -2,6 +2,9 @@ import static org.hamcrest.core.Is.is; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; @@ -14,6 +17,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import io.quarkus.deployment.util.FileUtil; import io.quarkus.runtime.StartupEvent; import io.quarkus.test.QuarkusDevModeTest; import io.restassured.RestAssured; @@ -24,11 +28,21 @@ public class AdditionalLocationsTest { @RegisterExtension static final QuarkusDevModeTest TEST = new QuarkusDevModeTest() - .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(DevBean.class) - .addAsResource(new StringAsset("quarkus.config.locations=additional.properties\n"), - "application.properties") - .addAsResource(new StringAsset("additional.property=1234\n"), "additional.properties")); + .setArchiveProducer(() -> { + try { + String props = new String(FileUtil.readFileContents( + AdditionalLocationsTest.class.getClassLoader().getResourceAsStream("application.properties")), + StandardCharsets.UTF_8); + + return ShrinkWrap.create(JavaArchive.class) + .addClasses(DevBean.class) + .addAsResource(new StringAsset(props + "\nquarkus.config.locations=additional.properties\n"), + "application.properties") + .addAsResource(new StringAsset("additional.property=1234\n"), "additional.properties"); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); @BeforeAll static void beforeAll() { diff --git a/core/test-extension/runtime/src/main/java/io/quarkus/extest/runtime/beans/PublicKeyProducer.java b/core/test-extension/runtime/src/main/java/io/quarkus/extest/runtime/beans/PublicKeyProducer.java index 5205b926dca7b..37a5f231aa419 100644 --- a/core/test-extension/runtime/src/main/java/io/quarkus/extest/runtime/beans/PublicKeyProducer.java +++ b/core/test-extension/runtime/src/main/java/io/quarkus/extest/runtime/beans/PublicKeyProducer.java @@ -24,7 +24,7 @@ public DSAPublicKey getPublicKey() { } public void setPublicKey(DSAPublicKey publicKey) { - log.infof("setPublicKey, key=%s", publicKey); + log.debugf("setPublicKey, key=%s", publicKey); this.publicKey = publicKey; } } diff --git a/extensions/grpc/deployment/src/test/java/io/quarkus/grpc/server/GrpcReflectionTest.java b/extensions/grpc/deployment/src/test/java/io/quarkus/grpc/server/GrpcReflectionTest.java index d1af485e8a8d3..65103641f1bef 100644 --- a/extensions/grpc/deployment/src/test/java/io/quarkus/grpc/server/GrpcReflectionTest.java +++ b/extensions/grpc/deployment/src/test/java/io/quarkus/grpc/server/GrpcReflectionTest.java @@ -51,6 +51,7 @@ public class GrpcReflectionTest { .addPackage(HealthGrpc.class.getPackage()) .addPackage(MutinyReflectableServiceGrpc.class.getPackage()) .addClass(MyReflectionService.class)) + .setFlatClassPath(true) .withConfigurationResource("reflection-config.properties"); @Inject diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/CuratedApplication.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/CuratedApplication.java index 1ec95f0e26753..567117ec9057c 100644 --- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/CuratedApplication.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/CuratedApplication.java @@ -216,6 +216,10 @@ public synchronized QuarkusClassLoader getBaseRuntimeClassLoader() { for (Path root : quarkusBootstrap.getApplicationRoot()) { builder.addElement(ClassPathElement.fromPath(root)); } + } else { + for (Path root : quarkusBootstrap.getApplicationRoot()) { + builder.addBannedElement(ClassPathElement.fromPath(root)); + } } //additional user class path elements first @@ -228,6 +232,7 @@ public synchronized QuarkusClassLoader getBaseRuntimeClassLoader() { } else { for (Path root : i.getArchivePath()) { hotReloadPaths.add(root); + builder.addBannedElement(ClassPathElement.fromPath(root)); } } } diff --git a/integration-tests/grpc-health/src/test/java/io/quarkus/grpc/health/MicroProfileHealthEnabledTest.java b/integration-tests/grpc-health/src/test/java/io/quarkus/grpc/health/MicroProfileHealthEnabledTest.java index e65209d009b56..5ab17ffb4b1b1 100644 --- a/integration-tests/grpc-health/src/test/java/io/quarkus/grpc/health/MicroProfileHealthEnabledTest.java +++ b/integration-tests/grpc-health/src/test/java/io/quarkus/grpc/health/MicroProfileHealthEnabledTest.java @@ -49,10 +49,12 @@ public class MicroProfileHealthEnabledTest { @RegisterExtension - static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer( - () -> ShrinkWrap.create(JavaArchive.class) - .addPackage(HealthGrpc.class.getPackage()) - .addClass(FakeService.class)) + static final QuarkusUnitTest config = new QuarkusUnitTest() + .setFlatClassPath(true) + .setArchiveProducer( + () -> ShrinkWrap.create(JavaArchive.class) + .addPackage(HealthGrpc.class.getPackage()) + .addClass(FakeService.class)) .withConfigurationResource("health-config.properties"); @Inject diff --git a/integration-tests/kafka-avro-apicurio2/src/main/resources/application.properties b/integration-tests/kafka-avro-apicurio2/src/main/resources/application.properties index 1713f0b4061ea..e22c540faa69d 100644 --- a/integration-tests/kafka-avro-apicurio2/src/main/resources/application.properties +++ b/integration-tests/kafka-avro-apicurio2/src/main/resources/application.properties @@ -3,8 +3,4 @@ quarkus.log.category.\"org.apache.kafka\".level=WARN quarkus.log.category.\"org.apache.zookeeper\".level=WARN # enable health check -quarkus.kafka.health.enabled=true - -# TODO: this should not be needed, but Avro does not seem to use the correct CL -# This will also cause dev mode issues -quarkus.test.flat-class-path=true +quarkus.kafka.health.enabled=true \ No newline at end of file diff --git a/integration-tests/kafka-avro/src/main/resources/application.properties b/integration-tests/kafka-avro/src/main/resources/application.properties index 46d8f7f298d32..e22c540faa69d 100644 --- a/integration-tests/kafka-avro/src/main/resources/application.properties +++ b/integration-tests/kafka-avro/src/main/resources/application.properties @@ -3,8 +3,4 @@ quarkus.log.category.\"org.apache.kafka\".level=WARN quarkus.log.category.\"org.apache.zookeeper\".level=WARN # enable health check -quarkus.kafka.health.enabled=true - -# TODO: this should not be needed, but Avro does not seem to use the correct CL -# This will also cause dev mode issues -quarkus.test.flat-class-path=true \ No newline at end of file +quarkus.kafka.health.enabled=true \ No newline at end of file diff --git a/tcks/microprofile-rest-client-reactive/src/test/java/io/quarkus/tck/restclient/RestClientProcessor.java b/tcks/microprofile-rest-client-reactive/src/test/java/io/quarkus/tck/restclient/RestClientProcessor.java index 47cddf6d3fc00..0b9eee3b72eb9 100644 --- a/tcks/microprofile-rest-client-reactive/src/test/java/io/quarkus/tck/restclient/RestClientProcessor.java +++ b/tcks/microprofile-rest-client-reactive/src/test/java/io/quarkus/tck/restclient/RestClientProcessor.java @@ -2,6 +2,7 @@ import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; import org.jboss.arquillian.test.spi.TestClass; +import org.jboss.arquillian.testng.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.container.ClassContainer; @@ -29,7 +30,7 @@ public void process(Archive applicationArchive, TestClass testClass) { if (ClassContainer.class.isInstance(applicationArchive) && testClass.getJavaClass().getSuperclass() != null) { ClassContainer classContainer = ClassContainer.class.cast(applicationArchive); Class clazz = testClass.getJavaClass().getSuperclass(); - while (clazz != Object.class && clazz != null) { + while (clazz != Object.class && clazz != null && clazz != Arquillian.class) { classContainer.addClass(clazz); clazz = clazz.getSuperclass(); } diff --git a/tcks/microprofile-rest-client/src/test/java/io/quarkus/tck/restclient/RestClientProcessor.java b/tcks/microprofile-rest-client/src/test/java/io/quarkus/tck/restclient/RestClientProcessor.java index 47cddf6d3fc00..0b9eee3b72eb9 100644 --- a/tcks/microprofile-rest-client/src/test/java/io/quarkus/tck/restclient/RestClientProcessor.java +++ b/tcks/microprofile-rest-client/src/test/java/io/quarkus/tck/restclient/RestClientProcessor.java @@ -2,6 +2,7 @@ import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; import org.jboss.arquillian.test.spi.TestClass; +import org.jboss.arquillian.testng.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.container.ClassContainer; @@ -29,7 +30,7 @@ public void process(Archive applicationArchive, TestClass testClass) { if (ClassContainer.class.isInstance(applicationArchive) && testClass.getJavaClass().getSuperclass() != null) { ClassContainer classContainer = ClassContainer.class.cast(applicationArchive); Class clazz = testClass.getJavaClass().getSuperclass(); - while (clazz != Object.class && clazz != null) { + while (clazz != Object.class && clazz != null && clazz != Arquillian.class) { classContainer.addClass(clazz); clazz = clazz.getSuperclass(); } diff --git a/test-framework/arquillian/src/main/java/io/quarkus/arquillian/QuarkusDeployableContainer.java b/test-framework/arquillian/src/main/java/io/quarkus/arquillian/QuarkusDeployableContainer.java index 513b469de8bfb..2c5f3ebbb5aeb 100644 --- a/test-framework/arquillian/src/main/java/io/quarkus/arquillian/QuarkusDeployableContainer.java +++ b/test-framework/arquillian/src/main/java/io/quarkus/arquillian/QuarkusDeployableContainer.java @@ -179,6 +179,7 @@ public void execute(BuildContext context) { .setApplicationRoot(appLocation) .setProjectRoot(appLocation) .setIsolateDeployment(false) + .setFlatClassPath(true) .setMode(QuarkusBootstrap.Mode.TEST); for (Path i : libraries) { bootstrapBuilder.addAdditionalApplicationArchive(new AdditionalDependency(i, false, true));