From 23a10de9fed02b4507e782c111fc16c82a64d327 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Thu, 9 Jun 2022 22:33:01 -0300 Subject: [PATCH] Revert "Add support for appCds type in QuarkusIntegrationTest" This reverts commit a0f4d30b9925ef73fd196d4a9e2fb5bdf3b77081. --- .../deployment/pkg/steps/AppCDSBuildStep.java | 5 +- .../runner/bootstrap/AugmentActionImpl.java | 9 +- integration-tests/main/pom.xml | 21 ---- .../invoker.properties | 1 - .../it/integration-test-for-appcds/pom.xml | 111 ------------------ .../src/main/java/org/acme/Hello.java | 16 --- .../src/main/resources/application.properties | 1 - .../test/java/org/acme/HelloEndpointIT.java | 20 ---- .../quarkus/test/junit/ArtifactTypeUtil.java | 4 - .../launcher/AppCdsLauncherProvider.java | 29 ----- .../junit/launcher/JarLauncherProvider.java | 12 +- ...st.junit.launcher.ArtifactLauncherProvider | 1 - 12 files changed, 5 insertions(+), 225 deletions(-) delete mode 100644 integration-tests/main/src/it/integration-test-for-appcds/invoker.properties delete mode 100644 integration-tests/main/src/it/integration-test-for-appcds/pom.xml delete mode 100644 integration-tests/main/src/it/integration-test-for-appcds/src/main/java/org/acme/Hello.java delete mode 100644 integration-tests/main/src/it/integration-test-for-appcds/src/main/resources/application.properties delete mode 100644 integration-tests/main/src/it/integration-test-for-appcds/src/test/java/org/acme/HelloEndpointIT.java delete mode 100644 test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/AppCdsLauncherProvider.java diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java index afa39f075f748..06b53d8c64671 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java @@ -7,8 +7,8 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.function.BooleanSupplier; @@ -97,8 +97,7 @@ public void build(Optional appCDsRequested, } appCDS.produce(new AppCDSResultBuildItem(appCDSPath)); - artifactResult.produce(new ArtifactResultBuildItem(appCDSPath, "appCDS", - Map.of("jar-result-path", jarResult.getPath()))); + artifactResult.produce(new ArtifactResultBuildItem(appCDSPath, "appCDS", Collections.emptyMap())); } private String determineContainerImage(PackageConfig packageConfig, diff --git a/core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java b/core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java index 7cccc2f814b5d..02d64f13967b2 100644 --- a/core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java +++ b/core/deployment/src/main/java/io/quarkus/runner/bootstrap/AugmentActionImpl.java @@ -230,15 +230,8 @@ private void writeArtifactResultMetadataFile(BuildSystemTargetBuildItem outputTa Map metadata = lastResult.getMetadata(); if (metadata != null) { for (Map.Entry entry : metadata.entrySet()) { - String value = null; if (entry.getValue() instanceof String) { - value = (String) entry.getValue(); - } else if (entry.getValue() instanceof Path) { - value = outputTargetBuildItem.getOutputDirectory().relativize((Path) entry.getValue()).toString(); - } - - if (value != null) { - properties.put("metadata." + entry.getKey(), value); + properties.put("metadata." + entry.getKey(), entry.getValue()); } } } diff --git a/integration-tests/main/pom.xml b/integration-tests/main/pom.xml index a351165ead783..966356cb77d49 100644 --- a/integration-tests/main/pom.xml +++ b/integration-tests/main/pom.xml @@ -512,27 +512,6 @@ alphabetical - - maven-invoker-plugin - - - integration-tests - - run - verify - - - - - ${project.build.directory}/it - true - setup - verify - true - true - invoker.properties - - diff --git a/integration-tests/main/src/it/integration-test-for-appcds/invoker.properties b/integration-tests/main/src/it/integration-test-for-appcds/invoker.properties deleted file mode 100644 index 1e1d6c337cb30..0000000000000 --- a/integration-tests/main/src/it/integration-test-for-appcds/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean verify diff --git a/integration-tests/main/src/it/integration-test-for-appcds/pom.xml b/integration-tests/main/src/it/integration-test-for-appcds/pom.xml deleted file mode 100644 index 6be3d5ca2b68a..0000000000000 --- a/integration-tests/main/src/it/integration-test-for-appcds/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - 4.0.0 - org.acme - container-build-jib-appcds - 0.1-SNAPSHOT - - UTF-8 - 3.0.0-M5 - 11 - UTF-8 - 11 - - - - - io.quarkus - quarkus-bom - @project.version@ - pom - import - - - - - - io.quarkus - quarkus-resteasy-reactive - - - io.quarkus - quarkus-junit5 - test - - - io.rest-assured - rest-assured - test - - - - - - io.quarkus - quarkus-maven-plugin - @project.version@ - - - - build - - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - - - - - native - - - native - - - - native - - - - - org.apache.maven.plugins - maven-surefire-plugin - - ${native.surefire.skip} - - - - - - - diff --git a/integration-tests/main/src/it/integration-test-for-appcds/src/main/java/org/acme/Hello.java b/integration-tests/main/src/it/integration-test-for-appcds/src/main/java/org/acme/Hello.java deleted file mode 100644 index ad80766a17747..0000000000000 --- a/integration-tests/main/src/it/integration-test-for-appcds/src/main/java/org/acme/Hello.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.acme; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -@Path("/hello") -public class Hello { - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String hello() { - return "hello"; - } -} \ No newline at end of file diff --git a/integration-tests/main/src/it/integration-test-for-appcds/src/main/resources/application.properties b/integration-tests/main/src/it/integration-test-for-appcds/src/main/resources/application.properties deleted file mode 100644 index 4cdd68977f44b..0000000000000 --- a/integration-tests/main/src/it/integration-test-for-appcds/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -quarkus.package.create-appcds=true diff --git a/integration-tests/main/src/it/integration-test-for-appcds/src/test/java/org/acme/HelloEndpointIT.java b/integration-tests/main/src/it/integration-test-for-appcds/src/test/java/org/acme/HelloEndpointIT.java deleted file mode 100644 index e88435b23a561..0000000000000 --- a/integration-tests/main/src/it/integration-test-for-appcds/src/test/java/org/acme/HelloEndpointIT.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.acme; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; - -@QuarkusIntegrationTest -public class HelloEndpointIT { - @Test - public void testListAllFruits() { - given().get("/hello") - .then() - .statusCode(200) - .body(is("hello")); - } -} diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/ArtifactTypeUtil.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/ArtifactTypeUtil.java index 0ee0e6ed1b904..93d76448907a9 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/ArtifactTypeUtil.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/ArtifactTypeUtil.java @@ -16,8 +16,4 @@ public static boolean isNativeBinary(String artifactType) { public static boolean isJar(String artifactType) { return "jar".equals(artifactType); } - - public static boolean isAppCds(String artifactType) { - return "appCDS".equals(artifactType); - } } diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/AppCdsLauncherProvider.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/AppCdsLauncherProvider.java deleted file mode 100644 index 6eca421a12a57..0000000000000 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/AppCdsLauncherProvider.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.quarkus.test.junit.launcher; - -import static io.quarkus.test.junit.ArtifactTypeUtil.isAppCds; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.microprofile.config.Config; - -public class AppCdsLauncherProvider extends JarLauncherProvider { - - @Override - public boolean supportsArtifactType(String type) { - return isAppCds(type); - } - - @Override - protected String getPath(CreateContext context) { - return context.quarkusArtifactProperties().getProperty("metadata.jar-result-path"); - } - - @Override - protected List argLineValue(CreateContext context, Config config) { - List argLines = new ArrayList<>(); - argLines.addAll(super.argLineValue(context, config)); - argLines.add("-XX:SharedArchiveFile=" + context.quarkusArtifactProperties().getProperty("path")); - return argLines; - } -} diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/JarLauncherProvider.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/JarLauncherProvider.java index 81ab347d1f84a..2b90dc993e063 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/JarLauncherProvider.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/JarLauncherProvider.java @@ -27,7 +27,7 @@ public boolean supportsArtifactType(String type) { @Override public JarArtifactLauncher create(CreateContext context) { - String pathStr = getPath(context); + String pathStr = context.quarkusArtifactProperties().getProperty("path"); if ((pathStr != null) && !pathStr.isEmpty()) { JarArtifactLauncher launcher; ServiceLoader loader = ServiceLoader.load(JarArtifactLauncher.class); @@ -44,7 +44,7 @@ public JarArtifactLauncher create(CreateContext context) { config.getValue("quarkus.http.test-ssl-port", OptionalInt.class).orElse(DEFAULT_HTTPS_PORT), ConfigUtil.waitTimeValue(config), config.getOptionalValue("quarkus.test.native-image-profile", String.class).orElse(null), - argLineValue(context, config), + ConfigUtil.argLineValue(config), context.devServicesLaunchResult(), context.buildOutputDirectory().resolve(pathStr))); return launcher; @@ -53,14 +53,6 @@ public JarArtifactLauncher create(CreateContext context) { } } - protected String getPath(CreateContext context) { - return context.quarkusArtifactProperties().getProperty("path"); - } - - protected List argLineValue(CreateContext context, Config config) { - return ConfigUtil.argLineValue(config); - } - static class DefaultJarInitContext extends DefaultInitContextBase implements JarArtifactLauncher.JarInitContext { private final Path jarPath; diff --git a/test-framework/junit5/src/main/resources/META-INF/services/io.quarkus.test.junit.launcher.ArtifactLauncherProvider b/test-framework/junit5/src/main/resources/META-INF/services/io.quarkus.test.junit.launcher.ArtifactLauncherProvider index 637e28ec42ccb..54b966c75a314 100644 --- a/test-framework/junit5/src/main/resources/META-INF/services/io.quarkus.test.junit.launcher.ArtifactLauncherProvider +++ b/test-framework/junit5/src/main/resources/META-INF/services/io.quarkus.test.junit.launcher.ArtifactLauncherProvider @@ -1,4 +1,3 @@ io.quarkus.test.junit.launcher.DockerContainerLauncherProvider io.quarkus.test.junit.launcher.JarLauncherProvider io.quarkus.test.junit.launcher.NativeImageLauncherProvider -io.quarkus.test.junit.launcher.AppCdsLauncherProvider