From 872717bff198fe565ae1be6e40ae841fce236964 Mon Sep 17 00:00:00 2001 From: Alexey Loubyansky Date: Thu, 25 Jan 2024 14:29:00 +0100 Subject: [PATCH] test wip --- .../java/io/quarkus/maven/it/DevMojoIT.java | 14 +++ .../common-transitive/pom.xml | 21 ++++ .../java/org/acme/CommonTransitiveBean.java | 7 ++ .../src/main/resources/META-INF/beans.xml | 0 .../common/pom.xml | 20 ++++ .../src/main/java/org/acme/CommonBean.java | 13 +++ .../src/main/resources/META-INF/beans.xml | 0 .../library/pom.xml | 20 ++++ .../src/main/java/org/acme/LibraryBean.java | 13 +++ .../src/main/resources/META-INF/beans.xml | 0 .../non-reloadable-contagiousness/pom.xml | 81 +++++++++++++ .../runner/pom.xml | 110 ++++++++++++++++++ .../src/main/java/org/acme/HelloResource.java | 39 +++++++ .../src/main/java/org/acme/MyApplication.java | 9 ++ .../src/main/resources/application.properties | 1 + 15 files changed, 348 insertions(+) create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/pom.xml create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/src/main/java/org/acme/CommonTransitiveBean.java create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/src/main/resources/META-INF/beans.xml create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/pom.xml create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/src/main/java/org/acme/CommonBean.java create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/src/main/resources/META-INF/beans.xml create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/pom.xml create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/src/main/java/org/acme/LibraryBean.java create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/src/main/resources/META-INF/beans.xml create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/pom.xml create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/pom.xml create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/java/org/acme/HelloResource.java create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/java/org/acme/MyApplication.java create mode 100644 integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/resources/application.properties diff --git a/integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java b/integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java index 7a85f94972362..50081654f2a88 100644 --- a/integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java +++ b/integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java @@ -544,6 +544,20 @@ public void testThatTheApplicationIsReloadedOnPomChange() throws MavenInvocation .until(() -> devModeClient.getHttpResponse("/q/openapi").contains("hello")); } + @Test + public void testNonReloadableContagiousness() throws MavenInvocationException, IOException { + testDir = getTargetDir("projects/non-reloadable-contagiousness"); + run(true); + String greeting = devModeClient.getHttpResponse("/app/hello"); + assertThat(greeting).contains("hello"); + + final List artifacts = getNonReloadableArtifacts( + Files.readAllLines(testDir.toPath().resolve("build-non-reloadable-contagiousness.log"))); + assertTrue(artifacts.contains("- org.acme:acme-common:1.0-SNAPSHOT")); + assertTrue(artifacts.contains("- org.acme:acme-common-transitive:1.0-SNAPSHOT")); + assertEquals(4, artifacts.size()); + } + @Test public void testProjectWithExtension() throws MavenInvocationException, IOException { testDir = getTargetDir("projects/project-with-extension"); diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/pom.xml new file mode 100644 index 0000000000000..f91e0627c2cbb --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + org.acme + quarkus-quickstart-multimodule-parent + 1.0-SNAPSHOT + + + org.acme + acme-common-transitive + 1.0-SNAPSHOT + + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/src/main/java/org/acme/CommonTransitiveBean.java b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/src/main/java/org/acme/CommonTransitiveBean.java new file mode 100644 index 0000000000000..85883cb13572a --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/src/main/java/org/acme/CommonTransitiveBean.java @@ -0,0 +1,7 @@ +package org.acme; + +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class CommonTransitiveBean { +} diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/src/main/resources/META-INF/beans.xml b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common-transitive/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/pom.xml new file mode 100644 index 0000000000000..386b8c583c607 --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + + org.acme + quarkus-quickstart-multimodule-parent + 1.0-SNAPSHOT + + org.acme + acme-common + 1.0-SNAPSHOT + + + + org.acme + acme-common-transitive + + + diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/src/main/java/org/acme/CommonBean.java b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/src/main/java/org/acme/CommonBean.java new file mode 100644 index 0000000000000..8dd748be19a5b --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/src/main/java/org/acme/CommonBean.java @@ -0,0 +1,13 @@ +package org.acme; + +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class CommonBean { + + private final CommonTransitiveBean bean; + + public CommonBean(CommonTransitiveBean bean) { + this.bean = java.util.Objects.requireNonNull(bean); + } +} diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/src/main/resources/META-INF/beans.xml b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/common/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/pom.xml new file mode 100644 index 0000000000000..00924ba037e02 --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + + org.acme + quarkus-quickstart-multimodule-parent + 1.0-SNAPSHOT + + org.acme + acme-library + 1.0-SNAPSHOT + + + + org.acme + acme-common-transitive + + + diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/src/main/java/org/acme/LibraryBean.java b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/src/main/java/org/acme/LibraryBean.java new file mode 100644 index 0000000000000..7e801d7ef8f5c --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/src/main/java/org/acme/LibraryBean.java @@ -0,0 +1,13 @@ +package org.acme; + +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class LibraryBean { + + private final CommonTransitiveBean bean; + + public LibraryBean(CommonTransitiveBean bean) { + this.bean = java.util.Objects.requireNonNull(bean); + } +} diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/src/main/resources/META-INF/beans.xml b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/library/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/pom.xml new file mode 100644 index 0000000000000..42b933395fb7d --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + + org.acme + quarkus-quickstart-multimodule-parent + 1.0-SNAPSHOT + pom + + + io.quarkus + quarkus-bom + @project.version@ + @project.version@ + ${compiler-plugin.version} + ${version.surefire.plugin} + ${maven.compiler.source} + ${maven.compiler.target} + UTF-8 + + + common + common-transitive + library + runner + + + + + + + maven-compiler-plugin + \${compiler-plugin.version} + + + -parameters + + + + + io.quarkus + quarkus-maven-plugin + \${quarkus-plugin.version} + + + + + + + + + \${quarkus.platform.group-id} + \${quarkus.platform.artifact-id} + \${quarkus.platform.version} + pom + import + + + org.acme + acme-common-transitive + 1.0-SNAPSHOT + + + org.acme + acme-common + 1.0-SNAPSHOT + + + org.acme + acme-library + 1.0-SNAPSHOT + + + org.acme + acme-quarkus-ext + 1.0-SNAPSHOT + + + + + diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/pom.xml new file mode 100644 index 0000000000000..25f393b1d0f53 --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/pom.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + + org.acme + quarkus-quickstart-multimodule-parent + 1.0-SNAPSHOT + + org.acme + quarkus-quickstart-multimodule-main + 1.0-SNAPSHOT + + + + + io.quarkus + quarkus-resteasy + + + org.acme + acme-common + + + org.acme + acme-library + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + + + + + maven-surefire-plugin + \${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + \${maven.home} + + + + + io.quarkus + quarkus-maven-plugin + \${quarkus-plugin.version} + + + + build + + + + + + + + + + + native + + + native + + + + native + + + + + org.apache.maven.plugins + maven-surefire-plugin + + \${native.surefire.skip} + + + + maven-failsafe-plugin + \${surefire-plugin.version} + + + + integration-test + verify + + + + \${project.build.directory}/\${project.build.finalName}-runner + org.jboss.logmanager.LogManager + \${maven.home} + + + + + + + + + + diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/java/org/acme/HelloResource.java b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/java/org/acme/HelloResource.java new file mode 100644 index 0000000000000..87a4c9a6a95cf --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/java/org/acme/HelloResource.java @@ -0,0 +1,39 @@ +package org.acme; + +import org.eclipse.microprofile.config.inject.ConfigProperty; + + +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Path("/hello") +public class HelloResource { + + final CommonBean common; + final LibraryBean library; + + @Inject + @ConfigProperty(name = "greeting") + String greeting; + + public HelloResource(CommonBean common, LibraryBean library) { + this.common = java.util.Objects.requireNonNull(common); + this.library = java.util.Objects.requireNonNull(library); + } + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String hello() { + return "hello"; + } + + @GET + @Path("/greeting") + @Produces(MediaType.TEXT_PLAIN) + public String greeting() { + return greeting; + } +} diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/java/org/acme/MyApplication.java b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/java/org/acme/MyApplication.java new file mode 100644 index 0000000000000..a6d66f8b9eda2 --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/java/org/acme/MyApplication.java @@ -0,0 +1,9 @@ +package org.acme; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +@ApplicationPath("/app") +public class MyApplication extends Application { + +} diff --git a/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/resources/application.properties b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/resources/application.properties new file mode 100644 index 0000000000000..6926cb19f372a --- /dev/null +++ b/integration-tests/maven/src/test/resources-filtered/projects/non-reloadable-contagiousness/runner/src/main/resources/application.properties @@ -0,0 +1 @@ +greeting=bonjour \ No newline at end of file