diff --git a/devtools/cli/src/main/java/io/quarkus/cli/Create.java b/devtools/cli/src/main/java/io/quarkus/cli/Create.java index c1156e2a74a6d2..fca521414d6f36 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/Create.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/Create.java @@ -27,12 +27,12 @@ public class Create extends BaseSubCommand implements Callable { String version = "1.0.0-SNAPSHOT"; @CommandLine.Option(names = { "-0", - "--no-examples" }, order = 4, description = "Generate without example code.") - boolean noExamples = false; + "--no-code" }, order = 4, description = "Generate an empty Quarkus project.") + boolean noCode = false; @CommandLine.Option(names = { "-x", - "--examples" }, order = 4, description = "Choose which example(s) you want in the generated Quarkus application.") - Set examples; + "--example" }, order = 4, description = "Choose a specific example for the generated Quarkus application.") + String example; @CommandLine.ArgGroup() TargetBuildTool targetBuildTool = new TargetBuildTool(); @@ -116,9 +116,9 @@ public Integer call() throws Exception { .artifactId(artifactId) .version(version) .sourceType(sourceType) - .overrideExamples(examples) + .example(example) .extensions(extensions) - .noExamples(noExamples) + .noCode(noCode) .execute().isSuccess(); if (status) { diff --git a/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java index 914a61d1836234..921f1c75809052 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java @@ -75,16 +75,13 @@ public class CreateProjectMojo extends AbstractMojo { private String projectVersion; /** - * When true, do not include any example code in the generated Quarkus project. + * When true, do not include any code in the generated Quarkus project. */ - @Parameter(property = "noExamples", defaultValue = "false") - private boolean noExamples; + @Parameter(property = "noCode", defaultValue = "false") + private boolean noCode; - /** - * Choose which example(s) you want in the generated Quarkus application. - */ - @Parameter(property = "examples") - private Set examples; + @Parameter(property = "example") + private String example; /** * Group ID of the target platform BOM @@ -286,8 +283,8 @@ public void execute() throws MojoExecutionException { .className(className) .packageName(packageName) .extensions(extensions) - .overrideExamples(examples) - .noExamples(noExamples); + .example(example) + .noCode(noCode); if (path != null) { createProject.setValue("path", path); } @@ -420,7 +417,7 @@ private void askTheUserForMissingValues() throws MojoExecutionException { DEFAULT_VERSION); } - if (examples.isEmpty()) { + if (!noCode && StringUtils.isBlank(example)) { if (extensions.isEmpty()) { extensions = Arrays .stream(prompter @@ -430,8 +427,8 @@ private void askTheUserForMissingValues() throws MojoExecutionException { .map(String::trim).filter(StringUtils::isNotEmpty).collect(Collectors.toSet()); } String answer = prompter.promptWithDefaultValue( - "Do you want example code to get started (yes), or just an empty project (no)", "yes"); - noExamples = answer.startsWith("n"); + "Would you like some code to start (yes), or just an empty Quarkus project (no)", "yes"); + noCode = answer.startsWith("n"); } } catch (IOException e) { throw new MojoExecutionException("Unable to get user input", e); diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/codestart.yml similarity index 90% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/codestart.yml index 8afe7ecbb7afb8..40de3a544e76a1 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/codestart.yml +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/codestart.yml @@ -1,9 +1,7 @@ name: amazon-lambda-example ref: amazon-lambda type: code -tags: - - example - - singleton-example +tags: example metadata: title: Amazon Lambda Integration example description: This example contains a Quarkus Greeting Lambda ready for Amazon. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/payload.json b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/payload.json similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/payload.json rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/payload.json diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/main/java/org/acme/lambda/GreetingLambda.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/main/java/org/acme/lambda/GreetingLambda.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/main/java/org/acme/lambda/GreetingLambda.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/main/java/org/acme/lambda/GreetingLambda.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/main/java/org/acme/lambda/Person.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/main/java/org/acme/lambda/Person.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/main/java/org/acme/lambda/Person.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/main/java/org/acme/lambda/Person.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/native-test/java/org/acme/lambda/LambdaHandlerTestIT.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/native-test/java/org/acme/lambda/LambdaHandlerTestIT.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/native-test/java/org/acme/lambda/LambdaHandlerTestIT.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/native-test/java/org/acme/lambda/LambdaHandlerTestIT.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/test/java/org/acme/lambda/LambdaHandlerTest.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/test/java/org/acme/lambda/LambdaHandlerTest.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/test/java/org/acme/lambda/LambdaHandlerTest.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/test/java/org/acme/lambda/LambdaHandlerTest.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/test/resources/application.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/test/resources/application.yml similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/amazon-lambda-example/java/src/test/resources/application.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/amazon-lambda-example/java/src/test/resources/application.yml diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/azure-config/function.tpl.qute.json b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/azure-config/function.tpl.qute.json similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/azure-config/function.tpl.qute.json rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/azure-config/function.tpl.qute.json diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/azure-config/host.json b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/azure-config/host.json similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/azure-config/host.json rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/azure-config/host.json diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/azure-config/local.settings.json b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/azure-config/local.settings.json similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/azure-config/local.settings.json rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/azure-config/local.settings.json diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/pom.tpl.qute.xml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/pom.tpl.qute.xml similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/pom.tpl.qute.xml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/pom.tpl.qute.xml diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/src/main/resources/application.tpl.qute.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/src/main/resources/application.tpl.qute.yml similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/base/src/main/resources/application.tpl.qute.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/base/src/main/resources/application.tpl.qute.yml diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/codestart.yml similarity index 96% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/codestart.yml index bffb79cd5a7dc0..b2dba0af52ccfb 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/azure-functions-http-example/codestart.yml +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/azure-functions-http-example/codestart.yml @@ -3,7 +3,6 @@ ref: azure-functions-http type: code tags: - example - - singleton-example - maven-only metadata: title: Azure Functions HTTP Integration example diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/README.tpl.qute.md deleted file mode 100644 index 4d1a05ebb5d47c..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/README.tpl.qute.md +++ /dev/null @@ -1,3 +0,0 @@ -{#include readme-header /} - -The Quarkus configuration location is `src/main/resources/{config.file-name}`. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/src/main/resources/application.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/src/main/resources/application.yml deleted file mode 100755 index 57ebddd2273888..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/src/main/resources/application.yml +++ /dev/null @@ -1,5 +0,0 @@ -display: - mach: 3 - unit: - name: mph - factor: 2.23694 \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/codestart.yml deleted file mode 100644 index a9ac14deb627b4..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/codestart.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: config-example -ref: config-yaml -type: code -tags: example -metadata: - title: YAML Config example - description: This Supersonic example displays mach speed in your favourite unit, depending on the specified Quarkus configuration. - path: /config/supersonic - related-guide-section: https://quarkus.io/guides/config-reference#configuration-examples -language: - base: - dependencies: - - io.quarkus:quarkus-resteasy diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/java/src/main/java/org/acme/config/ConfigResource.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/java/src/main/java/org/acme/config/ConfigResource.java deleted file mode 100755 index 60925f5da57ad4..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/java/src/main/java/org/acme/config/ConfigResource.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.acme.config; - -import org.eclipse.microprofile.config.inject.ConfigProperty; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import java.math.BigDecimal; -import java.util.Optional; - -@Path("/config") -public class ConfigResource { - - @ConfigProperty(name = "constant.speed-of-sound-in-meter-per-second", defaultValue = "343") - int speedOfSound; - - @ConfigProperty(name = "display.mach") - Optional displayMach; - - @ConfigProperty(name = "display.unit.name") - String displayUnitName; - - @ConfigProperty(name = "display.unit.factor") - BigDecimal displayUnitFactor; - - @GET - @Path("supersonic") - @Produces(MediaType.TEXT_PLAIN) - public String supersonic() { - final int mach = displayMach.orElse(1); - final BigDecimal speed = BigDecimal.valueOf(speedOfSound) - .multiply(displayUnitFactor) - .multiply(BigDecimal.valueOf(mach)); - return String.format("Mach %d is %.3f %s", - mach, - speed, - displayUnitName - ); - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/kotlin/src/main/kotlin/org/acme/config/ConfigResource.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/kotlin/src/main/kotlin/org/acme/config/ConfigResource.kt deleted file mode 100755 index 9e4062a8dc0206..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/kotlin/src/main/kotlin/org/acme/config/ConfigResource.kt +++ /dev/null @@ -1,39 +0,0 @@ -package org.acme.config - -import org.eclipse.microprofile.config.inject.ConfigProperty -import java.math.BigDecimal -import java.util.* -import javax.ws.rs.GET -import javax.ws.rs.Path -import javax.ws.rs.Produces -import javax.ws.rs.core.MediaType - -@Path("/config") -class ConfigResource { - @ConfigProperty(name = "constant.speed-of-sound-in-meter-per-second", defaultValue = "343") - var speedOfSound = 0 - - @ConfigProperty(name = "display.mach") - lateinit var displayMach: Optional - - @ConfigProperty(name = "display.unit.name") - lateinit var displayUnitName: String - - @ConfigProperty(name = "display.unit.factor") - lateinit var displayUnitFactor: BigDecimal - - @GET - @Path("supersonic") - @Produces(MediaType.TEXT_PLAIN) - fun supersonic(): String { - val mach = displayMach.orElse(1) - val speed = BigDecimal.valueOf(speedOfSound.toLong()) - .multiply(displayUnitFactor) - .multiply(BigDecimal.valueOf(mach.toLong())) - return String.format("Mach %d is %.3f %s", - mach, - speed, - displayUnitName - ) - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/codestart.yml similarity index 92% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/codestart.yml index 08ff591491429f..ff7bfaf26b25db 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/codestart.yml +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/codestart.yml @@ -1,9 +1,7 @@ name: funqy-amazon-lambda-example ref: funqy-amazon-lambda type: code -tags: - - example - - singleton-example +tags: example metadata: title: Funqy Amazon Lambda Binding example description: This example contains a Quarkus Funqy Greeting Function ready for Amazon Lambda. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/payload.json b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/payload.json similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/payload.json rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/payload.json diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/GreetingFunction.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/GreetingFunction.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/GreetingFunction.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/GreetingFunction.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/Person.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/Person.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/Person.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/Person.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/native-test/java/org/acme/funqy/FunqyIT.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/native-test/java/org/acme/funqy/FunqyIT.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/native-test/java/org/acme/funqy/FunqyIT.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/native-test/java/org/acme/funqy/FunqyIT.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/native-test/java/resources/application.properties b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/native-test/java/resources/application.properties similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/native-test/java/resources/application.properties rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/native-test/java/resources/application.properties diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/test/java/org/acme/funqy/FunqyTest.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/test/java/org/acme/funqy/FunqyTest.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/test/java/org/acme/funqy/FunqyTest.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/test/java/org/acme/funqy/FunqyTest.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/test/resources/application.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/test/resources/application.yml similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/test/resources/application.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-amazon-lambda-example/java/src/test/resources/application.yml diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/codestart.yml similarity index 90% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/codestart.yml index ec961f8eab675b..eee6f19f7669a3 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/codestart.yml +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/codestart.yml @@ -1,9 +1,7 @@ name: funqy-google-cloud-functions-example ref: funqy-google-cloud-functions type: code -tags: - - example - - singleton-example +tags: example metadata: title: Funqy Google Cloud Functions Integration examples description: Examples of Background Functions with Funqy for Quarkus. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingFunctions.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingFunctions.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingFunctions.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingFunctions.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingService.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingService.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingService.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingService.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/codestart.yml deleted file mode 100644 index c07bf5bbabf23b..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/codestart.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: funqy-http-example -ref: funqy-http -type: code -tags: example -metadata: - title: Funqy HTTP example - description: Quark is a type of elementary particle and a fundamental constituent of matter, Charm is a Quark flavor. Try to guess the Charm Quark symbol with this Funqy function by changing the ?value= query param. Go Subatomic! - path: /charm?value=s - related-guide-section: https://quarkus.io/guides/funqy-http#get-query-parameter-mapping -language: - base: - dependencies: - - io.quarkus:quarkus-funqy-http - test-dependencies: - - io.rest-assured:rest-assured diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/main/java/org/acme/funqy/Funqy.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/main/java/org/acme/funqy/Funqy.java deleted file mode 100644 index 1459171f0a48ae..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/main/java/org/acme/funqy/Funqy.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.acme.funqy; - -import io.quarkus.funqy.Funq; - -import java.util.Random; - -public class Funqy { - - private static final String CHARM_QUARK_SYMBOL = "c"; - - @Funq - public String charm(Answer answer) { - return CHARM_QUARK_SYMBOL.equalsIgnoreCase(answer.value) ? "You Quark!" : "👻 Wrong answer"; - } - - public static class Answer { - public String value; - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/test/java/org/acme/funqy/FunqyTest.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/test/java/org/acme/funqy/FunqyTest.java deleted file mode 100644 index 54e2f893715949..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/test/java/org/acme/funqy/FunqyTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.acme.funqy; - -import io.quarkus.test.junit.QuarkusTest; -import org.junit.jupiter.api.Test; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.containsString; - -@QuarkusTest -public class FunqyTest { - - @Test - public void testCharm() { - given() - .contentType("application/json") - .body("{\"value\": \"c\"}") - .post("/charm") - .then() - .statusCode(200) - .body(containsString("You Quark!")); - } - -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/codestart.yml similarity index 93% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/codestart.yml index 9357d42994e22f..2e7729c6fcc81a 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/codestart.yml +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/codestart.yml @@ -1,9 +1,7 @@ name: funqy-knative-events-example ref: funqy-knative-events type: code -tags: - - example - - singleton-example +tags: example metadata: title: Funqy Knative Events Binding example description: This example contains a Quarkus Knative Funqy Function ready for Kubernetes or Openshift. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/CloudEventGreeting.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/CloudEventGreeting.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/CloudEventGreeting.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/CloudEventGreeting.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/Person.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/Person.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/Person.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/Person.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/main/k8s/funqy-service.tpl.qute.yaml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/main/k8s/funqy-service.tpl.qute.yaml similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/main/k8s/funqy-service.tpl.qute.yaml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/main/k8s/funqy-service.tpl.qute.yaml diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/main/k8s/funqy-trigger.tpl.qute.yaml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/main/k8s/funqy-trigger.tpl.qute.yaml similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/main/k8s/funqy-trigger.tpl.qute.yaml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/main/k8s/funqy-trigger.tpl.qute.yaml diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/native-test/java/org/acme/funqy/cloudevent/FunqyIT.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/native-test/java/org/acme/funqy/cloudevent/FunqyIT.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/native-test/java/org/acme/funqy/cloudevent/FunqyIT.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/native-test/java/org/acme/funqy/cloudevent/FunqyIT.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/test/java/org/acme/funqy/cloudevent/FunqyTest.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/test/java/org/acme/funqy/cloudevent/FunqyTest.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-knative-events-example/java/src/test/java/org/acme/funqy/cloudevent/FunqyTest.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-knative-events-example/java/src/test/java/org/acme/funqy/cloudevent/FunqyTest.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/codestart.yml similarity index 90% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/codestart.yml index 9d433d9bbe5763..4d7637caf8d55e 100755 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/codestart.yml +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/codestart.yml @@ -1,9 +1,7 @@ name: google-cloud-functions-example ref: google-cloud-functions type: code -tags: - - example - - singleton-example +tags: example metadata: title: Google Cloud Functions Integration examples description: Examples of Google Cloud HTTP and Background Functions for Quarkus. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldBackgroundFunction.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldBackgroundFunction.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldBackgroundFunction.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldBackgroundFunction.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldHttpFunction.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldHttpFunction.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldHttpFunction.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldHttpFunction.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/codestart.yml similarity index 94% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/codestart.yml index 0e452283e55af4..ef590eacbbfc5d 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/codestart.yml +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/codestart.yml @@ -1,9 +1,7 @@ name: google-cloud-functions-http-example ref: google-cloud-functions-http type: code -tags: - - example - - singleton-example +tags: example metadata: title: Google Cloud Functions HTTP Integration examples description: Examples of Google Cloud HTTP functions for Quarkus written with RESTEasy (JAX-RS), Undertow (Servlet), Vert.x Web, or Funqy HTTP. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingFunqy.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingFunqy.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingFunqy.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingFunqy.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingResource.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingResource.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingResource.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingResource.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingRoutes.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingRoutes.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingRoutes.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingRoutes.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingServlet.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingServlet.java similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingServlet.java rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingServlet.java diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/src/main/resources/META-INF/resources/index.entry.qute.html b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/src/main/resources/META-INF/resources/index.entry.qute.html deleted file mode 100644 index a1768e062a7829..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/src/main/resources/META-INF/resources/index.entry.qute.html +++ /dev/null @@ -1 +0,0 @@ -{#include index-entry /} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/src/main/resources/application.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/src/main/resources/application.yml deleted file mode 100644 index 595acd4bf3c00c..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/src/main/resources/application.yml +++ /dev/null @@ -1,7 +0,0 @@ -quarkus: - log: - console: - json: - pretty-print: true - date-format: YYYY-MM-dd HH:mm:ss - exception-output-type: detailed-and-formatted \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/codestart.yml deleted file mode 100644 index a7bce02831a26e..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/codestart.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: logging-json-example -ref: logging-json -type: code -tags: example -metadata: - title: Logging JSON example - description: This example lets you go faster with your jet aircraft. Your speed is logged when you send a new request.
When you reach the speed of sound, a "Sonic Boom" error is going to be thrown and logged. Boom! - path: /logging-json/faster - related-guide-section: https://quarkus.io/guides/logging#configuration -language: - base: - dependencies: - - io.quarkus:quarkus-resteasy - - io.quarkus:quarkus-logging-json diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/java/src/main/java/org/acme/logging/json/LoggingJsonResource.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/java/src/main/java/org/acme/logging/json/LoggingJsonResource.java deleted file mode 100644 index 5f6e996669b2e2..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/java/src/main/java/org/acme/logging/json/LoggingJsonResource.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.acme.logging.json; - -import org.jboss.logging.Logger; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.ServerErrorException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.util.Random; -import java.util.concurrent.atomic.AtomicInteger; - -@Path("/logging-json") -public class LoggingJsonResource { - - private static final Logger LOG = Logger.getLogger(LoggingJsonResource.class); - private static final int SPEED_OF_SOUND_IN_METER_PER_SECOND = 343; - - private final AtomicInteger speed = new AtomicInteger(0); - private final Random random = new Random(); - - @GET - @Path("faster") - @Produces(MediaType.TEXT_PLAIN) - public String faster() { - final int s = speed.addAndGet(random.nextInt(200)); - if (s > SPEED_OF_SOUND_IN_METER_PER_SECOND) { - throw new ServerErrorException("💥 SONIC BOOOOOM!!!", Response.Status.SERVICE_UNAVAILABLE); - } - String message = String.format("Your jet aircraft speed is %s m/s.", s); - LOG.info(message); - return message + " Watch the logs..."; - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/kotlin/src/main/kotlin/org/acme/logging/json/LoggingJsonResource.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/kotlin/src/main/kotlin/org/acme/logging/json/LoggingJsonResource.kt deleted file mode 100644 index 3972de99a5c3a6..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/kotlin/src/main/kotlin/org/acme/logging/json/LoggingJsonResource.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.acme.logging.json - -import org.jboss.logging.Logger -import java.util.* -import java.util.concurrent.atomic.AtomicInteger -import javax.ws.rs.GET -import javax.ws.rs.Path -import javax.ws.rs.Produces -import javax.ws.rs.ServerErrorException -import javax.ws.rs.core.MediaType -import javax.ws.rs.core.Response - -@Path("/logging-json") -class LoggingJsonResource { - private val speed = AtomicInteger(0) - private val random = Random() - - @GET - @Path("faster") - @Produces(MediaType.TEXT_PLAIN) - fun faster(): String { - val s = speed.addAndGet(random.nextInt(200)) - if (s > SPEED_OF_SOUND_IN_METER_PER_SECOND) { - throw ServerErrorException("💥 SONIC BOOOOOM!!!", Response.Status.SERVICE_UNAVAILABLE) - } - val message = "Your jet aircraft speed is $s m/s." - LOG.info(message) - return "$message Watch the logs..." - } - - companion object { - private val LOG = Logger.getLogger(LoggingJsonResource::class.java) - private const val SPEED_OF_SOUND_IN_METER_PER_SECOND = 343 - } -} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/EntryCommand.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/EntryCommand.java deleted file mode 100755 index 4447b7610861e4..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/EntryCommand.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.acme.picocli; - -import io.quarkus.picocli.runtime.annotations.TopCommand; -import picocli.CommandLine; - -@TopCommand -@CommandLine.Command(mixinStandardHelpOptions = true, subcommands = { HelloCommand.class, GoodbyeCommand.class }) -public class EntryCommand { -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/GoodbyeCommand.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/GoodbyeCommand.java deleted file mode 100644 index 653ba227a55407..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/GoodbyeCommand.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.acme.picocli; - -import picocli.CommandLine.Command; -import picocli.CommandLine.Option; - -@Command(name = "goodbye") -public class GoodbyeCommand implements Runnable { - - @Option(names = {"--name"}, description = "Guest name") - String name; - - @Option(names = {"--times", "-t"}, defaultValue = "1", description = "How many time should we say goodbye") - int times; - - @Override - public void run() { - for (int i = 0;i quarks = Collections.newSetFromMap(Collections.synchronizedMap(new LinkedHashMap<>())); - - public JacksonResource() { - quarks.add(new Quark("Up", "The up quark or u quark (symbol: u) is the lightest of all quarks, a type of elementary particle, and a major constituent of matter.")); - quarks.add(new Quark("Strange", "The strange quark or s quark (from its symbol, s) is the third lightest of all quarks, a type of elementary particle.")); - quarks.add(new Quark("Charm", "The charm quark, charmed quark or c quark (from its symbol, c) is the third most massive of all quarks, a type of elementary particle.")); - quarks.add(new Quark("???", null)); - } - - @GET - public Set list() { - return quarks; - } - - @POST - public Set add(Quark quark) { - quarks.add(quark); - return quarks; - } - - @DELETE - public Set delete(Quark quark) { - quarks.removeIf(existingQuark -> existingQuark.name.contentEquals(quark.name)); - return quarks; - } - - public static class Quark { - public String name; - public String description; - - public Quark() { - } - - public Quark(String name, String description) { - this.name = name; - this.description = description; - } - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/java/src/main/java/org/acme/resteasyjackson/MyObjectMapperCustomizer.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/java/src/main/java/org/acme/resteasyjackson/MyObjectMapperCustomizer.java deleted file mode 100644 index 9aab532b25d511..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/java/src/main/java/org/acme/resteasyjackson/MyObjectMapperCustomizer.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.acme.resteasyjackson; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.quarkus.jackson.ObjectMapperCustomizer; - -import javax.inject.Singleton; - -@Singleton -public class MyObjectMapperCustomizer implements ObjectMapperCustomizer { - - @Override - public void customize(ObjectMapper objectMapper) { - // To suppress serializing properties with null values - objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/kotlin/src/main/kotlin/org/acme/resteasyjackson/JacksonResource.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/kotlin/src/main/kotlin/org/acme/resteasyjackson/JacksonResource.kt deleted file mode 100644 index 05b638be165349..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/kotlin/src/main/kotlin/org/acme/resteasyjackson/JacksonResource.kt +++ /dev/null @@ -1,48 +0,0 @@ -package org.acme.resteasyjackson - -import java.util.* -import javax.ws.rs.* -import javax.ws.rs.core.MediaType - -@Path("/resteasy-jackson/quarks") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -class JacksonResource { - - private val quarks = Collections.newSetFromMap(Collections.synchronizedMap(LinkedHashMap())) - - init { - quarks.add(Quark("Up", "The up quark or u quark (symbol: u) is the lightest of all quarks, a type of elementary particle, and a major constituent of matter.")) - quarks.add(Quark("Strange", "The strange quark or s quark (from its symbol, s) is the third lightest of all quarks, a type of elementary particle.")) - quarks.add(Quark("Charm", "The charm quark, charmed quark or c quark (from its symbol, c) is the third most massive of all quarks, a type of elementary particle.")) - quarks.add(Quark("???", null)) - } - - @GET - fun list(): Set { - return quarks - } - - @POST - fun add(quark: Quark): Set { - quarks.add(quark) - return quarks - } - - @DELETE - fun delete(quark: Quark): Set { - quarks.removeIf { existingQuark: Quark -> existingQuark.name!!.contentEquals(quark.name!!) } - return quarks - } - - class Quark { - var name: String? = null - var description: String? = null - - constructor() {} - constructor(name: String?, description: String?) { - this.name = name - this.description = description - } - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/kotlin/src/main/kotlin/org/acme/resteasyjackson/MyObjectMapperCustomizer.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/kotlin/src/main/kotlin/org/acme/resteasyjackson/MyObjectMapperCustomizer.kt deleted file mode 100644 index fd5b34937dd2cd..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/kotlin/src/main/kotlin/org/acme/resteasyjackson/MyObjectMapperCustomizer.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.acme.resteasyjackson - -import com.fasterxml.jackson.annotation.JsonInclude -import com.fasterxml.jackson.databind.ObjectMapper -import io.quarkus.jackson.ObjectMapperCustomizer -import javax.inject.Singleton - -@Singleton -class MyObjectMapperCustomizer : ObjectMapperCustomizer { - override fun customize(objectMapper: ObjectMapper) { - // To suppress serializing properties with null values - objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL) - } -} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/src/main/resources/META-INF/resources/index.entry.qute.html b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/src/main/resources/META-INF/resources/index.entry.qute.html deleted file mode 100644 index a1768e062a7829..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/src/main/resources/META-INF/resources/index.entry.qute.html +++ /dev/null @@ -1 +0,0 @@ -{#include index-entry /} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/src/main/resources/templates/page.qute.tpl.qute.html b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/src/main/resources/templates/page.qute.tpl.qute.html deleted file mode 100644 index 14982d0f5b5819..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/src/main/resources/templates/page.qute.tpl.qute.html +++ /dev/null @@ -1,47 +0,0 @@ -\{! This parameter declarations makes it possible to validate expressions in the template !} -\{@java.util.List<{project.package-name ?: 'org.acme'}.resteasyqute.Quark> quarks} - - - - - Qute & Quarks - - - -

Qute & Quarks

- -

Welcome to our Qute subatomic-particles generator.

- -

- Generate a new quark -

- -
- \{#for quark in quarks} -
- \{quark.flavor.toString.toLowerCase} -
- \{/for} -
- - diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/codestart.yml deleted file mode 100644 index be9b0f4a246ca5..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/codestart.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: resteasy-qute-example -ref: resteasy-qute -type: code -tags: example -metadata: - title: RESTEasy Qute example - description: This example uses a RESTEasy & Qute template to render a subatomic-particle generator web page. So Qute! - path: /qute/quarks - related-guide-section: https://quarkus.io/guides/qute#type-safe-templates -language: - base: - dependencies: - - io.quarkus:quarkus-resteasy-qute diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/java/src/main/java/org/acme/resteasyqute/Quark.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/java/src/main/java/org/acme/resteasyqute/Quark.java deleted file mode 100644 index 7c54bb8ad80fe1..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/java/src/main/java/org/acme/resteasyqute/Quark.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.acme.resteasyqute; - -public class Quark { - public enum Flavor { DOWN, UP, STRANGE, CHARM, BOTTOM, TOP } - - public enum Color { - RED("#ff6961"), - GREEN("#77dd77"), - BLUE("#aec6cf"); - - public final String hex; - - Color(String hex) { - this.hex = hex; - } - } - - public final Flavor flavor; - public final Color color; - - public Quark(Flavor flavor, Color color) { - this.flavor = flavor; - this.color = color; - } -} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/java/src/main/java/org/acme/resteasyqute/QuteResource.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/java/src/main/java/org/acme/resteasyqute/QuteResource.java deleted file mode 100644 index 91dec46ab26b6a..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/java/src/main/java/org/acme/resteasyqute/QuteResource.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.acme.resteasyqute; - -import io.quarkus.qute.Template; -import io.quarkus.qute.TemplateExtension; -import io.quarkus.qute.TemplateInstance; - -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; - -@Path("/qute/quarks") -public class QuteResource { - - private final List quarks = Collections.synchronizedList(new ArrayList<>()); - - @Inject - Template page; - - public QuteResource() { - for (int i = 0; i < 3; i++) { - this.addQuark(); - } - } - - @GET - @Produces(MediaType.TEXT_HTML) - public TemplateInstance get() { - return page.data("quarks", new ArrayList<>(quarks)); - } - - @POST - @Path("add") - public void addQuark() { - final Random random = new Random(); - final Quark.Flavor flavor = Quark.Flavor.values()[random.nextInt(Quark.Flavor.values().length)]; - final Quark.Color color = Quark.Color.values()[random.nextInt(Quark.Color.values().length)]; - quarks.add(new Quark(flavor, color)); - } - - /** - * This template extension method implements the "position" computed property. - */ - @TemplateExtension - static int position(Quark quark) { - return new Random().nextInt(100); - } - -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/kotlin/src/main/kotlin/org/acme/resteasyqute/Quark.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/kotlin/src/main/kotlin/org/acme/resteasyqute/Quark.kt deleted file mode 100644 index 18b7a813d33611..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/kotlin/src/main/kotlin/org/acme/resteasyqute/Quark.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.acme.resteasyqute - -class Quark(val flavor: Flavor, val color: Color) { - enum class Flavor { - DOWN, UP, STRANGE, CHARM, BOTTOM, TOP - } - - enum class Color(val hex: String) { - RED("#ff6961"), GREEN("#77dd77"), BLUE("#aec6cf"); - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/kotlin/src/main/kotlin/org/acme/resteasyqute/QuteResource.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/kotlin/src/main/kotlin/org/acme/resteasyqute/QuteResource.kt deleted file mode 100644 index cf292f66726be2..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/kotlin/src/main/kotlin/org/acme/resteasyqute/QuteResource.kt +++ /dev/null @@ -1,54 +0,0 @@ -package org.acme.resteasyqute - -import io.quarkus.qute.Template -import io.quarkus.qute.TemplateExtension -import io.quarkus.qute.TemplateInstance -import java.util.* -import javax.inject.Inject -import javax.ws.rs.GET -import javax.ws.rs.POST -import javax.ws.rs.Path -import javax.ws.rs.Produces -import javax.ws.rs.core.MediaType - -@Path("/qute/quarks") -class QuteResource { - private val quarks = Collections.synchronizedList(ArrayList()) - - init { - for (i in 0..2) { - addQuark() - } - } - - @Inject - lateinit var page: Template - - @GET - @Produces(MediaType.TEXT_HTML) - fun get(): TemplateInstance { - return page.data("quarks", ArrayList(quarks)) - } - - @POST - @Path("add") - fun addQuark() { - val random = Random() - val flavor = Quark.Flavor.values()[random.nextInt(Quark.Flavor.values().size)] - val color = Quark.Color.values()[random.nextInt(Quark.Color.values().size)] - quarks.add(Quark(flavor, color)) - } - - @TemplateExtension - class QuarkExtension { - companion object { - /** - * This template extension method implements the "position" computed property. - */ - @JvmStatic - fun position(quark: Quark): Int { - return Random().nextInt(100) - } - } - } -} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/base/README.tpl.qute.md new file mode 100644 index 00000000000000..c80dfdef4fd945 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/base/README.tpl.qute.md @@ -0,0 +1,3 @@ +{#include readme-header /} + +The Quarkus application configuration is located in `src/main/resources/{config.file-name}`. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/base/src/main/resources/application.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/base/src/main/resources/application.yml new file mode 100755 index 00000000000000..3f3ebe1d67d7a8 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/base/src/main/resources/application.yml @@ -0,0 +1,2 @@ +greeting: + message: hello \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/codestart.yml new file mode 100644 index 00000000000000..d2feac9e6d0bf4 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/codestart.yml @@ -0,0 +1,8 @@ +name: config-yaml-codestart +ref: config-yaml +type: code +tags: extension-codestart +metadata: + title: YAML Config + description: Configure your application with YAML + related-guide-section: https://quarkus.io/guides/config-reference#configuration-examples diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/java/src/main/java/org/acme/GreetingConfig.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/java/src/main/java/org/acme/GreetingConfig.java new file mode 100644 index 00000000000000..11c6eff61bdc4a --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/java/src/main/java/org/acme/GreetingConfig.java @@ -0,0 +1,12 @@ +package org.acme; + +import io.quarkus.arc.config.ConfigProperties; +import org.eclipse.microprofile.config.inject.ConfigProperty; + +@ConfigProperties(prefix = "greeting") +public interface GreetingConfig { + + @ConfigProperty(name = "message") + String message(); + +} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/kotlin/src/main/kotlin/org/acme/GreetingConfig.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/kotlin/src/main/kotlin/org/acme/GreetingConfig.kt new file mode 100755 index 00000000000000..4afdccbe6eae8b --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/kotlin/src/main/kotlin/org/acme/GreetingConfig.kt @@ -0,0 +1,12 @@ +package org.acme + +import io.quarkus.arc.config.ConfigProperties +import org.eclipse.microprofile.config.inject.ConfigProperty + +@ConfigProperties(prefix = "greeting") +interface GreetingConfig { + + @ConfigProperty(name = "message") + fun message(): String? + +} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/src/main/resources/META-INF/resources/index.entry.qute.html b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/src/main/resources/META-INF/resources/index.entry.qute.html rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/codestart.yml new file mode 100644 index 00000000000000..4da2efc0423eeb --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/codestart.yml @@ -0,0 +1,15 @@ +name: funqy-http-codestarts +ref: funqy-http +type: code +tags: extension-codestart +metadata: + title: Funqy HTTP + description: Start your Funqy functions using HTTP + path: /greeting + related-guide-section: https://quarkus.io/guides/funqy-http#get-query-parameter-mapping +language: + base: + dependencies: + - io.quarkus:quarkus-funqy-http + test-dependencies: + - io.rest-assured:rest-assured diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/main/java/org/acme/MyFunctions.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/main/java/org/acme/MyFunctions.java new file mode 100644 index 00000000000000..6214975339d25b --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/main/java/org/acme/MyFunctions.java @@ -0,0 +1,17 @@ +package org.acme; + +import io.quarkus.funqy.Funq; + +public class MyFunctions { + + @Funq + public String greeting(GreetingInput input) { + return String.format("Hello %s!", input != null ? input.name : "Funqy"); + } + + + public static class GreetingInput { + public String name; + } + +} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/native-test/java/org/acme/MyFunctionsIT.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/native-test/java/org/acme/MyFunctionsIT.java new file mode 100644 index 00000000000000..da26cfe4f22838 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/native-test/java/org/acme/MyFunctionsIT.java @@ -0,0 +1,8 @@ +package org.acme; + +import io.quarkus.test.junit.NativeImageTest; + +@NativeImageTest +public class MyFunctionsIT extends MyFunctionsTest { + // Run the same tests in native +} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/test/java/org/acme/MyFunctionsTest.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/test/java/org/acme/MyFunctionsTest.java new file mode 100644 index 00000000000000..d9d95b328f8b76 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/test/java/org/acme/MyFunctionsTest.java @@ -0,0 +1,33 @@ +package org.acme; + +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.containsString; + +@QuarkusTest +public class MyFunctionsTest { + + @Test + public void testGreeting() { + given() + .post("/greeting") + .then() + .statusCode(200) + .body(containsString("Hello Funqy!")); + } + + @Test + public void testGreetingWithName() { + given() + .contentType(ContentType.JSON) + .body("{\"name\": \"Friend\"}") + .post("/greeting") + .then() + .statusCode(200) + .body(containsString("Hello Friend!")); + } + +} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/base/README.tpl.qute.md similarity index 84% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/base/README.tpl.qute.md index eb1ae983ef01e1..ef900f75e1962b 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/base/README.tpl.qute.md +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/base/README.tpl.qute.md @@ -4,5 +4,5 @@ Also for picocli applications the dev mode is supported. When running dev mode, As picocli applications will often require arguments to be passed on the commandline, this is also possible in dev mode via: ```shell script -{buildtool.cli} {buildtool.cmd.dev} {#if input.base-codestart.buildtool == 'gradle' || input.base-codestart.buildtool == 'gradle-kotlin-dsl'}--quarkus-args{#else}-Dquarkus.args{/if}='hello --first-name=Quarky' +{buildtool.cli} {buildtool.cmd.dev} {#if input.base-codestart.buildtool == 'gradle' || input.base-codestart.buildtool == 'gradle-kotlin-dsl'}--quarkus-args{#else}-Dquarkus.args{/if}='Quarky' ``` diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/codestart.yml similarity index 89% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/codestart.yml index 84a8140dd0b23b..4709ebde9cbe3e 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/codestart.yml +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/codestart.yml @@ -1,7 +1,7 @@ -name: picocli-example +name: picocli-codestart ref: picocli type: code -tags: example +tags: extension-codestart metadata: title: Picocli Example description: Hello and goodbye are civilization fundamentals. Let's not forget it with this example picocli application by changing the command and parameters. diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/java/src/main/java/org/acme/GreetingCommand.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/java/src/main/java/org/acme/GreetingCommand.java new file mode 100644 index 00000000000000..f8e217057eb303 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/java/src/main/java/org/acme/GreetingCommand.java @@ -0,0 +1,19 @@ +package org.acme; + +import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Parameters; + +@Command(name = "greeting", mixinStandardHelpOptions = true) +public class GreetingCommand implements Runnable { + + @Parameters(paramLabel = "", defaultValue = "picocli", + description = "Your name.") + String name; + + @Override + public void run() { + System.out.printf("Hello %s, go go commando!\n", name); + } + +} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/kotlin/src/main/kotlin/org/acme/GreetingCommand.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/kotlin/src/main/kotlin/org/acme/GreetingCommand.kt new file mode 100644 index 00000000000000..8ad84b573f1e15 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/kotlin/src/main/kotlin/org/acme/GreetingCommand.kt @@ -0,0 +1,16 @@ +package org.acme + +import picocli.CommandLine +import picocli.CommandLine.Command +import picocli.CommandLine.Parameters + +@Command(name = "greeting", mixinStandardHelpOptions = true) +class GreetingCommand : Runnable { + + @Parameters(paramLabel = "", defaultValue = "picocli", description = ["Your name."]) + var name: String? = null + override fun run() { + System.out.printf("Hello %s, go go commando!\n", name) + } + +} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/README.tpl.qute.md rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/base/README.tpl.qute.md diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/base/src/main/resources/META-INF/resources/index.entry.qute.html b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/base/src/main/resources/META-INF/resources/index.entry.qute.html rename to devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/base/src/main/resources/templates/page.qute.tpl.qute.html b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/base/src/main/resources/templates/page.qute.tpl.qute.html new file mode 100644 index 00000000000000..ee48d214c4ebf5 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/base/src/main/resources/templates/page.qute.tpl.qute.html @@ -0,0 +1,30 @@ + + + + + Hello \{name ?: "Qute"} + + + +

Hello \{name ?: "Qute"}

+ +

Create your web page using Quarkus RESTEasy & Qute

+ + diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/codestart.yml new file mode 100644 index 00000000000000..8574e9fd9b3994 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/codestart.yml @@ -0,0 +1,13 @@ +name: resteasy-qute-codestart +ref: resteasy-qute +tags: extension-codestart +type: code +metadata: + title: RESTEasy Qute + description: Create your web page using Quarkus RESTEasy & Qute + path: /some-page + related-guide-section: https://quarkus.io/guides/qute#type-safe-templates +language: + base: + dependencies: + - io.quarkus:quarkus-resteasy-qute diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/java/src/main/java/org/acme/SomePage.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/java/src/main/java/org/acme/SomePage.java new file mode 100644 index 00000000000000..2b070ebf8bb7c9 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/java/src/main/java/org/acme/SomePage.java @@ -0,0 +1,25 @@ +package org.acme; + +import io.quarkus.qute.Template; +import io.quarkus.qute.TemplateInstance; + +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; + +@Path("/some-page") +public class SomePage { + + @Inject + Template page; + + @GET + @Produces(MediaType.TEXT_HTML) + public TemplateInstance get(@QueryParam("name") String name) { + return page.data("name", name); + } + +} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/kotlin/src/main/kotlin/org/acme/SomePage.kt b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/kotlin/src/main/kotlin/org/acme/SomePage.kt new file mode 100644 index 00000000000000..4fa7e805020ee7 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/kotlin/src/main/kotlin/org/acme/SomePage.kt @@ -0,0 +1,23 @@ +package org.acme + +import io.quarkus.qute.Template +import io.quarkus.qute.TemplateInstance +import javax.inject.Inject +import javax.ws.rs.GET +import javax.ws.rs.Path +import javax.ws.rs.Produces +import javax.ws.rs.QueryParam +import javax.ws.rs.core.MediaType + +@Path("/some-page") +class SomePage { + + @Inject + lateinit var page: Template + + @GET + @Produces(MediaType.TEXT_HTML) + operator fun get(@QueryParam("name") name: String?): TemplateInstance { + return page.data("name", name) + } +} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/native-test/java/org/acme/funqy/FunqyIT.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/native-test/java/org/acme/funqy/FunqyIT.java deleted file mode 100644 index cce22690603da7..00000000000000 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/singleton-examples/funqy-amazon-lambda-example/java/src/native-test/java/org/acme/funqy/FunqyIT.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.acme.funqy; - -import io.quarkus.test.junit.NativeImageTest; - -@NativeImageTest -public class FunqyIT extends FunqyTest { - - // Run the same tests - -} diff --git a/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/ConfigYamlCodestartTest.java b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/ConfigYamlCodestartTest.java index 997f0a940a8eab..d6952d49e6acab 100644 --- a/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/ConfigYamlCodestartTest.java +++ b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/ConfigYamlCodestartTest.java @@ -14,12 +14,13 @@ public class ConfigYamlCodestartTest { public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() .codestarts("config-yaml") .languages(JAVA, KOTLIN) - .skipGenerateRealDataProject() .build(); @Test void testContent() throws Throwable { - codestartTest.checkGeneratedSource("org.acme.config.ConfigResource"); + codestartTest.checkGeneratedSource("org.acme.GreetingConfig"); codestartTest.assertThatGeneratedFileMatchSnapshot(JAVA, "src/main/resources/application.yml"); + //codestartTest.buildAllProjects(); } + } diff --git a/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/FunqyHttpCodestartTest.java b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/FunqyHttpCodestartTest.java new file mode 100644 index 00000000000000..52e192c2c83b13 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/FunqyHttpCodestartTest.java @@ -0,0 +1,26 @@ +package io.quarkus.devtools.codestarts.quarkus; + +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; + +public class FunqyHttpCodestartTest { + + @RegisterExtension + public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .codestarts("funqy-http") + .languages(JAVA) + .build(); + + @Test + void testContent() throws Throwable { + codestartTest.checkGeneratedSource("org.acme.MyFunctions"); + codestartTest.checkGeneratedTestSource("org.acme.MyFunctionsTest"); + codestartTest.checkGeneratedTestSource("org.acme.MyFunctionsIT"); + //codestartTest.buildAllProjects(); + } + +} diff --git a/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/PicocliCodestartTest.java b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/PicocliCodestartTest.java index cc55b8031d55b9..f331290d8260f3 100644 --- a/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/PicocliCodestartTest.java +++ b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/PicocliCodestartTest.java @@ -16,7 +16,6 @@ public class PicocliCodestartTest { public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() .codestarts("picocli") .languages(JAVA, KOTLIN) - .skipGenerateRealDataProject() .build(); @RegisterExtension @@ -24,20 +23,18 @@ public class PicocliCodestartTest { .codestarts("picocli") .buildTool(BuildTool.GRADLE) .languages(JAVA) - .skipGenerateRealDataProject() .build(); @Test void testContent() throws Throwable { - codestartTest.checkGeneratedSource("org.acme.picocli.EntryCommand"); - codestartTest.checkGeneratedSource("org.acme.picocli.GoodbyeCommand"); - codestartTest.checkGeneratedSource("org.acme.picocli.HelloCommand"); - codestartTest.checkGeneratedSource("org.acme.picocli.GreetingService"); + codestartTest.checkGeneratedSource("org.acme.GreetingCommand"); codestartTest.assertThatGeneratedFile(JAVA, "README.md") - .satisfies(checkContains("./mvnw compile quarkus:dev -Dquarkus.args='hello --first-name=Quarky")); + .satisfies(checkContains("./mvnw compile quarkus:dev -Dquarkus.args='Quarky")); codestartGradleTest.assertThatGeneratedFile(JAVA, "README.md") - .satisfies(checkContains("./gradlew quarkusDev --quarkus-args='hello --first-name=Quarky'")); + .satisfies(checkContains("./gradlew quarkusDev --quarkus-args='Quarky'")); + + //codestartTest.buildAllProjects(); } } diff --git a/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyQuteCodestartTest.java b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyQuteCodestartTest.java index 29754ba38018d8..5fa10cfe063241 100644 --- a/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyQuteCodestartTest.java +++ b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyQuteCodestartTest.java @@ -14,14 +14,12 @@ public class RESTEasyQuteCodestartTest { public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() .codestarts("resteasy-qute") .languages(JAVA, KOTLIN) - .skipGenerateRealDataProject() .build(); @Test void testContent() throws Throwable { - codestartTest.checkGeneratedSource("org.acme.resteasyqute.Quark"); - codestartTest.checkGeneratedSource("org.acme.resteasyqute.QuteResource"); + codestartTest.checkGeneratedSource("org.acme.SomePage"); codestartTest.assertThatGeneratedFileMatchSnapshot(JAVA, "src/main/resources/templates/page.qute.html"); - codestartTest.assertThatGeneratedFileMatchSnapshot(KOTLIN, "src/main/resources/templates/page.qute.html"); + //codestartTest.buildAllProjects(); } } diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingConfig.java b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingConfig.java new file mode 100644 index 00000000000000..b7ae8f885850ae --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingConfig.java @@ -0,0 +1,12 @@ +package ilove.quark.us; + +import io.quarkus.arc.config.ConfigProperties; +import org.eclipse.microprofile.config.inject.ConfigProperty; + +@ConfigProperties(prefix = "greeting") +public interface GreetingConfig { + + @ConfigProperty(name = "message") + String message(); + +} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingConfig.kt b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingConfig.kt new file mode 100644 index 00000000000000..c954d4e6c3d0f0 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingConfig.kt @@ -0,0 +1,12 @@ +package ilove.quark.us + +import io.quarkus.arc.config.ConfigProperties +import org.eclipse.microprofile.config.inject.ConfigProperty + +@ConfigProperties(prefix = "greeting") +interface GreetingConfig { + + @ConfigProperty(name = "message") + fun message(): String? + +} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_resources_application.yml b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_resources_application.yml index 48690a97f6104b..527a35f6580764 100644 --- a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_resources_application.yml +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_resources_application.yml @@ -1,5 +1,2 @@ -display: - mach: 3 - unit: - name: "mph" - factor: 2.23694 +greeting: + message: "hello" diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_main_java_ilove_quark_us_MyFunctions.java b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_main_java_ilove_quark_us_MyFunctions.java new file mode 100644 index 00000000000000..7a838a5fdc2960 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_main_java_ilove_quark_us_MyFunctions.java @@ -0,0 +1,17 @@ +package ilove.quark.us; + +import io.quarkus.funqy.Funq; + +public class MyFunctions { + + @Funq + public String greeting(GreetingInput input) { + return String.format("Hello %s!", input != null ? input.name : "Funqy"); + } + + + public static class GreetingInput { + public String name; + } + +} diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_test_java_ilove_quark_us_MyFunctionsIT.java b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_test_java_ilove_quark_us_MyFunctionsIT.java new file mode 100644 index 00000000000000..39a25c95d57b78 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_test_java_ilove_quark_us_MyFunctionsIT.java @@ -0,0 +1,8 @@ +package ilove.quark.us; + +import io.quarkus.test.junit.NativeImageTest; + +@NativeImageTest +public class MyFunctionsIT extends MyFunctionsTest { + // Run the same tests in native +} diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_test_java_ilove_quark_us_MyFunctionsTest.java b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_test_java_ilove_quark_us_MyFunctionsTest.java new file mode 100644 index 00000000000000..ef6bb2ae42210f --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_test_java_ilove_quark_us_MyFunctionsTest.java @@ -0,0 +1,33 @@ +package ilove.quark.us; + +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.containsString; + +@QuarkusTest +public class MyFunctionsTest { + + @Test + public void testGreeting() { + given() + .post("/greeting") + .then() + .statusCode(200) + .body(containsString("Hello Funqy!")); + } + + @Test + public void testGreetingWithName() { + given() + .contentType(ContentType.JSON) + .body("{\"name\": \"Friend\"}") + .post("/greeting") + .then() + .statusCode(200) + .body(containsString("Hello Friend!")); + } + +} diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/PicocliCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingCommand.java b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/PicocliCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingCommand.java new file mode 100644 index 00000000000000..3ca5dc4809f831 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/PicocliCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingCommand.java @@ -0,0 +1,19 @@ +package ilove.quark.us; + +import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Parameters; + +@Command(name = "greeting", mixinStandardHelpOptions = true) +public class GreetingCommand implements Runnable { + + @Parameters(paramLabel = "", defaultValue = "picocli", + description = "Your name.") + String name; + + @Override + public void run() { + System.out.printf("Hello %s, go go commando!\n", name); + } + +} diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/PicocliCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingCommand.kt b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/PicocliCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingCommand.kt new file mode 100644 index 00000000000000..b49b1c98195647 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/PicocliCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingCommand.kt @@ -0,0 +1,16 @@ +package ilove.quark.us + +import picocli.CommandLine +import picocli.CommandLine.Command +import picocli.CommandLine.Parameters + +@Command(name = "greeting", mixinStandardHelpOptions = true) +class GreetingCommand : Runnable { + + @Parameters(paramLabel = "", defaultValue = "picocli", description = ["Your name."]) + var name: String? = null + override fun run() { + System.out.printf("Hello %s, go go commando!\n", name) + } + +} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_java_ilove_quark_us_SomePage.java b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_java_ilove_quark_us_SomePage.java new file mode 100644 index 00000000000000..b38e25e600637f --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_java_ilove_quark_us_SomePage.java @@ -0,0 +1,25 @@ +package ilove.quark.us; + +import io.quarkus.qute.Template; +import io.quarkus.qute.TemplateInstance; + +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; + +@Path("/some-page") +public class SomePage { + + @Inject + Template page; + + @GET + @Produces(MediaType.TEXT_HTML) + public TemplateInstance get(@QueryParam("name") String name) { + return page.data("name", name); + } + +} diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_kotlin_ilove_quark_us_SomePage.kt b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_kotlin_ilove_quark_us_SomePage.kt new file mode 100644 index 00000000000000..367550a571035a --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_kotlin_ilove_quark_us_SomePage.kt @@ -0,0 +1,23 @@ +package ilove.quark.us + +import io.quarkus.qute.Template +import io.quarkus.qute.TemplateInstance +import javax.inject.Inject +import javax.ws.rs.GET +import javax.ws.rs.Path +import javax.ws.rs.Produces +import javax.ws.rs.QueryParam +import javax.ws.rs.core.MediaType + +@Path("/some-page") +class SomePage { + + @Inject + lateinit var page: Template + + @GET + @Produces(MediaType.TEXT_HTML) + operator fun get(@QueryParam("name") name: String?): TemplateInstance { + return page.data("name", name) + } +} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_resources_templates_page.qute.html b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_resources_templates_page.qute.html index a9918d531acbd1..203bd4b37d469c 100644 --- a/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_resources_templates_page.qute.html +++ b/devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_resources_templates_page.qute.html @@ -1,47 +1,30 @@ -{! This parameter declarations makes it possible to validate expressions in the template !} -{@java.util.List quarks} - Qute & Quarks + Hello {name ?: "Qute"} -

Qute & Quarks

- -

Welcome to our Qute subatomic-particles generator.

- -

- Generate a new quark -

+

Hello {name ?: "Qute"}

-
- {#for quark in quarks} -
- {quark.flavor.toString.toLowerCase} -
- {/for} -
+

Create your web page using Quarkus RESTEasy & Qute

diff --git a/extensions/config-yaml/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/config-yaml/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 2ee1bbc6ae8e35..f8087d19aa1593 100644 --- a/extensions/config-yaml/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/config-yaml/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -10,7 +10,6 @@ metadata: guide: "https://quarkus.io/guides/config#yaml" codestart: name: "config-yaml" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/funqy/funqy-http/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/funqy/funqy-http/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 2aeee3ab9503c8..74f01f7f2cee75 100644 --- a/extensions/funqy/funqy-http/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/funqy/funqy-http/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -10,6 +10,5 @@ metadata: status: "experimental" codestart: name: "funqy-http" - kind: "example" languages: "java" artifact: "io.quarkus:quarkus-project-core-extension-codestarts" diff --git a/extensions/logging-json/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/logging-json/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 1204e402130871..b86d2e3b778d7f 100644 --- a/extensions/logging-json/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/logging-json/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -9,10 +9,3 @@ metadata: - "core" status: "preview" guide: "https://quarkus.io/guides/logging#json-logging" - codestart: - name: "logging-json" - kind: "example" - languages: - - "java" - - "kotlin" - artifact: "io.quarkus:quarkus-project-core-extension-codestarts" \ No newline at end of file diff --git a/extensions/picocli/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/picocli/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 7bc9f799d026c4..26377d23af48c6 100644 --- a/extensions/picocli/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/picocli/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -9,7 +9,6 @@ metadata: status: "experimental" codestart: name: "picocli" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-classic/resteasy-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-classic/resteasy-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml index b5c836c5a9080d..6dd65780d0a36a 100644 --- a/extensions/resteasy-classic/resteasy-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-classic/resteasy-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -12,10 +12,3 @@ metadata: - "web" - "serialization" status: "stable" - codestart: - name: "resteasy-jackson" - kind: "example" - languages: - - "java" - - "kotlin" - artifact: "io.quarkus:quarkus-project-core-extension-codestarts" diff --git a/extensions/resteasy-classic/resteasy-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-classic/resteasy-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml index f6cf411f8601ec..6433a304f90829 100644 --- a/extensions/resteasy-classic/resteasy-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-classic/resteasy-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -11,7 +11,6 @@ metadata: status: "experimental" codestart: name: "resteasy-qute" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-classic/resteasy/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-classic/resteasy/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 5e00f4a8b8e4e3..5c211e4a81f054 100644 --- a/extensions/resteasy-classic/resteasy/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-classic/resteasy/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -12,7 +12,6 @@ metadata: status: "stable" codestart: name: "resteasy" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 5f0a942727e55c..fa2cf527f96fa4 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -16,7 +16,6 @@ metadata: status: "experimental" codestart: name: "resteasy-reactive" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/src/main/resources/META-INF/quarkus-extension.yaml index fdbcba4ad76256..2b19e2ea94e933 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -15,7 +15,6 @@ metadata: status: "experimental" codestart: name: "resteasy-reactive" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/runtime/src/main/resources/META-INF/quarkus-extension.yaml index bca80ee52813fc..6f5015609223a1 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -11,7 +11,6 @@ metadata: status: "experimental" codestart: name: "resteasy-reactive" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml index a4ed290c92e1c7..da8a7a32ac1f4b 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -10,7 +10,6 @@ metadata: status: "experimental" codestart: name: "resteasy-reactive" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-servlet/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-servlet/runtime/src/main/resources/META-INF/quarkus-extension.yaml index b61573c084f6fe..98e00fd0e89157 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-servlet/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-servlet/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -12,7 +12,6 @@ metadata: status: "experimental" codestart: name: "resteasy-reactive" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 5b4dfa0e71239b..03324472adbb73 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -11,7 +11,6 @@ metadata: status: "experimental" codestart: name: "resteasy-reactive" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml index eab2a1018bdf34..d5e141fad045dc 100644 --- a/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -15,7 +15,6 @@ metadata: status: "experimental" codestart: name: "resteasy-reactive" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml index f90c09141b2d4e..0813536db403c5 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -10,7 +10,6 @@ metadata: status: "experimental" codestart: name: "resteasy-reactive" - kind: "example" languages: - "java" - "kotlin" diff --git a/extensions/spring-web/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/spring-web/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 974429c85bdcfd..6a89b9b50640c6 100644 --- a/extensions/spring-web/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/spring-web/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -9,7 +9,6 @@ metadata: status: "preview" codestart: name: "spring-web" - kind: "example" languages: - "java" - "kotlin" diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/codestart.yml index 56accde6725055..166616c962f27a 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/codestart.yml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/codestart.yml @@ -6,14 +6,6 @@ language: data: command: class-name: GreetingCommand - subcommands: "{HelloCommand.class, GoodByeCommand.class}" - hello: - name: "hello" - description: "Greet World!" - message: "Hello World!" - goodbye: - name: "goodbye" - description: "Say goodbye to World!" - message: "Goodbye World!" + name: Greeting dependencies: - io.quarkus:quarkus-picocli diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/java/src/{command.class-name}.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/java/src/{command.class-name}.tpl.qute.java index a61da811b5e398..4c3f9096164189 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/java/src/{command.class-name}.tpl.qute.java +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/java/src/{command.class-name}.tpl.qute.java @@ -6,28 +6,19 @@ //JAVAC_OPTIONS -parameters // -import io.quarkus.picocli.runtime.annotations.TopCommand; import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Parameters; -@TopCommand -@CommandLine.Command(mixinStandardHelpOptions = true, subcommands = {command.subcommands}) +@Command(name = "{command.name}", mixinStandardHelpOptions = true) public class {command.class-name} { -} - -@CommandLine.Command(name = "{command.hello.name}", description = "{command.hello.description}") -class HelloCommand implements Runnable { - - @Override - public void run() { - System.out.println("{command.hello.message}"); - } -} -@CommandLine.Command(name = "{command.goodbye.name}", description = "{command.goodbye.description}") -class GoodByeCommand implements Runnable { + @Parameters(paramLabel = "", defaultValue = "picocli", + description = "Your name.") + String name; @Override public void run() { - System.out.println("{command.goodbye.message}"); + System.out.printf("Hello %s, go go commando!\n", name); } } diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/codestart.yml deleted file mode 100644 index 9b0c1ece311d1a..00000000000000 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/codestart.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: commandmode-example -ref: commandmode -type: code -tags: example -metadata: - title: Command Mode example - description: Go go commando with this command mode main class. -language: - base: - data: - main: - class-name: HelloCommando - package-name: org.acme - greeting: - message: "Hello" - default-name: "Commando" - dependencies: - - io.quarkus:quarkus-arc diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/java/src/main/java/org/acme/{main.class-name}.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/java/src/main/java/org/acme/{main.class-name}.tpl.qute.java deleted file mode 100644 index dfc21d94a5acc0..00000000000000 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/java/src/main/java/org/acme/{main.class-name}.tpl.qute.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.acme; - -import javax.enterprise.context.control.ActivateRequestContext; -import javax.inject.Inject; - -import io.quarkus.runtime.Quarkus; -import io.quarkus.runtime.QuarkusApplication; -import io.quarkus.runtime.annotations.QuarkusMain; - -@QuarkusMain -public class {main.class-name} implements QuarkusApplication { - - @Override - public int run(String... args) throws Exception { - final String name = args.length > 0 ? String.join(" ", args) : "{greeting.default-name}"; - System.out.println("{greeting.message} " + name); - return 0; - } -} diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/kotlin/src/main/kotlin/org/acme/{main.class-name}.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/kotlin/src/main/kotlin/org/acme/{main.class-name}.tpl.qute.kt deleted file mode 100644 index 8b326610e49eda..00000000000000 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/kotlin/src/main/kotlin/org/acme/{main.class-name}.tpl.qute.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.acme - -import javax.inject.Inject - -import io.quarkus.runtime.QuarkusApplication -import io.quarkus.runtime.annotations.QuarkusMain - -@QuarkusMain -class {main.class-name}: QuarkusApplication { - - override fun run(vararg args: String?): Int { - val name = if (args.isNotEmpty()) args.joinToString(",") else "{greeting.default-name}" - println(name) - return 0 - } - -} diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/base/README.tpl.qute.md b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/base/README.tpl.qute.md deleted file mode 100644 index 405280158877db..00000000000000 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/base/README.tpl.qute.md +++ /dev/null @@ -1 +0,0 @@ -{#include readme-header /} \ No newline at end of file diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/base/README.tpl.qute.md b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/base/README.tpl.qute.md deleted file mode 100644 index 405280158877db..00000000000000 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/base/README.tpl.qute.md +++ /dev/null @@ -1 +0,0 @@ -{#include readme-header /} \ No newline at end of file diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/base/README.tpl.qute.md b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/base/README.tpl.qute.md deleted file mode 100644 index 405280158877db..00000000000000 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/base/README.tpl.qute.md +++ /dev/null @@ -1 +0,0 @@ -{#include readme-header /} \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/base/README.tpl.qute.md b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/base/README.tpl.qute.md rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/base/README.tpl.qute.md diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/base/src/main/resources/META-INF/resources/index.entry.qute.html b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/base/src/main/resources/META-INF/resources/index.entry.qute.html rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/codestart.yml similarity index 66% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/codestart.yml rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/codestart.yml index 585b0f88623f5d..fba7652b61825e 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/codestart.yml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/codestart.yml @@ -1,17 +1,17 @@ -name: resteasy-example +name: resteasy-codestart ref: resteasy type: code -tags: example +tags: extension-codestart metadata: - title: RESTEasy JAX-RS example - description: REST is easy peasy with this Hello World RESTEasy resource. + title: RESTEasy JAX-RS + description: Easily start your RESTful Web Services related-guide-section: https://quarkus.io/guides/getting-started#the-jax-rs-resources language: base: data: resource: class-name: GreetingResource - path: "/hello-resteasy" + path: "/easy" response: "Hello RESTEasy" dependencies: - io.quarkus:quarkus-resteasy diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/README.tpl.qute.md b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/base/README.tpl.qute.md similarity index 100% rename from devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/README.tpl.qute.md rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/base/README.tpl.qute.md diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/base/src/main/resources/META-INF/resources/index.entry.qute.html b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/base/src/main/resources/META-INF/resources/index.entry.qute.html rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/codestart.yml similarity index 64% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/codestart.yml rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/codestart.yml index 163a7d1048b9c1..590dad9705b194 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/codestart.yml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/codestart.yml @@ -1,17 +1,17 @@ -name: resteasy-reactive-example +name: resteasy-reactive-codestart ref: resteasy-reactive type: code -tags: example +tags: extension-codestart metadata: - title: RESTEasy Reactive example - description: Rest is easy peasy & reactive with this Hello World RESTEasy Reactive resource. + title: RESTEasy Reactive + description: Easily start your Reactive RESTful Web Services related-guide-section: https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources language: base: data: resource: class-name: ReactiveGreetingResource - path: "/hello-resteasy-reactive" + path: "/easy" response: "Hello RESTEasy Reactive" dependencies: - io.quarkus:quarkus-resteasy-reactive diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/base/README.tpl.qute.md b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/base/README.tpl.qute.md similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/base/README.tpl.qute.md rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/base/README.tpl.qute.md diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/base/src/main/resources/META-INF/resources/index.entry.qute.html b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/base/src/main/resources/META-INF/resources/index.entry.qute.html rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/codestart.yml similarity index 59% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/codestart.yml rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/codestart.yml index a4c51fa3e6ba81..015b84e373f140 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/codestart.yml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/codestart.yml @@ -1,17 +1,17 @@ -name: spring-web-example +name: spring-web-codestart ref: spring-web type: code -tags: example +tags: extension-codestart metadata: - title: Spring Web example - description: Spring, the Quarkus way! A Hello World Spring Web Controller. + title: Spring Web + description: Spring, the Quarkus way! Start your RESTful Web Services with a Spring Controller. related-guide-section: https://quarkus.io/guides/spring-web#greetingcontroller language: base: data: resource: - class-name: SpringGreetingController - path: "/hello-spring" + class-name: GreetingController + path: "/hello" response: "Hello Spring" package-name: org.acme dependencies: diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala rename to independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/spring-web-codestart/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/README.tpl.qute.md b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/README.tpl.qute.md index a932a3ed00626c..ca98c75e4515ca 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/README.tpl.qute.md +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/README.tpl.qute.md @@ -1,4 +1,4 @@ -# {project.artifact-id} project +# {project.artifact-id} Project This project uses Quarkus, the Supersonic Subatomic Java Framework. @@ -46,7 +46,7 @@ You can then execute your native executable with: `./{buildtool.build-dir}/{proj If you want to learn more about building native executables, please consult {buildtool.guide}. {#if input.selected-extensions} -## Related guides +## Related Guides {#for ext in input.selected-extensions} {#if ext.guide} @@ -54,8 +54,7 @@ If you want to learn more about building native executables, please consult {bui {/if} {/for} {/if} -{#if input.selected-examples} - -## Provided examples +{#if input.provided-code} +## Provided Code {/if} diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/index-entry.include.qute b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/index-entry.include.qute index c11ee97da52d25..ffa3c4a86bd442 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/index-entry.include.qute +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/index-entry.include.qute @@ -1,4 +1,4 @@ -
+

{title}

{description}

{#if path}

@Path: {path}

{/if} diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/src/main/resources/META-INF/resources/index.tpl.qute.html b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/src/main/resources/META-INF/resources/index.tpl.qute.html index 7106cecab53f61..6acd81cc100e6c 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/src/main/resources/META-INF/resources/index.tpl.qute.html +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/project/quarkus/base/src/main/resources/META-INF/resources/index.tpl.qute.html @@ -96,12 +96,12 @@ padding-left: 0; } - .example-code { + .provided-code { border-left: 0.3rem solid #71aeef; padding-left: 10px; } - .example-code h3 { + .provided-code h3 { font-weight: 200; } @@ -129,7 +129,7 @@

What are your next steps?

  • Your static assets are located in src/main/resources/META-INF/resources.
  • Configure your application in src/main/resources/{config.file-name}.
  • Quarkus now ships with a Dev UI (available in dev mode only)
  • -
  • Play with the getting started example code located in {language.dir.code}:
  • +
  • Play with the provided code located in {language.dir.code}:
  • {merged-content}
    diff --git a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/Codestart.java b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/Codestart.java index a5fc82a2afea75..78eedc3781b94e 100644 --- a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/Codestart.java +++ b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/Codestart.java @@ -4,6 +4,7 @@ import io.quarkus.devtools.codestarts.utils.NestedMaps; import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Stream; @@ -49,6 +50,10 @@ public int getTypeOrder() { return spec.getType().getProcessingOrder(); } + public boolean matches(String name) { + return Objects.equals(spec.getName(), name) || Objects.equals(spec.getRef(), name); + } + public boolean isSelected(Set selection) { return selection.contains(getName()) || selection.contains(spec.getRef()); } diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalog.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalog.java index 8b550bf04a15d8..af352edd4bb407 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalog.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalog.java @@ -2,6 +2,7 @@ import static io.quarkus.devtools.codestarts.CodestartResourceLoader.loadCodestartsFromResources; import static io.quarkus.devtools.codestarts.core.CodestartCatalogs.findLanguageName; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.AppContent.CODE; import static io.quarkus.devtools.project.QuarkusProjectHelper.getCodestartResourceLoaders; import static io.quarkus.platform.catalog.processor.ExtensionProcessor.getCodestartName; import static io.quarkus.platform.catalog.processor.ExtensionProcessor.getGuide; @@ -22,7 +23,6 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -37,12 +37,18 @@ public final class QuarkusCodestartCatalog extends GenericCodestartCatalog extensionsMapping; + public enum AppContent implements DataKey { + BUILD_TOOL_WRAPPER, + DOCKERFILES, + CODE, + } + public enum Tag implements DataKey { + EXTENSION_CODESTART, EXAMPLE, - SINGLETON_EXAMPLE, MAVEN_ONLY; } @@ -58,9 +64,10 @@ public enum Tooling implements DataKey { DOCKERFILES } - public enum Example implements DataKey { - RESTEASY_EXAMPLE, - COMMANDMODE_EXAMPLE + public enum ExtensionCodestart implements DataKey { + RESTEASY, + RESTEAST_REACTIVE, + SPRING_WEB } private QuarkusCodestartCatalog(Collection codestarts, @@ -97,23 +104,24 @@ protected Collection select(QuarkusCodestartProjectInput projectInput // Add codestarts from extension and for tooling projectInput.getSelection().addNames(getExtensionCodestarts(projectInput)); projectInput.getSelection().addNames(getToolingCodestarts(projectInput)); - projectInput.getSelection().addNames(projectInput.getOverrideExamples()); + if (projectInput.getExample() != null) { + projectInput.getSelection().addName(projectInput.getExample()); + } - // Filter out examples if noExamples + // Filter out extension codestarts and examples final List projectCodestarts = super.select(projectInput).stream() - .filter(c -> !isExample(c) || !projectInput.noExamples()) - .filter(c -> !isExample(c) || projectInput.getOverrideExamples().isEmpty() - || c.isSelected(projectInput.getOverrideExamples())) + .filter(c -> c.getType() != CodestartType.CODE || projectInput.getAppContent().contains(CODE)) + .filter(c -> !isExample(c) || projectInput.getExample() == null || c.matches(projectInput.getExample())) .collect(Collectors.toCollection(ArrayList::new)); - // include default example codestarts if none selected - if (!projectInput.noExamples() + // include default codestarts if no code selected + if (projectInput.getAppContent().contains(CODE) && projectCodestarts.stream() - .noneMatch(c -> isExample(c) && !c.getSpec().isPreselected())) { + .noneMatch(c -> c.getType() == CodestartType.CODE && !c.getSpec().isPreselected())) { final Codestart defaultCodestart = codestarts.stream() - .filter(c -> c.isSelected(Collections.singleton(Example.RESTEASY_EXAMPLE.key()))) + .filter(c -> c.matches(ExtensionCodestart.RESTEASY.key())) .findFirst().orElseThrow(() -> new CodestartStructureException( - Example.RESTEASY_EXAMPLE.key() + " codestart not found")); + ExtensionCodestart.RESTEASY.key() + " codestart not found")); final String languageName = findLanguageName(projectCodestarts); if (defaultCodestart.implementsLanguage(languageName)) { projectCodestarts.add(defaultCodestart); @@ -125,18 +133,17 @@ protected Collection select(QuarkusCodestartProjectInput projectInput } } - // check compatibility issues - final long examplesWithCompatIssues = projectCodestarts.stream() + // check only one example + final long examples = projectCodestarts.stream() .filter(QuarkusCodestartCatalog::isExample) - .filter(c -> c.containsTag(Tag.SINGLETON_EXAMPLE.key())) .count(); - if (examplesWithCompatIssues == 1) { + if (examples == 1) { // remove other examples - projectCodestarts.removeIf(c -> isExample(c) && !c.containsTag(Tag.SINGLETON_EXAMPLE.key())); - } else if (examplesWithCompatIssues > 1) { + projectCodestarts.removeIf(c -> !isExample(c)); + } else if (examples > 1) { throw new CodestartException( - "Only one extension with singleton example can be selected at a time (you can always use 'noExamples' if needed)"); + "Only example can be selected at a time (you can always use 'noCode' if needed)"); } projectInput.getData().putAll(generateSelectionData(projectInput, projectCodestarts)); @@ -161,7 +168,7 @@ private Stream getSelectedExtensionsAsStream(QuarkusCodestartProjectI private List getToolingCodestarts(QuarkusCodestartProjectInput projectInput) { final List codestarts = new ArrayList<>(); codestarts.add(projectInput.getBuildTool().getKey()); - if (!projectInput.noBuildToolWrapper()) { + if (projectInput.getAppContent().contains(AppContent.BUILD_TOOL_WRAPPER)) { switch (projectInput.getBuildTool()) { case GRADLE: case GRADLE_KOTLIN_DSL: @@ -174,7 +181,7 @@ private List getToolingCodestarts(QuarkusCodestartProjectInput projectIn throw new IllegalArgumentException("Unsupported build tool wrapper: " + projectInput.getBuildTool()); } } - if (!projectInput.noDockerfiles()) { + if (projectInput.getAppContent().contains(AppContent.DOCKERFILES)) { codestarts.add(QuarkusCodestartCatalog.Tooling.DOCKERFILES.key()); } return codestarts; @@ -184,8 +191,8 @@ private Map generateSelectionData(QuarkusCodestartProjectInput p List projectCodestarts) { Map data = new HashMap<>(); final Map inputData = new HashMap<>(); - inputData.put(INPUT_SELECTED_EXAMPLES_KEY, - projectCodestarts.stream().filter(QuarkusCodestartCatalog::isExample).map(c -> { + inputData.put(INPUT_PROVIDED_CODE_KEY, + projectCodestarts.stream().filter(c -> c.getType() == CodestartType.CODE).map(c -> { Map eData = new HashMap<>(); eData.put("name", c.getName()); eData.put("tags", c.getTags()); @@ -205,8 +212,12 @@ private Map generateSelectionData(QuarkusCodestartProjectInput p return data; } + public static boolean isExtensionCodestart(Codestart codestart) { + return codestart.getType() == CodestartType.CODE && codestart.containsTag(Tag.EXTENSION_CODESTART.key()); + } + public static boolean isExample(Codestart codestart) { - return codestart.getType() == CodestartType.CODE && codestart.getSpec().getTags().contains(Tag.EXAMPLE.key()); + return codestart.getType() == CodestartType.CODE && codestart.containsTag(Tag.EXAMPLE.key()); } private static Map buildExtensionsMapping( diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartData.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartData.java index ba6d52cbdb97a1..14240b7cf274cc 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartData.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartData.java @@ -36,20 +36,14 @@ public enum QuarkusDataKey implements DataKey { MAVEN_COMPILER_PLUGIN_VERSION("maven-compiler-plugin.version"), MAVEN_SUREFIRE_PLUGIN_VERSION("maven-surefire-plugin.version"), - RESTEASY_EXAMPLE_RESOURCE_PATH("resteasy-example.resource.path"), - RESTEASY_EXAMPLE_RESOURCE_CLASS_NAME("resteasy-example.resource.class-name"), + RESTEASY_CODESTART_RESOURCE_PATH("resteasy-codestart.resource.path"), + RESTEASY_CODESTART_RESOURCE_CLASS_NAME("resteasy-codestart.resource.class-name"), - RESTEASY_REACTIVE_EXAMPLE_RESOURCE_PATH("resteasy-reactive-example.resource.path"), - RESTEASY_REACTIVE_EXAMPLE_RESOURCE_CLASS_NAME("resteasy-reactive-example.resource.class-name"), + RESTEASY_REACTIVE_CODESTART_RESOURCE_PATH("resteasy-reactive-codestart.resource.path"), + RESTEASY_REACTIVE_CODESTART_RESOURCE_CLASS_NAME("resteasy-reactive-codestart.resource.class-name"), - SPRING_WEB_EXAMPLE_RESOURCE_PATH("spring-web-example.resource.path"), - SPRING_WEB_EXAMPLE_RESOURCE_CLASS_NAME("spring-web-example.resource.class-name"), - - COMMANDMODE_EXAMPLE_RESOURCE_CLASS_NAME("commandmode-example.main.class-name"), - - NO_EXAMPLES("quarkus-project.no-examples"), - NO_BUILD_TOOL_WRAPPER("quarkus-project.no-build-tool-wrapper"), - NO_DOCKERFILES("quarkus-project.no-dockerfiles"); + SPRING_WEB_CODESTART_RESOURCE_PATH("spring-web-codestart.resource.path"), + SPRING_WEB_CODESTART_RESOURCE_CLASS_NAME("spring-web-codestart.resource.class-name"); private final String key; @@ -85,14 +79,14 @@ public enum LegacySupport implements DataKey { MAVEN_COMPILER_PLUGIN_VERSION("compiler_plugin_version"), MAVEN_SUREFIRE_PLUGIN_VERSION("surefire_plugin_version"), - RESTEASY_EXAMPLE_RESOURCE_PATH("path"), - RESTEASY_EXAMPLE_RESOURCE_CLASS_NAME(QuarkusCodestartData::convertClassName), + RESTEASY_CODESTART_RESOURCE_PATH("path"), + RESTEASY_CODESTART_RESOURCE_CLASS_NAME(QuarkusCodestartData::convertClassName), - RESTEASY_REACTIVE_EXAMPLE_RESOURCE_PATH("path"), - RESTEASY_REACTIVE_EXAMPLE_RESOURCE_CLASS_NAME(QuarkusCodestartData::convertClassName), + RESTEASY_REACTIVE_CODESTART_RESOURCE_PATH("path"), + RESTEASY_REACTIVE_CODESTART_RESOURCE_CLASS_NAME(QuarkusCodestartData::convertClassName), - SPRING_WEB_EXAMPLE_RESOURCE_PATH("path"), - SPRING_WEB_EXAMPLE_RESOURCE_CLASS_NAME(QuarkusCodestartData::convertClassName); + SPRING_WEB_CODESTART_RESOURCE_PATH("path"), + SPRING_WEB_CODESTART_RESOURCE_CLASS_NAME(QuarkusCodestartData::convertClassName); private final String key; private final Function, Object> converter; diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartProjectInput.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartProjectInput.java index ddd1fc8b0c61b4..90f54683aea726 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartProjectInput.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartProjectInput.java @@ -3,6 +3,7 @@ import static java.util.Objects.requireNonNull; import io.quarkus.devtools.codestarts.CodestartProjectInput; +import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.AppContent; import io.quarkus.devtools.project.BuildTool; import io.quarkus.maven.ArtifactCoords; import java.util.Collection; @@ -11,19 +12,15 @@ public final class QuarkusCodestartProjectInput extends CodestartProjectInput { private final BuildTool buildTool; private final Collection extensions; - private final Set overrideExamples; - private final boolean noExamples; - private final boolean noDockerfiles; - private final boolean noBuildToolWrapper; + private final String example; + private Set appContent; public QuarkusCodestartProjectInput(QuarkusCodestartProjectInputBuilder builder) { super(builder); this.extensions = builder.extensions; - this.overrideExamples = builder.overrideExamples; + this.example = builder.example; this.buildTool = requireNonNull(builder.buildTool, "buildTool is required"); - this.noExamples = builder.noExamples; - this.noDockerfiles = builder.noDockerfiles; - this.noBuildToolWrapper = builder.noBuildToolWrapper; + this.appContent = builder.appContent; } public static QuarkusCodestartProjectInputBuilder builder() { @@ -34,20 +31,12 @@ public Collection getExtensions() { return extensions; } - public Set getOverrideExamples() { - return overrideExamples; + public String getExample() { + return example; } - public boolean noExamples() { - return noExamples; - } - - public boolean noDockerfiles() { - return noDockerfiles; - } - - public boolean noBuildToolWrapper() { - return noBuildToolWrapper; + public Set getAppContent() { + return appContent; } public BuildTool getBuildTool() { diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartProjectInputBuilder.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartProjectInputBuilder.java index 0111f446cadc40..00ca78c79c20c8 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartProjectInputBuilder.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartProjectInputBuilder.java @@ -2,25 +2,28 @@ import io.quarkus.devtools.codestarts.CodestartProjectInputBuilder; import io.quarkus.devtools.codestarts.DataKey; +import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.AppContent; import io.quarkus.devtools.messagewriter.MessageWriter; import io.quarkus.devtools.project.BuildTool; import io.quarkus.devtools.project.extensions.Extensions; import io.quarkus.maven.ArtifactCoords; import io.quarkus.maven.ArtifactKey; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; public class QuarkusCodestartProjectInputBuilder extends CodestartProjectInputBuilder { + private static final List FULL_CONTENT = Arrays.asList(AppContent.values()); + Collection extensions = new ArrayList<>(); - Set overrideExamples = new HashSet<>(); - boolean noExamples; - boolean noDockerfiles; - boolean noBuildToolWrapper; + Set appContent = new HashSet<>(FULL_CONTENT); + String example; BuildTool buildTool = BuildTool.MAVEN; QuarkusCodestartProjectInputBuilder() { @@ -41,13 +44,8 @@ public QuarkusCodestartProjectInputBuilder addExtension(ArtifactKey extension) { return this.addExtension(Extensions.toCoords(extension, null)); } - public QuarkusCodestartProjectInputBuilder addOverrideExamples(Collection overrideExamples) { - this.overrideExamples.addAll(overrideExamples); - return this; - } - - public QuarkusCodestartProjectInputBuilder addExample(String overrideExample) { - this.overrideExamples.add(overrideExample); + public QuarkusCodestartProjectInputBuilder example(String example) { + this.example = example; return this; } @@ -87,12 +85,16 @@ public QuarkusCodestartProjectInputBuilder messageWriter(MessageWriter messageWr return this; } - public QuarkusCodestartProjectInputBuilder noExamples() { - return this.noExamples(true); + public QuarkusCodestartProjectInputBuilder noCode() { + return this.noCode(true); } - public QuarkusCodestartProjectInputBuilder noExamples(boolean noExamples) { - this.noExamples = noExamples; + public QuarkusCodestartProjectInputBuilder noCode(boolean noCode) { + if (noCode) { + appContent.remove(AppContent.CODE); + } else { + appContent.add(AppContent.CODE); + } return this; } @@ -101,7 +103,11 @@ public QuarkusCodestartProjectInputBuilder noDockerfiles() { } public QuarkusCodestartProjectInputBuilder noDockerfiles(boolean noDockerfiles) { - this.noDockerfiles = noDockerfiles; + if (noDockerfiles) { + appContent.remove(AppContent.DOCKERFILES); + } else { + appContent.add(AppContent.DOCKERFILES); + } return this; } @@ -110,7 +116,11 @@ public QuarkusCodestartProjectInputBuilder noBuildToolWrapper() { } public QuarkusCodestartProjectInputBuilder noBuildToolWrapper(boolean noBuildToolWrapper) { - this.noBuildToolWrapper = noBuildToolWrapper; + if (noBuildToolWrapper) { + appContent.remove(AppContent.BUILD_TOOL_WRAPPER); + } else { + appContent.add(AppContent.BUILD_TOOL_WRAPPER); + } return this; } diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateProject.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateProject.java index 0c78f241e84e5c..f0081d35f04a5b 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateProject.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateProject.java @@ -33,9 +33,8 @@ public class CreateProject { public static final String NO_DOCKERFILES = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "no-dockerfiles"); public static final String NO_BUILDTOOL_WRAPPER = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "no-buildtool-wrapper"); - public static final String NO_EXAMPLES = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "no-examples"); - public static final String CODESTARTS = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "codestarts"); - public static final String OVERRIDE_EXAMPLES = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "examples"); + public static final String NO_CODE = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "no-code"); + public static final String EXAMPLE = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "example"); private static final Pattern JAVA_VERSION_PATTERN = Pattern.compile("(?:1\\.)?(\\d+)(?:\\..*)?"); @@ -134,23 +133,18 @@ public CreateProject extensions(Set extensions) { return this; } - public CreateProject codestarts(Set codestarts) { - setValue(CODESTARTS, codestarts); + public CreateProject example(String example) { + setValue(EXAMPLE, example); return this; } - public CreateProject overrideExamples(Set overrideExamples) { - setValue(OVERRIDE_EXAMPLES, overrideExamples); + public CreateProject noCode(boolean value) { + setValue(NO_CODE, value); return this; } - public CreateProject noExamples(boolean value) { - setValue(NO_EXAMPLES, value); - return this; - } - - public CreateProject noExamples() { - return noExamples(true); + public CreateProject noCode() { + return noCode(true); } public CreateProject noBuildToolWrapper(boolean value) { diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java index d2ad85cee823ef..960cdc39391574 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java @@ -1,10 +1,9 @@ package io.quarkus.devtools.commands.handlers; -import static io.quarkus.devtools.commands.CreateProject.CODESTARTS; +import static io.quarkus.devtools.commands.CreateProject.EXAMPLE; import static io.quarkus.devtools.commands.CreateProject.NO_BUILDTOOL_WRAPPER; +import static io.quarkus.devtools.commands.CreateProject.NO_CODE; import static io.quarkus.devtools.commands.CreateProject.NO_DOCKERFILES; -import static io.quarkus.devtools.commands.CreateProject.NO_EXAMPLES; -import static io.quarkus.devtools.commands.CreateProject.OVERRIDE_EXAMPLES; import static io.quarkus.devtools.commands.handlers.QuarkusCommandHandlers.computeCoordsFromQuery; import static io.quarkus.devtools.project.codegen.ProjectGenerator.BOM_ARTIFACT_ID; import static io.quarkus.devtools.project.codegen.ProjectGenerator.BOM_GROUP_ID; @@ -30,7 +29,6 @@ import java.io.IOException; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; @@ -93,9 +91,8 @@ public QuarkusCommandOutcome execute(QuarkusCommandInvocation invocation) throws final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() .addExtensions(extensionsToAdd) .buildTool(invocation.getQuarkusProject().getBuildTool()) - .addOverrideExamples(invocation.getValue(OVERRIDE_EXAMPLES, new HashSet<>())) - .addCodestarts(invocation.getValue(CODESTARTS, new HashSet<>())) - .noExamples(invocation.getValue(NO_EXAMPLES, false)) + .example(invocation.getValue(EXAMPLE)) + .noCode(invocation.getValue(NO_CODE, false)) .noBuildToolWrapper(invocation.getValue(NO_BUILDTOOL_WRAPPER, false)) .noDockerfiles(invocation.getValue(NO_DOCKERFILES, false)) .addData(platformData) diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/ExtensionProcessor.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/ExtensionProcessor.java index ff50a14cc703f2..a729a2b6d6fa7b 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/ExtensionProcessor.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/ExtensionProcessor.java @@ -11,15 +11,15 @@ public final class ExtensionProcessor { private static final String STABLE_STATS = "stable"; - public static final String PROVIDES_EXAMPLE_TAG = "provides-example"; + public static final String PROVIDES_CODE_TAG = "provides-code"; public enum CodestartKind { CORE, - EXAMPLE, - SINGLETON_EXAMPLE; + EXTENSION_CODESTART, + EXAMPLE; - public boolean isExample() { - return name().contains("EXAMPLE"); + public boolean providesCode() { + return this == EXTENSION_CODESTART || this == EXAMPLE; } } @@ -59,12 +59,13 @@ public static String getCodestartArtifact(Extension extension) { } public static CodestartKind getCodestartKind(Extension extension) { - return getMetadataValue(extension, MD_NESTED_CODESTART_KIND).toEnum(CodestartKind.class); + return getMetadataValue(extension, MD_NESTED_CODESTART_KIND).toEnum(CodestartKind.class, + CodestartKind.EXTENSION_CODESTART); } - public static boolean providesExampleCode(Extension extension) { + public static boolean providesCode(Extension extension) { final CodestartKind codestartKind = getCodestartKind(extension); - return codestartKind != null && codestartKind.isExample(); + return codestartKind != null && codestartKind.providesCode(); } public static boolean isUnlisted(Extension extension) { @@ -101,8 +102,8 @@ public static List getTags(Extension extension, String customStatusKey) .filter(tag -> !STABLE_STATS.equals(tag)) .map(String::toLowerCase) .collect(Collectors.toCollection(ArrayList::new)); - if (providesExampleCode(extension)) { - tags.add(PROVIDES_EXAMPLE_TAG); + if (providesCode(extension)) { + tags.add(PROVIDES_CODE_TAG); } return tags; } @@ -142,8 +143,8 @@ public CodestartKind getCodestartKind() { return getCodestartKind(extension); } - public boolean providesExampleCode() { - return providesExampleCode(extension); + public boolean providesCode() { + return providesCode(extension); } public boolean isUnlisted() { @@ -179,8 +180,8 @@ public List getTags(String customStatusKey) { .filter(tag -> !STABLE_STATS.equals(tag)) .map(String::toLowerCase) .collect(Collectors.toCollection(ArrayList::new)); - if (providesExampleCode()) { - tags.add(PROVIDES_EXAMPLE_TAG); + if (providesCode()) { + tags.add(PROVIDES_CODE_TAG); } return tags; } diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/MetadataValue.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/MetadataValue.java index 3e24f24ad7ea4c..954cf6c12291ee 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/MetadataValue.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/MetadataValue.java @@ -63,9 +63,13 @@ public boolean asBoolean() { } public > T toEnum(Class clazz) { + return toEnum(clazz, null); + } + + public > T toEnum(Class clazz, T defaultValue) { final String name = asString(); if (name == null) { - return null; + return defaultValue; } return T.valueOf(clazz, name.toUpperCase().replace("-", "_")); } diff --git a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTest.java b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTest.java index 0c83dfc9dfc294..e263d0b178617e 100644 --- a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTest.java +++ b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTest.java @@ -21,6 +21,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -41,10 +42,11 @@ public class QuarkusCodestartTest implements BeforeAllCallback, AfterAllCallback private final Set codestarts; private final Set languages; + private final Map data; private final AtomicReference currentTestContext = new AtomicReference<>(); private final BuildTool buildTool; - private final boolean skipGenerateRealDataProject; - private final boolean skipGenerateMockedDataProject; + private final Set hasGeneratedProjectsWithMockedData = new HashSet<>(); + private final Set hasGeneratedProjectsWithRealData = new HashSet<>(); private Path targetDir; private ExtensionCatalog extensionCatalog; private QuarkusCodestartCatalog quarkusCodestartCatalog; @@ -53,8 +55,7 @@ public class QuarkusCodestartTest implements BeforeAllCallback, AfterAllCallback this.codestarts = builder.codestarts; this.languages = builder.languages; this.buildTool = builder.buildTool; - skipGenerateRealDataProject = builder.skipGenerateRealDataProject; - skipGenerateMockedDataProject = builder.skipGenerateMockedDataProject; + this.data = builder.data; } public static QuarkusCodestartTestBuilder builder() { @@ -66,14 +67,6 @@ public void beforeAll(ExtensionContext extensionContext) throws Exception { enableRegistryClientTestConfig(); targetDir = Paths.get("target/quarkus-codestart-test/" + getTestId()); SnapshotTesting.deleteTestDirectory(targetDir.toFile()); - for (Language language : languages) { - if (!skipGenerateMockedDataProject) { - generateMockedDataProject(language); - } - if (!skipGenerateRealDataProject) { - generateRealDataProject(language); - } - } } private String getTestId() { @@ -99,22 +92,28 @@ public ExtensionCatalog getExtensionsCatalog() { return extensionCatalog; } - private void generateRealDataProject(Language language) throws IOException { - generateProject(getProjectWithRealDataDir(language), language, - getRealTestInputData(getExtensionsCatalog(), Collections.emptyMap())); + private void generateRealDataProjectIfNeeded(Path path, Language language) throws IOException { + if (!hasGeneratedProjectsWithRealData.contains(language)) { + generateProject(path, language, + getRealTestInputData(getExtensionsCatalog(), Collections.emptyMap())); + } + hasGeneratedProjectsWithRealData.add(language); } - private void generateMockedDataProject(Language language) throws IOException { - generateProject(getProjectWithMockedDataDir(language), language, getMockedTestInputData(Collections.emptyMap())); + private void generateMockedDataProjectIfNeeded(Path path, Language language) throws IOException { + if (!hasGeneratedProjectsWithMockedData.contains(language)) { + generateProject(path, language, getMockedTestInputData(Collections.emptyMap())); + } + hasGeneratedProjectsWithMockedData.add(language); } - public void buildAllProjects() { + public void buildAllProjects() throws IOException { for (Language language : languages) { buildProject(language); } } - public void buildProject(Language language) { + public void buildProject(Language language) throws IOException { final int exitCode = WrapperRunner.run(getProjectWithRealDataDir(language)); Assertions.assertThat(exitCode).as("Run project return status is zero").isZero(); } @@ -181,17 +180,22 @@ private void generateProject(Path projectDir, Language language, Map data = new HashMap<>(); BuildTool buildTool; Set codestarts; Set languages; - boolean skipGenerateRealDataProject; - boolean skipGenerateMockedDataProject; public QuarkusCodestartTestBuilder codestarts(String... codestarts) { this.codestarts = new HashSet<>(Arrays.asList(codestarts)); @@ -28,13 +30,13 @@ public QuarkusCodestartTestBuilder buildTool(BuildTool buildTool) { return this; } - public QuarkusCodestartTestBuilder skipGenerateRealDataProject() { - this.skipGenerateRealDataProject = true; + public QuarkusCodestartTestBuilder putData(String key, Object value) { + this.data.put(key, value); return this; } - public QuarkusCodestartTestBuilder skipGenerateMockedDataProject() { - this.skipGenerateMockedDataProject = true; + public QuarkusCodestartTestBuilder putData(DataKey key, Object value) { + this.data.put(key.key(), value); return this; } diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalogTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalogTest.java index 68a7a8aa745096..4d48844378eec0 100644 --- a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalogTest.java +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalogTest.java @@ -32,15 +32,10 @@ void loadTest() throws IOException { .extracting(Codestart::getImplementedLanguages) .allSatisfy(s -> assertThat(s.isEmpty() || s.size() == 3).isTrue()); - assertThat(catalog.getCodestarts()).filteredOn("ref", "commandmode") + assertThat(catalog.getCodestarts()).filteredOn("ref", "resteasy-reactive") .extracting(Codestart::getImplementedLanguages) .hasSize(1) - .allSatisfy(s -> assertThat(s).containsExactlyInAnyOrder("java", "kotlin")); - - assertThat(catalog.getCodestarts()).filteredOn("ref", "resteasy-qute") - .extracting(Codestart::getImplementedLanguages) - .hasSize(1) - .allSatisfy(s -> assertThat(s).containsExactlyInAnyOrder("java", "kotlin")); + .allSatisfy(s -> assertThat(s).containsExactlyInAnyOrder("java", "kotlin", "scala")); assertThat(catalog.getCodestarts()).filteredOn("ref", "resteasy") .extracting(Codestart::getImplementedLanguages) @@ -51,7 +46,7 @@ void loadTest() throws IOException { @Test void createProjectTestEmpty() throws IOException { final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .noExamples() + .noCode() .noBuildToolWrapper() .noDockerfiles() .build(); @@ -72,7 +67,7 @@ void createProjectTestEmpty() throws IOException { @Test void createProjectTestNoExample() throws IOException { final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .noExamples() + .noCode() .build(); final CodestartProjectDefinition projectDefinition = getCatalog().createProject(input); assertThat(projectDefinition.getRequiredCodestart(CodestartType.PROJECT)).extracting(Codestart::getName) @@ -141,22 +136,7 @@ void prepareProjectTestResteasy() throws IOException { .containsExactlyInAnyOrder( "dockerfiles", "maven-wrapper", - "resteasy-example"); - } - - @Test - void prepareProjectTestCommandMode() throws IOException { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .addCodestart("commandmode") - .build(); - final CodestartProjectDefinition projectDefinition = getCatalog().createProject(input); - assertThat(projectDefinition.getBaseCodestarts()).extracting(Codestart::getName) - .contains("config-properties"); - assertThat(projectDefinition.getExtraCodestarts()).extracting(Codestart::getName) - .containsExactlyInAnyOrder( - "dockerfiles", - "maven-wrapper", - "commandmode-example"); + "resteasy-codestart"); } private QuarkusCodestartCatalog getCatalog() throws IOException { diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java index 1134de2841d16a..7ae5b598208523 100644 --- a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java @@ -1,9 +1,8 @@ package io.quarkus.devtools.codestarts.quarkus; -import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.COMMANDMODE_EXAMPLE_RESOURCE_CLASS_NAME; import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.PROJECT_PACKAGE_NAME; -import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.RESTEASY_EXAMPLE_RESOURCE_CLASS_NAME; -import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.RESTEASY_EXAMPLE_RESOURCE_PATH; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.RESTEASY_CODESTART_RESOURCE_CLASS_NAME; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.RESTEASY_CODESTART_RESOURCE_PATH; import static io.quarkus.devtools.testing.SnapshotTesting.assertThatMatchSnapshot; import static io.quarkus.devtools.testing.SnapshotTesting.checkContains; import static org.assertj.core.api.Assertions.assertThat; @@ -39,7 +38,7 @@ private Map getGenerationTestInputData() { @Test void generateDefault(TestInfo testInfo) throws Throwable { final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .noExamples() + .noCode() .noDockerfiles() .noBuildToolWrapper() .addData(getGenerationTestInputData()) @@ -59,51 +58,14 @@ void generateDefault(TestInfo testInfo) throws Throwable { assertThat(projectDir.resolve("src/main/java")).exists().isEmptyDirectory(); } - @Test - void generateCommandMode(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .addCodestart("commandmode") - .addData(getGenerationTestInputData()) - .build(); - - final Path projectDir = testDirPath.resolve("commandmode"); - getCatalog().createProject(input).generate(projectDir); - - checkMaven(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.MAVEN); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/org/acme/HelloCommando.java"); - } - - @Test - void generateCommandModeCustom(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .addCodestart("commandmode") - .addData(getGenerationTestInputData()) - .putData(PROJECT_PACKAGE_NAME.key(), "com.test.andy") - .putData(COMMANDMODE_EXAMPLE_RESOURCE_CLASS_NAME.key(), "AndyCommando") - .build(); - final Path projectDir = testDirPath.resolve("commandmode-custom"); - getCatalog().createProject(input).generate(projectDir); - - checkMaven(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.MAVEN); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/com/test/andy/AndyCommando.java"); - } - @Test void generateRESTEasyJavaCustom(TestInfo testInfo) throws Throwable { final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() .addData(getGenerationTestInputData()) .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) .putData(PROJECT_PACKAGE_NAME.key(), "com.andy") - .putData(RESTEASY_EXAMPLE_RESOURCE_CLASS_NAME.key(), "BonjourResource") - .putData(RESTEASY_EXAMPLE_RESOURCE_PATH.key(), "/bonjour") + .putData(RESTEASY_CODESTART_RESOURCE_CLASS_NAME.key(), "BonjourResource") + .putData(RESTEASY_CODESTART_RESOURCE_PATH.key(), "/bonjour") .build(); final Path projectDir = testDirPath.resolve("resteasy-java-custom"); getCatalog().createProject(input).generate(projectDir); @@ -118,39 +80,6 @@ void generateRESTEasyJavaCustom(TestInfo testInfo) throws Throwable { assertThatMatchSnapshot(testInfo, projectDir, "src/main/resources/META-INF/resources/index.html"); } - @Test - void generateRESTEasySpringWeb(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .addData(getGenerationTestInputData()) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-spring-web")) - .build(); - final Path projectDir = testDirPath.resolve("resteasy-springweb"); - getCatalog().createProject(input).generate(projectDir); - - checkMaven(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.MAVEN); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/org/acme/GreetingResource.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/org/acme/GreetingResourceTest.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/org/acme/GreetingResource.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/org/acme/GreetingResource.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/org/acme/GreetingResourceTest.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/org/acme/NativeGreetingResourceIT.java"); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/org/acme/SpringGreetingController.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/org/acme/SpringGreetingControllerTest.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/org/acme/NativeSpringGreetingControllerIT.java"); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/resources/META-INF/resources/index.html") - .satisfies(checkContains("\"/hello-resteasy\"")) - .satisfies(checkContains("quarkus.io/guides/rest-json")) - .satisfies(checkContains("\"/hello-spring\"")) - .satisfies(checkContains("quarkus.io/guides/spring-web")); - } - @Test void generateMavenWithCustomDep(TestInfo testInfo) throws Throwable { final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() @@ -182,8 +111,8 @@ void generateRESTEasyKotlinCustom(TestInfo testInfo) throws Throwable { .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-kotlin")) .putData(PROJECT_PACKAGE_NAME.key(), "com.andy") - .putData(RESTEASY_EXAMPLE_RESOURCE_CLASS_NAME.key(), "BonjourResource") - .putData(RESTEASY_EXAMPLE_RESOURCE_PATH.key(), "/bonjour") + .putData(RESTEASY_CODESTART_RESOURCE_CLASS_NAME.key(), "BonjourResource") + .putData(RESTEASY_CODESTART_RESOURCE_PATH.key(), "/bonjour") .build(); final Path projectDir = testDirPath.resolve("resteasy-kotlin-custom"); getCatalog().createProject(input).generate(projectDir); @@ -215,8 +144,8 @@ void generateRESTEasyScalaCustom(TestInfo testInfo) throws Throwable { .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-scala")) .putData(PROJECT_PACKAGE_NAME.key(), "com.andy") - .putData(RESTEASY_EXAMPLE_RESOURCE_CLASS_NAME.key(), "BonjourResource") - .putData(RESTEASY_EXAMPLE_RESOURCE_PATH.key(), "/bonjour") + .putData(RESTEASY_CODESTART_RESOURCE_CLASS_NAME.key(), "BonjourResource") + .putData(RESTEASY_CODESTART_RESOURCE_PATH.key(), "/bonjour") .build(); final Path projectDir = testDirPath.resolve("resteasy-scala-custom"); getCatalog().createProject(input).generate(projectDir); @@ -293,197 +222,6 @@ void generateMavenConfigYamlJava(TestInfo testInfo) throws Throwable { checkConfigYaml(projectDir); } - @Test - void generateMavenResteasyKotlin(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-kotlin")) - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("maven-resteasy-kotlin"); - getCatalog().createProject(input).generate(projectDir); - - checkMaven(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.MAVEN); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/kotlin/org/acme/GreetingResource.kt"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/kotlin/org/acme/GreetingResourceTest.kt"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/kotlin/org/acme/NativeGreetingResourceIT.kt"); - } - - @Test - void generateMavenResteasyScala(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-scala")) - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("maven-resteasy-scala"); - getCatalog().createProject(input).generate(projectDir); - - checkMaven(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.MAVEN); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/scala/org/acme/GreetingResource.scala"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/scala/org/acme/GreetingResourceTest.scala"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/scala/org/acme/NativeGreetingResourceIT.scala"); - } - - @Test - void generateGradleResteasyJava(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .buildTool(BuildTool.GRADLE) - .addCodestart("gradle") - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("gradle-resteasy-java"); - getCatalog().createProject(input).generate(projectDir); - - checkGradle(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.GRADLE); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/org/acme/GreetingResource.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/org/acme/GreetingResourceTest.java"); - assertThatMatchSnapshot(testInfo, projectDir, "src/native-test/java/org/acme/NativeGreetingResourceIT.java"); - } - - @Test - void generateGradleResteasyKotlin(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .buildTool(BuildTool.GRADLE) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-kotlin")) - .addCodestart("gradle") - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("gradle-resteasy-kotlin"); - getCatalog().createProject(input).generate(projectDir); - - checkGradle(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.GRADLE); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/kotlin/org/acme/GreetingResource.kt"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/kotlin/org/acme/GreetingResourceTest.kt"); - assertThatMatchSnapshot(testInfo, projectDir, "src/native-test/kotlin/org/acme/NativeGreetingResourceIT.kt"); - } - - @Test - void generateGradleResteasyScala(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .buildTool(BuildTool.GRADLE) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-scala")) - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("gradle-resteasy-scala"); - getCatalog().createProject(input).generate(projectDir); - - checkGradle(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.GRADLE); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/scala/org/acme/GreetingResource.scala"); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/scala/org/acme/GreetingResourceTest.scala"); - assertThatMatchSnapshot(testInfo, projectDir, "src/native-test/scala/org/acme/NativeGreetingResourceIT.scala"); - } - - @Test - void generateGradleWithKotlinDslResteasyJava(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .buildTool(BuildTool.GRADLE_KOTLIN_DSL) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("gradle-kotlin-dsl-resteasy-java"); - getCatalog().createProject(input).generate(projectDir); - - checkGradleWithKotlinDsl(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.GRADLE_KOTLIN_DSL); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/org/acme/GreetingResource.java"); - } - - @Test - void generateGradleWithKotlinDslResteasyKotlin(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .buildTool(BuildTool.GRADLE_KOTLIN_DSL) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-kotlin")) - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("gradle-kotlin-dsl-resteasy-kotlin"); - getCatalog().createProject(input).generate(projectDir); - - checkGradleWithKotlinDsl(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.GRADLE_KOTLIN_DSL); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/kotlin/org/acme/GreetingResource.kt"); - } - - @Test - void generateGradleWithKotlinDslResteasyScala(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .buildTool(BuildTool.GRADLE_KOTLIN_DSL) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy")) - .addExtension(ArtifactKey.fromString("io.quarkus:quarkus-scala")) - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("gradle-kotlin-dsl-resteasy-scala"); - getCatalog().createProject(input).generate(projectDir); - - checkGradleWithKotlinDsl(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.GRADLE_KOTLIN_DSL); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/scala/org/acme/GreetingResource.scala"); - } - - @Test - void generateWithCustomPackage(TestInfo testInfo) throws Throwable { - final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() - .addCodestart("resteasy-qute").addCodestart("resteasy").addCodestart("funqy-http") - .putData(PROJECT_PACKAGE_NAME.key(), "my.custom.app") - .addData(getGenerationTestInputData()) - .build(); - final Path projectDir = testDirPath.resolve("custom-package"); - getCatalog().createProject(input).generate(projectDir); - - checkMaven(projectDir); - checkReadme(projectDir); - checkDockerfiles(projectDir, BuildTool.MAVEN); - checkConfigProperties(projectDir); - - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/my/custom/app/GreetingResource.java") - .satisfies(checkContains("package my.custom.app;")); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/my/custom/app/GreetingResourceTest.java") - .satisfies(checkContains("package my.custom.app;")); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/my/custom/app/NativeGreetingResourceIT.java") - .satisfies(checkContains("package my.custom.app;")); - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/my/custom/app/resteasyqute/Quark.java") - .satisfies(checkContains("package my.custom.app.resteasyqute;")); - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/my/custom/app/resteasyqute/QuteResource.java") - .satisfies(checkContains("package my.custom.app.resteasyqute;")); - assertThatMatchSnapshot(testInfo, projectDir, "src/main/java/my/custom/app/funqy/Funqy.java") - .satisfies(checkContains("package my.custom.app.funqy;")); - assertThatMatchSnapshot(testInfo, projectDir, "src/test/java/my/custom/app/funqy/FunqyTest.java") - .satisfies(checkContains("package my.custom.app.funqy;")); - } - @Test public void generateGradleWrapperGithubAction(TestInfo testInfo) throws Throwable { final QuarkusCodestartProjectInput input = QuarkusCodestartProjectInput.builder() diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTestExtensionTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyCodestartTest.java similarity index 85% rename from independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTestExtensionTest.java rename to independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyCodestartTest.java index ba4bb287fff80f..c75a848b601d75 100644 --- a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTestExtensionTest.java +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyCodestartTest.java @@ -1,19 +1,19 @@ -package io.quarkus.devtools.testing.codestarts; +package io.quarkus.devtools.codestarts.quarkus; import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA; import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.KOTLIN; import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.SCALA; +import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -class QuarkusCodestartTestExtensionTest { +class RESTEasyCodestartTest { @RegisterExtension public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() .codestarts("resteasy") .languages(JAVA, KOTLIN, SCALA) - .skipGenerateRealDataProject() .build(); @Test diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyReactiveCodestartTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyReactiveCodestartTest.java new file mode 100644 index 00000000000000..aa5cbd29b07e5c --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyReactiveCodestartTest.java @@ -0,0 +1,26 @@ +package io.quarkus.devtools.codestarts.quarkus; + +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.KOTLIN; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.SCALA; + +import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +class RESTEasyReactiveCodestartTest { + + @RegisterExtension + public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .codestarts("resteasy-reactive") + .languages(JAVA, KOTLIN, SCALA) + .build(); + + @Test + void testContent() throws Throwable { + codestartTest.checkGeneratedSource("org.acme.ReactiveGreetingResource"); + codestartTest.checkGeneratedTestSource("org.acme.ReactiveGreetingResourceTest"); + codestartTest.checkGeneratedTestSource("org.acme.NativeReactiveGreetingResourceIT"); + } + +} diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/SpringWebCodestartTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/SpringWebCodestartTest.java new file mode 100644 index 00000000000000..88441b439ae614 --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/SpringWebCodestartTest.java @@ -0,0 +1,26 @@ +package io.quarkus.devtools.codestarts.quarkus; + +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.KOTLIN; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.SCALA; + +import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +class SpringWebCodestartTest { + + @RegisterExtension + public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .codestarts("spring-web") + .languages(JAVA, KOTLIN, SCALA) + .build(); + + @Test + void testContent() throws Throwable { + codestartTest.checkGeneratedSource("org.acme.GreetingController"); + codestartTest.checkGeneratedTestSource("org.acme.GreetingControllerTest"); + codestartTest.checkGeneratedTestSource("org.acme.NativeGreetingControllerIT"); + } + +} diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateCommandMode/src_main_java_org_acme_HelloCommando.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateCommandMode/src_main_java_org_acme_HelloCommando.java deleted file mode 100644 index 1454bd7963fabe..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateCommandMode/src_main_java_org_acme_HelloCommando.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.acme; - -import javax.enterprise.context.control.ActivateRequestContext; -import javax.inject.Inject; - -import io.quarkus.runtime.Quarkus; -import io.quarkus.runtime.QuarkusApplication; -import io.quarkus.runtime.annotations.QuarkusMain; - -@QuarkusMain -public class HelloCommando implements QuarkusApplication { - - @Override - public int run(String... args) throws Exception { - final String name = args.length > 0 ? String.join(" ", args) : "Commando"; - System.out.println("Hello " + name); - return 0; - } -} diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateCommandModeCustom/src_main_java_com_test_andy_AndyCommando.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateCommandModeCustom/src_main_java_com_test_andy_AndyCommando.java deleted file mode 100644 index 3673964fd569b1..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateCommandModeCustom/src_main_java_com_test_andy_AndyCommando.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.test.andy; - -import javax.enterprise.context.control.ActivateRequestContext; -import javax.inject.Inject; - -import io.quarkus.runtime.Quarkus; -import io.quarkus.runtime.QuarkusApplication; -import io.quarkus.runtime.annotations.QuarkusMain; - -@QuarkusMain -public class AndyCommando implements QuarkusApplication { - - @Override - public int run(String... args) throws Exception { - final String name = args.length > 0 ? String.join(" ", args) : "Commando"; - System.out.println("Hello " + name); - return 0; - } -} diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/README.md b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/README.md index 1826c6389baa24..cc6a46353b6eef 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/README.md +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/README.md @@ -1,4 +1,4 @@ -# test-codestart project +# test-codestart Project This project uses Quarkus, the Supersonic Subatomic Java Framework. diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_native-test_java_org_acme_NativeGreetingResourceIT.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_native-test_java_org_acme_NativeGreetingResourceIT.java deleted file mode 100644 index 043ae18256485f..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_native-test_java_org_acme_NativeGreetingResourceIT.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.acme; - -import io.quarkus.test.junit.NativeImageTest; - -@NativeImageTest -public class NativeGreetingResourceIT extends GreetingResourceTest { - - // Execute the same tests but in native mode. -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_test_java_org_acme_GreetingResourceTest.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_test_java_org_acme_GreetingResourceTest.java deleted file mode 100644 index ca2efef29c249d..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_test_java_org_acme_GreetingResourceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.acme; - -import io.quarkus.test.junit.QuarkusTest; -import org.junit.jupiter.api.Test; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; - -@QuarkusTest -public class GreetingResourceTest { - - @Test - public void testHelloEndpoint() { - given() - .when().get("/hello-resteasy") - .then() - .statusCode(200) - .body(is("Hello RESTEasy")); - } - -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt deleted file mode 100644 index e9f434ae958e9e..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt +++ /dev/null @@ -1,14 +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-resteasy") -class GreetingResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - fun hello() = "Hello RESTEasy" -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_native-test_kotlin_org_acme_NativeGreetingResourceIT.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_native-test_kotlin_org_acme_NativeGreetingResourceIT.kt deleted file mode 100644 index 9a773adc7db0ce..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_native-test_kotlin_org_acme_NativeGreetingResourceIT.kt +++ /dev/null @@ -1,6 +0,0 @@ -package org.acme - -import io.quarkus.test.junit.NativeImageTest - -@NativeImageTest -class NativeGreetingResourceIT : GreetingResourceTest() \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_main_scala_org_acme_GreetingResource.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_main_scala_org_acme_GreetingResource.scala deleted file mode 100644 index afe92d90140730..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_main_scala_org_acme_GreetingResource.scala +++ /dev/null @@ -1,12 +0,0 @@ -package org.acme - -import javax.ws.rs.{GET, Path, Produces} -import javax.ws.rs.core.MediaType - -@Path("/hello-resteasy") -class GreetingResource { - - @GET - @Produces(Array[String](MediaType.TEXT_PLAIN)) - def hello() = "Hello RESTEasy" -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_native-test_scala_org_acme_NativeGreetingResourceIT.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_native-test_scala_org_acme_NativeGreetingResourceIT.scala deleted file mode 100644 index c31493e7be7108..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_native-test_scala_org_acme_NativeGreetingResourceIT.scala +++ /dev/null @@ -1,6 +0,0 @@ -package org.acme - -import io.quarkus.test.junit.NativeImageTest - -@NativeImageTest -class NativeGreetingResourceIT extends GreetingResourceTest \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyJava/src_main_java_org_acme_GreetingResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyJava/src_main_java_org_acme_GreetingResource.java deleted file mode 100644 index 6adb758a7dc6d8..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyJava/src_main_java_org_acme_GreetingResource.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-resteasy") -public class GreetingResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String hello() { - return "Hello RESTEasy"; - } -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyScala/src_main_scala_org_acme_GreetingResource.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyScala/src_main_scala_org_acme_GreetingResource.scala deleted file mode 100644 index afe92d90140730..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyScala/src_main_scala_org_acme_GreetingResource.scala +++ /dev/null @@ -1,12 +0,0 @@ -package org.acme - -import javax.ws.rs.{GET, Path, Produces} -import javax.ws.rs.core.MediaType - -@Path("/hello-resteasy") -class GreetingResource { - - @GET - @Produces(Array[String](MediaType.TEXT_PLAIN)) - def hello() = "Hello RESTEasy" -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenDefaultJava/src_main_java_org_acme_GreetingResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenDefaultJava/src_main_java_org_acme_GreetingResource.java index 6adb758a7dc6d8..2015308e02478f 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenDefaultJava/src_main_java_org_acme_GreetingResource.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenDefaultJava/src_main_java_org_acme_GreetingResource.java @@ -5,7 +5,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -@Path("/hello-resteasy") +@Path("/easy") public class GreetingResource { @GET diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenDefaultJava/src_test_java_org_acme_GreetingResourceTest.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenDefaultJava/src_test_java_org_acme_GreetingResourceTest.java index ca2efef29c249d..f7038eba7edc7a 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenDefaultJava/src_test_java_org_acme_GreetingResourceTest.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenDefaultJava/src_test_java_org_acme_GreetingResourceTest.java @@ -12,7 +12,7 @@ public class GreetingResourceTest { @Test public void testHelloEndpoint() { given() - .when().get("/hello-resteasy") + .when().get("/easy") .then() .statusCode(200) .body(is("Hello RESTEasy")); diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyJava/src_main_java_org_acme_GreetingResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyJava/src_main_java_org_acme_GreetingResource.java index 6adb758a7dc6d8..2015308e02478f 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyJava/src_main_java_org_acme_GreetingResource.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyJava/src_main_java_org_acme_GreetingResource.java @@ -5,7 +5,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -@Path("/hello-resteasy") +@Path("/easy") public class GreetingResource { @GET diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyJava/src_test_java_org_acme_GreetingResourceTest.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyJava/src_test_java_org_acme_GreetingResourceTest.java index ca2efef29c249d..f7038eba7edc7a 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyJava/src_test_java_org_acme_GreetingResourceTest.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyJava/src_test_java_org_acme_GreetingResourceTest.java @@ -12,7 +12,7 @@ public class GreetingResourceTest { @Test public void testHelloEndpoint() { given() - .when().get("/hello-resteasy") + .when().get("/easy") .then() .statusCode(200) .body(is("Hello RESTEasy")); diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt deleted file mode 100644 index e9f434ae958e9e..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt +++ /dev/null @@ -1,14 +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-resteasy") -class GreetingResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - fun hello() = "Hello RESTEasy" -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_test_kotlin_org_acme_NativeGreetingResourceIT.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_test_kotlin_org_acme_NativeGreetingResourceIT.kt deleted file mode 100644 index 9a773adc7db0ce..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_test_kotlin_org_acme_NativeGreetingResourceIT.kt +++ /dev/null @@ -1,6 +0,0 @@ -package org.acme - -import io.quarkus.test.junit.NativeImageTest - -@NativeImageTest -class NativeGreetingResourceIT : GreetingResourceTest() \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_test_scala_org_acme_NativeGreetingResourceIT.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_test_scala_org_acme_NativeGreetingResourceIT.scala deleted file mode 100644 index c31493e7be7108..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_test_scala_org_acme_NativeGreetingResourceIT.scala +++ /dev/null @@ -1,6 +0,0 @@ -package org.acme - -import io.quarkus.test.junit.NativeImageTest - -@NativeImageTest -class NativeGreetingResourceIT extends GreetingResourceTest \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasyJavaCustom/src_main_resources_META-INF_resources_index.html b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasyJavaCustom/src_main_resources_META-INF_resources_index.html index 6575420c4a96f6..87939211b8d011 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasyJavaCustom/src_main_resources_META-INF_resources_index.html +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasyJavaCustom/src_main_resources_META-INF_resources_index.html @@ -96,12 +96,12 @@ padding-left: 0; } - .example-code { + .provided-code { border-left: 0.3rem solid #71aeef; padding-left: 10px; } - .example-code h3 { + .provided-code h3 { font-weight: 200; } @@ -129,11 +129,11 @@

    What are your next steps?

  • Your static assets are located in src/main/resources/META-INF/resources.
  • Configure your application in src/main/resources/application.properties.
  • Quarkus now ships with a Dev UI (available in dev mode only)
  • -
  • Play with the getting started example code located in src/main/java:
  • +
  • Play with the provided code located in src/main/java:
  • -
    -

    RESTEasy JAX-RS example

    -

    REST is easy peasy with this Hello World RESTEasy resource.

    +
    +

    RESTEasy JAX-RS

    +

    Easily start your RESTful Web Services

    @Path: /bonjour

    Related guide section...

    diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_java_org_acme_GreetingResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_java_org_acme_GreetingResource.java deleted file mode 100644 index 6adb758a7dc6d8..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_java_org_acme_GreetingResource.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-resteasy") -public class GreetingResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String hello() { - return "Hello RESTEasy"; - } -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_resources_META-INF_resources_index.html b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_resources_META-INF_resources_index.html deleted file mode 100644 index 1a845be55557d9..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_resources_META-INF_resources_index.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - test-codestart - 1.0.0-codestart - - - - - - -
    -
    -

    Congratulations, you have created a new Quarkus cloud application.

    - -

    What is this page?

    - -

    This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

    - -

    What are your next steps?

    - -

    If not already done, run the application in dev mode using: ./mvnw compile quarkus:dev. -

    -
      -
    • Your static assets are located in src/main/resources/META-INF/resources.
    • -
    • Configure your application in src/main/resources/application.properties.
    • -
    • Quarkus now ships with a Dev UI (available in dev mode only)
    • -
    • Play with the getting started example code located in src/main/java:
    • -
    -
    -

    RESTEasy JAX-RS example

    -

    REST is easy peasy with this Hello World RESTEasy resource.

    -

    @Path: /hello-resteasy

    -

    Related guide section...

    -
    -
    -

    Spring Web example

    -

    Spring, the Quarkus way! A Hello World Spring Web Controller.

    -

    @Path: /hello-spring

    -

    Related guide section...

    -
    - -
    -
    -
    -

    Application

    -
      -
    • GroupId: org.test
    • -
    • ArtifactId: test-codestart
    • -
    • Version: 1.0.0-codestart
    • -
    • Quarkus Version: 999-MOCK
    • -
    -
    -
    -

    Do you like Quarkus?

    -
      -
    • Go give it a star on GitHub.
    • -
    -
    -
    -

    Selected extensions guides

    - -
    - -
    -
    - - \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_NativeSpringGreetingControllerIT.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_NativeSpringGreetingControllerIT.java deleted file mode 100644 index 38428ce8f7200a..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_NativeSpringGreetingControllerIT.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.acme; - -import io.quarkus.test.junit.NativeImageTest; - -@NativeImageTest -public class NativeSpringGreetingControllerIT extends SpringGreetingControllerTest { - - // Execute the same tests but in native mode. -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_GreetingResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_GreetingResource.java deleted file mode 100644 index accf61bcb44ed5..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_GreetingResource.java +++ /dev/null @@ -1,16 +0,0 @@ -package my.custom.app; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -@Path("/hello-resteasy") -public class GreetingResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String hello() { - return "Hello RESTEasy"; - } -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_funqy_Funqy.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_funqy_Funqy.java deleted file mode 100644 index aa229c8105b7c8..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_funqy_Funqy.java +++ /dev/null @@ -1,19 +0,0 @@ -package my.custom.app.funqy; - -import io.quarkus.funqy.Funq; - -import java.util.Random; - -public class Funqy { - - private static final String CHARM_QUARK_SYMBOL = "c"; - - @Funq - public String charm(Answer answer) { - return CHARM_QUARK_SYMBOL.equalsIgnoreCase(answer.value) ? "You Quark!" : "👻 Wrong answer"; - } - - public static class Answer { - public String value; - } -} diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_qute_Quark.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_qute_Quark.java deleted file mode 100644 index a1f180edbd3d56..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_qute_Quark.java +++ /dev/null @@ -1,25 +0,0 @@ -package my.custom.app.qute; - -public class Quark { - public enum Flavor { DOWN, UP, STRANGE, CHARM, BOTTOM, TOP } - - public enum Color { - RED("#ff6961"), - GREEN("#77dd77"), - BLUE("#aec6cf"); - - public final String hex; - - Color(String hex) { - this.hex = hex; - } - } - - public final Flavor flavor; - public final Color color; - - public Quark(Flavor flavor, Color color) { - this.flavor = flavor; - this.color = color; - } -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_qute_QuteResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_qute_QuteResource.java deleted file mode 100644 index 2ab3f23f369482..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_qute_QuteResource.java +++ /dev/null @@ -1,55 +0,0 @@ -package my.custom.app.qute; - -import io.quarkus.qute.Template; -import io.quarkus.qute.TemplateExtension; -import io.quarkus.qute.TemplateInstance; - -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; - -@Path("/qute/quarks") -public class QuteResource { - - private final List quarks = Collections.synchronizedList(new ArrayList<>()); - - @Inject - Template page; - - public QuteResource() { - for (int i = 0; i < 3; i++) { - this.addQuark(); - } - } - - @GET - @Produces(MediaType.TEXT_HTML) - public TemplateInstance get() { - return page.data("quarks", new ArrayList<>(quarks)); - } - - @POST - @Path("add") - public void addQuark() { - final Random random = new Random(); - final Quark.Flavor flavor = Quark.Flavor.values()[random.nextInt(Quark.Flavor.values().length)]; - final Quark.Color color = Quark.Color.values()[random.nextInt(Quark.Color.values().length)]; - quarks.add(new Quark(flavor, color)); - } - - /** - * This template extension method implements the "position" computed property. - */ - @TemplateExtension - static int position(Quark quark) { - return new Random().nextInt(100); - } - -} diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_resteasyqute_Quark.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_resteasyqute_Quark.java deleted file mode 100644 index b159293e074ee3..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_resteasyqute_Quark.java +++ /dev/null @@ -1,25 +0,0 @@ -package my.custom.app.resteasyqute; - -public class Quark { - public enum Flavor { DOWN, UP, STRANGE, CHARM, BOTTOM, TOP } - - public enum Color { - RED("#ff6961"), - GREEN("#77dd77"), - BLUE("#aec6cf"); - - public final String hex; - - Color(String hex) { - this.hex = hex; - } - } - - public final Flavor flavor; - public final Color color; - - public Quark(Flavor flavor, Color color) { - this.flavor = flavor; - this.color = color; - } -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_resteasyqute_QuteResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_resteasyqute_QuteResource.java deleted file mode 100644 index c5c2baf606956f..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_resteasyqute_QuteResource.java +++ /dev/null @@ -1,55 +0,0 @@ -package my.custom.app.resteasyqute; - -import io.quarkus.qute.Template; -import io.quarkus.qute.TemplateExtension; -import io.quarkus.qute.TemplateInstance; - -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; - -@Path("/qute/quarks") -public class QuteResource { - - private final List quarks = Collections.synchronizedList(new ArrayList<>()); - - @Inject - Template page; - - public QuteResource() { - for (int i = 0; i < 3; i++) { - this.addQuark(); - } - } - - @GET - @Produces(MediaType.TEXT_HTML) - public TemplateInstance get() { - return page.data("quarks", new ArrayList<>(quarks)); - } - - @POST - @Path("add") - public void addQuark() { - final Random random = new Random(); - final Quark.Flavor flavor = Quark.Flavor.values()[random.nextInt(Quark.Flavor.values().length)]; - final Quark.Color color = Quark.Color.values()[random.nextInt(Quark.Color.values().length)]; - quarks.add(new Quark(flavor, color)); - } - - /** - * This template extension method implements the "position" computed property. - */ - @TemplateExtension - static int position(Quark quark) { - return new Random().nextInt(100); - } - -} diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_GreetingResourceTest.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_GreetingResourceTest.java deleted file mode 100644 index f248d0a6a953fd..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_GreetingResourceTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package my.custom.app; - -import io.quarkus.test.junit.QuarkusTest; -import org.junit.jupiter.api.Test; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; - -@QuarkusTest -public class GreetingResourceTest { - - @Test - public void testHelloEndpoint() { - given() - .when().get("/hello-resteasy") - .then() - .statusCode(200) - .body(is("Hello RESTEasy")); - } - -} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_funqy_FunqyTest.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_funqy_FunqyTest.java deleted file mode 100644 index ca3531786cccef..00000000000000 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_funqy_FunqyTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package my.custom.app.funqy; - -import io.quarkus.test.junit.QuarkusTest; -import org.junit.jupiter.api.Test; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.containsString; - -@QuarkusTest -public class FunqyTest { - - @Test - public void testCharm() { - given() - .contentType("application/json") - .body("{\"value\": \"c\"}") - .post("/charm") - .then() - .statusCode(200) - .body(containsString("You Quark!")); - } - -} diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusJBangCodestartGenerationTest/generatePicocliProject/src_GreetingCommand.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusJBangCodestartGenerationTest/generatePicocliProject/src_GreetingCommand.java index a4f62e6ea3fb03..c2f215e4d510f0 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusJBangCodestartGenerationTest/generatePicocliProject/src_GreetingCommand.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusJBangCodestartGenerationTest/generatePicocliProject/src_GreetingCommand.java @@ -4,28 +4,19 @@ //JAVAC_OPTIONS -parameters // -import io.quarkus.picocli.runtime.annotations.TopCommand; import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Parameters; -@TopCommand -@CommandLine.Command(mixinStandardHelpOptions = true, subcommands = {HelloCommand.class, GoodByeCommand.class}) +@Command(name = "Greeting", mixinStandardHelpOptions = true) public class GreetingCommand { -} - -@CommandLine.Command(name = "hello", description = "Greet World!") -class HelloCommand implements Runnable { - - @Override - public void run() { - System.out.println("Hello World!"); - } -} -@CommandLine.Command(name = "goodbye", description = "Say goodbye to World!") -class GoodByeCommand implements Runnable { + @Parameters(paramLabel = "", defaultValue = "picocli", + description = "Your name.") + String name; @Override public void run() { - System.out.println("Goodbye World!"); + System.out.printf("Hello %s, go go commando!\n", name); } } diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_java_ilove_quark_us_GreetingResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingResource.java similarity index 91% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_java_ilove_quark_us_GreetingResource.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingResource.java index b8fffb7dcc77c5..dd44c4ba8ac24b 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_java_ilove_quark_us_GreetingResource.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingResource.java @@ -5,7 +5,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -@Path("/hello-resteasy") +@Path("/easy") public class GreetingResource { @GET diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_kotlin_ilove_quark_us_GreetingResource.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingResource.kt similarity index 90% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_kotlin_ilove_quark_us_GreetingResource.kt rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingResource.kt index 284a82f1b55424..9dd862246dd636 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_kotlin_ilove_quark_us_GreetingResource.kt +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingResource.kt @@ -5,7 +5,7 @@ import javax.ws.rs.Path import javax.ws.rs.Produces import javax.ws.rs.core.MediaType -@Path("/hello-resteasy") +@Path("/easy") class GreetingResource { @GET diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_scala_ilove_quark_us_GreetingResource.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_scala_ilove_quark_us_GreetingResource.scala similarity index 89% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_scala_ilove_quark_us_GreetingResource.scala rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_scala_ilove_quark_us_GreetingResource.scala index 27d34bef636cee..717bc7df296076 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_main_scala_ilove_quark_us_GreetingResource.scala +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_main_scala_ilove_quark_us_GreetingResource.scala @@ -3,7 +3,7 @@ package ilove.quark.us import javax.ws.rs.{GET, Path, Produces} import javax.ws.rs.core.MediaType -@Path("/hello-resteasy") +@Path("/easy") class GreetingResource { @GET diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_java_ilove_quark_us_GreetingResourceTest.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_java_ilove_quark_us_GreetingResourceTest.java similarity index 90% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_java_ilove_quark_us_GreetingResourceTest.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_java_ilove_quark_us_GreetingResourceTest.java index 15b7922618a523..25792d172b5fad 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_java_ilove_quark_us_GreetingResourceTest.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_java_ilove_quark_us_GreetingResourceTest.java @@ -12,7 +12,7 @@ public class GreetingResourceTest { @Test public void testHelloEndpoint() { given() - .when().get("/hello-resteasy") + .when().get("/easy") .then() .statusCode(200) .body(is("Hello RESTEasy")); diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_java_ilove_quark_us_NativeGreetingResourceIT.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_java_ilove_quark_us_NativeGreetingResourceIT.java similarity index 100% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_java_ilove_quark_us_NativeGreetingResourceIT.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_java_ilove_quark_us_NativeGreetingResourceIT.java diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_kotlin_ilove_quark_us_GreetingResourceTest.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_kotlin_ilove_quark_us_GreetingResourceTest.kt similarity index 89% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_kotlin_ilove_quark_us_GreetingResourceTest.kt rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_kotlin_ilove_quark_us_GreetingResourceTest.kt index 6c5b523897c301..864e8eb09152e2 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_kotlin_ilove_quark_us_GreetingResourceTest.kt +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_kotlin_ilove_quark_us_GreetingResourceTest.kt @@ -11,7 +11,7 @@ class GreetingResourceTest { @Test fun testHelloEndpoint() { given() - .`when`().get("/hello-resteasy") + .`when`().get("/easy") .then() .statusCode(200) .body(`is`("Hello RESTEasy")) diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingResourceIT.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingResourceIT.kt similarity index 100% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingResourceIT.kt rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingResourceIT.kt diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_scala_ilove_quark_us_GreetingResourceTest.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_scala_ilove_quark_us_GreetingResourceTest.scala similarity index 89% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_scala_ilove_quark_us_GreetingResourceTest.scala rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_scala_ilove_quark_us_GreetingResourceTest.scala index 93e1d7e85a54d5..935f30102b4713 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_scala_ilove_quark_us_GreetingResourceTest.scala +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_scala_ilove_quark_us_GreetingResourceTest.scala @@ -11,7 +11,7 @@ class GreetingResourceTest { @Test def testHelloEndpoint() = { given() - .`when`().get("/hello-resteasy") + .`when`().get("/easy") .then() .statusCode(200) .body(`is`("Hello RESTEasy")) diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_scala_ilove_quark_us_NativeGreetingResourceIT.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeGreetingResourceIT.scala similarity index 100% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartTestExtensionTest/testContent/src_test_scala_ilove_quark_us_NativeGreetingResourceIT.scala rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeGreetingResourceIT.scala diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_main_java_org_acme_GreetingResource.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_java_ilove_quark_us_ReactiveGreetingResource.java similarity index 61% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_main_java_org_acme_GreetingResource.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_java_ilove_quark_us_ReactiveGreetingResource.java index 6adb758a7dc6d8..c19a158f75f0e5 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_main_java_org_acme_GreetingResource.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_java_ilove_quark_us_ReactiveGreetingResource.java @@ -1,16 +1,16 @@ -package org.acme; +package ilove.quark.us; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -@Path("/hello-resteasy") -public class GreetingResource { +@Path("/easy") +public class ReactiveGreetingResource { @GET @Produces(MediaType.TEXT_PLAIN) public String hello() { - return "Hello RESTEasy"; + return "Hello RESTEasy Reactive"; } } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_kotlin_ilove_quark_us_ReactiveGreetingResource.kt similarity index 57% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_kotlin_ilove_quark_us_ReactiveGreetingResource.kt index e9f434ae958e9e..a33d5662c419b6 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_kotlin_ilove_quark_us_ReactiveGreetingResource.kt @@ -1,14 +1,14 @@ -package org.acme +package ilove.quark.us import javax.ws.rs.GET import javax.ws.rs.Path import javax.ws.rs.Produces import javax.ws.rs.core.MediaType -@Path("/hello-resteasy") -class GreetingResource { +@Path("/easy") +class ReactiveGreetingResource { @GET @Produces(MediaType.TEXT_PLAIN) - fun hello() = "Hello RESTEasy" + fun hello() = "Hello RESTEasy Reactive" } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_main_scala_org_acme_GreetingResource.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_scala_ilove_quark_us_ReactiveGreetingResource.scala similarity index 54% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_main_scala_org_acme_GreetingResource.scala rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_scala_ilove_quark_us_ReactiveGreetingResource.scala index afe92d90140730..1170f32ea2aa08 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_main_scala_org_acme_GreetingResource.scala +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_main_scala_ilove_quark_us_ReactiveGreetingResource.scala @@ -1,12 +1,12 @@ -package org.acme +package ilove.quark.us import javax.ws.rs.{GET, Path, Produces} import javax.ws.rs.core.MediaType -@Path("/hello-resteasy") -class GreetingResource { +@Path("/easy") +class ReactiveGreetingResource { @GET @Produces(Array[String](MediaType.TEXT_PLAIN)) - def hello() = "Hello RESTEasy" + def hello() = "Hello RESTEasy Reactive" } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_NativeGreetingResourceIT.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_java_ilove_quark_us_NativeReactiveGreetingResourceIT.java similarity index 51% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_NativeGreetingResourceIT.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_java_ilove_quark_us_NativeReactiveGreetingResourceIT.java index c6d392dff66544..0beb8220d0c3b1 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_NativeGreetingResourceIT.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_java_ilove_quark_us_NativeReactiveGreetingResourceIT.java @@ -1,9 +1,9 @@ -package my.custom.app; +package ilove.quark.us; import io.quarkus.test.junit.NativeImageTest; @NativeImageTest -public class NativeGreetingResourceIT extends GreetingResourceTest { +public class NativeReactiveGreetingResourceIT extends ReactiveGreetingResourceTest { // Execute the same tests but in native mode. } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_GreetingResourceTest.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_java_ilove_quark_us_ReactiveGreetingResourceTest.java similarity index 67% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_GreetingResourceTest.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_java_ilove_quark_us_ReactiveGreetingResourceTest.java index ca2efef29c249d..a0fb436c3720a8 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_GreetingResourceTest.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_java_ilove_quark_us_ReactiveGreetingResourceTest.java @@ -1,4 +1,4 @@ -package org.acme; +package ilove.quark.us; import io.quarkus.test.junit.QuarkusTest; import org.junit.jupiter.api.Test; @@ -7,15 +7,15 @@ import static org.hamcrest.CoreMatchers.is; @QuarkusTest -public class GreetingResourceTest { +public class ReactiveGreetingResourceTest { @Test public void testHelloEndpoint() { given() - .when().get("/hello-resteasy") + .when().get("/easy") .then() .statusCode(200) - .body(is("Hello RESTEasy")); + .body(is("Hello RESTEasy Reactive")); } } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeReactiveGreetingResourceIT.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeReactiveGreetingResourceIT.kt new file mode 100644 index 00000000000000..5343d1af2ecfb1 --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeReactiveGreetingResourceIT.kt @@ -0,0 +1,6 @@ +package ilove.quark.us + +import io.quarkus.test.junit.NativeImageTest + +@NativeImageTest +class NativeReactiveGreetingResourceIT : ReactiveGreetingResourceTest() \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_test_kotlin_org_acme_GreetingResourceTest.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_kotlin_ilove_quark_us_ReactiveGreetingResourceTest.kt similarity index 65% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_test_kotlin_org_acme_GreetingResourceTest.kt rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_kotlin_ilove_quark_us_ReactiveGreetingResourceTest.kt index 7a515af98eee9e..3d4acfc8f87bf9 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_test_kotlin_org_acme_GreetingResourceTest.kt +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_kotlin_ilove_quark_us_ReactiveGreetingResourceTest.kt @@ -1,4 +1,4 @@ -package org.acme +package ilove.quark.us import io.quarkus.test.junit.QuarkusTest import io.restassured.RestAssured.given @@ -6,15 +6,15 @@ import org.hamcrest.CoreMatchers.`is` import org.junit.jupiter.api.Test @QuarkusTest -class GreetingResourceTest { +class ReactiveGreetingResourceTest { @Test fun testHelloEndpoint() { given() - .`when`().get("/hello-resteasy") + .`when`().get("/easy") .then() .statusCode(200) - .body(`is`("Hello RESTEasy")) + .body(`is`("Hello RESTEasy Reactive")) } } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeReactiveGreetingResourceIT.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeReactiveGreetingResourceIT.scala new file mode 100644 index 00000000000000..32595d995510d1 --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeReactiveGreetingResourceIT.scala @@ -0,0 +1,6 @@ +package ilove.quark.us + +import io.quarkus.test.junit.NativeImageTest + +@NativeImageTest +class NativeReactiveGreetingResourceIT extends ReactiveGreetingResourceTest \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_test_scala_org_acme_GreetingResourceTest.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_scala_ilove_quark_us_ReactiveGreetingResourceTest.scala similarity index 66% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_test_scala_org_acme_GreetingResourceTest.scala rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_scala_ilove_quark_us_ReactiveGreetingResourceTest.scala index baafe965d0e080..17791cca71d48c 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_test_scala_org_acme_GreetingResourceTest.scala +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_scala_ilove_quark_us_ReactiveGreetingResourceTest.scala @@ -1,4 +1,4 @@ -package org.acme +package ilove.quark.us import io.quarkus.test.junit.QuarkusTest import io.restassured.RestAssured.given @@ -6,15 +6,15 @@ import org.hamcrest.CoreMatchers.`is` import org.junit.jupiter.api.Test @QuarkusTest -class GreetingResourceTest { +class ReactiveGreetingResourceTest { @Test def testHelloEndpoint() = { given() - .`when`().get("/hello-resteasy") + .`when`().get("/easy") .then() .statusCode(200) - .body(`is`("Hello RESTEasy")) + .body(`is`("Hello RESTEasy Reactive")) } } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_java_org_acme_SpringGreetingController.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingController.java similarity index 75% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_java_org_acme_SpringGreetingController.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingController.java index c28f85ded53434..7b00bb425a9dab 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_java_org_acme_SpringGreetingController.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingController.java @@ -1,12 +1,12 @@ -package org.acme; +package ilove.quark.us; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController -@RequestMapping("/hello-spring") -public class SpringGreetingController { +@RequestMapping("/hello") +public class GreetingController { @GetMapping public String hello() { diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingController.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingController.kt new file mode 100644 index 00000000000000..b34467eed4459d --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingController.kt @@ -0,0 +1,14 @@ +package ilove.quark.us + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping("/hello") +class GreetingController { + + @GetMapping + fun hello() = "Hello Spring" +} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_scala_ilove_quark_us_GreetingController.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_scala_ilove_quark_us_GreetingController.scala new file mode 100644 index 00000000000000..54d18ee2d7ebf1 --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_scala_ilove_quark_us_GreetingController.scala @@ -0,0 +1,12 @@ +package ilove.quark.us; + +import org.springframework.web.bind.annotation.{GetMapping, RequestMapping, RestController} + + +@RestController +@RequestMapping(Array[String]("/hello")) +class GreetingController { + + @GetMapping + def hello() = "Hello Spring" +} \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_SpringGreetingControllerTest.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_java_ilove_quark_us_GreetingControllerTest.java similarity index 77% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_SpringGreetingControllerTest.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_java_ilove_quark_us_GreetingControllerTest.java index bb0b3d27feb887..e08ffafb0ee9b0 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_SpringGreetingControllerTest.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_java_ilove_quark_us_GreetingControllerTest.java @@ -1,4 +1,4 @@ -package org.acme; +package ilove.quark.us; import io.quarkus.test.junit.QuarkusTest; import org.junit.jupiter.api.Test; @@ -7,12 +7,12 @@ import static org.hamcrest.CoreMatchers.is; @QuarkusTest -public class SpringGreetingControllerTest { +public class GreetingControllerTest { @Test public void testHelloEndpoint() { given() - .when().get("/hello-spring") + .when().get("/hello") .then() .statusCode(200) .body(is("Hello Spring")); diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_NativeGreetingResourceIT.java b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_java_ilove_quark_us_NativeGreetingControllerIT.java similarity index 54% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_NativeGreetingResourceIT.java rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_java_ilove_quark_us_NativeGreetingControllerIT.java index 043ae18256485f..67f8d20c28bf42 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_NativeGreetingResourceIT.java +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_java_ilove_quark_us_NativeGreetingControllerIT.java @@ -1,9 +1,9 @@ -package org.acme; +package ilove.quark.us; import io.quarkus.test.junit.NativeImageTest; @NativeImageTest -public class NativeGreetingResourceIT extends GreetingResourceTest { +public class NativeGreetingControllerIT extends GreetingControllerTest { // Execute the same tests but in native mode. } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_test_kotlin_org_acme_GreetingResourceTest.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_kotlin_ilove_quark_us_GreetingControllerTest.kt similarity index 68% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_test_kotlin_org_acme_GreetingResourceTest.kt rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_kotlin_ilove_quark_us_GreetingControllerTest.kt index 7a515af98eee9e..b8b382c4434f7c 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_test_kotlin_org_acme_GreetingResourceTest.kt +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_kotlin_ilove_quark_us_GreetingControllerTest.kt @@ -1,4 +1,4 @@ -package org.acme +package ilove.quark.us import io.quarkus.test.junit.QuarkusTest import io.restassured.RestAssured.given @@ -6,15 +6,15 @@ import org.hamcrest.CoreMatchers.`is` import org.junit.jupiter.api.Test @QuarkusTest -class GreetingResourceTest { +class GreetingControllerTest { @Test fun testHelloEndpoint() { given() - .`when`().get("/hello-resteasy") + .`when`().get("/hello") .then() .statusCode(200) - .body(`is`("Hello RESTEasy")) + .body(`is`("Hello Spring")) } } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingControllerIT.kt b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingControllerIT.kt new file mode 100644 index 00000000000000..572dba09355693 --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingControllerIT.kt @@ -0,0 +1,6 @@ +package ilove.quark.us + +import io.quarkus.test.junit.NativeImageTest + +@NativeImageTest +class NativeGreetingControllerIT : GreetingControllerTest() \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_test_scala_org_acme_GreetingResourceTest.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_scala_ilove_quark_us_GreetingControllerTest.scala similarity index 68% rename from independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_test_scala_org_acme_GreetingResourceTest.scala rename to independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_scala_ilove_quark_us_GreetingControllerTest.scala index baafe965d0e080..20297582a70ecf 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_test_scala_org_acme_GreetingResourceTest.scala +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_scala_ilove_quark_us_GreetingControllerTest.scala @@ -1,4 +1,4 @@ -package org.acme +package ilove.quark.us import io.quarkus.test.junit.QuarkusTest import io.restassured.RestAssured.given @@ -6,15 +6,15 @@ import org.hamcrest.CoreMatchers.`is` import org.junit.jupiter.api.Test @QuarkusTest -class GreetingResourceTest { +class GreetingControllerTest { @Test def testHelloEndpoint() = { given() - .`when`().get("/hello-resteasy") + .`when`().get("/hello") .then() .statusCode(200) - .body(`is`("Hello RESTEasy")) + .body(`is`("Hello Spring")) } } \ No newline at end of file diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeGreetingControllerIT.scala b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeGreetingControllerIT.scala new file mode 100644 index 00000000000000..5ef5066add797f --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeGreetingControllerIT.scala @@ -0,0 +1,6 @@ +package ilove.quark.us + +import io.quarkus.test.junit.NativeImageTest + +@NativeImageTest +class NativeGreetingControllerIT extends GreetingControllerTest \ No newline at end of file diff --git a/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyCodestartBuildIT.java b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyCodestartBuildIT.java new file mode 100644 index 00000000000000..4e51ab4e51e769 --- /dev/null +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyCodestartBuildIT.java @@ -0,0 +1,28 @@ +package io.quarkus.devtools.codestarts.quarkus; + +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.RESTEASY_CODESTART_RESOURCE_CLASS_NAME; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.RESTEASY_CODESTART_RESOURCE_PATH; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; + +class CustomRESTEasyCodestartBuildIT { + + @RegisterExtension + public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .codestarts("resteasy") + .languages(JAVA) + .putData(RESTEASY_CODESTART_RESOURCE_CLASS_NAME, "RESTEasyEndpoint") + .putData(RESTEASY_CODESTART_RESOURCE_PATH, "/resteasy") + .skipGenerateMockedDataProject() + .build(); + + @Test + void testBuild() { + codestartTest.buildAllProjects(); + } + +} diff --git a/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyReactiveCodestartBuildIT.java b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyReactiveCodestartBuildIT.java new file mode 100644 index 00000000000000..72bcaa2932f2db --- /dev/null +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyReactiveCodestartBuildIT.java @@ -0,0 +1,28 @@ +package io.quarkus.devtools.codestarts.quarkus; + +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.RESTEASY_REACTIVE_CODESTART_RESOURCE_CLASS_NAME; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.RESTEASY_REACTIVE_CODESTART_RESOURCE_PATH; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; + +class CustomRESTEasyReactiveCodestartBuildIT { + + @RegisterExtension + public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .codestarts("resteasy-reactive") + .languages(JAVA) + .putData(RESTEASY_REACTIVE_CODESTART_RESOURCE_CLASS_NAME, "RESTEasyEndpoint") + .putData(RESTEASY_REACTIVE_CODESTART_RESOURCE_PATH, "/resteasy") + .skipGenerateMockedDataProject() + .build(); + + @Test + void testBuild() { + codestartTest.buildAllProjects(); + } + +} diff --git a/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomSpringWebCodestartBuildIT.java b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomSpringWebCodestartBuildIT.java new file mode 100644 index 00000000000000..5be798efb9b2ae --- /dev/null +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomSpringWebCodestartBuildIT.java @@ -0,0 +1,28 @@ +package io.quarkus.devtools.codestarts.quarkus; + +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.SPRING_WEB_CODESTART_RESOURCE_CLASS_NAME; +import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.SPRING_WEB_CODESTART_RESOURCE_PATH; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; + +class CustomSpringWebCodestartBuildIT { + + @RegisterExtension + public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .codestarts("spring-web") + .putData(SPRING_WEB_CODESTART_RESOURCE_CLASS_NAME, "SpringWebEndpoint") + .putData(SPRING_WEB_CODESTART_RESOURCE_PATH, "/springweb") + .languages(JAVA) + .skipGenerateMockedDataProject() + .build(); + + @Test + void testBuild() { + codestartTest.buildAllProjects(); + } + +} diff --git a/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartRunIT.java b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartBuildIT.java similarity index 73% rename from integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartRunIT.java rename to integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartBuildIT.java index ea1828ad8cbaf9..372196a2c4499e 100644 --- a/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartRunIT.java +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartBuildIT.java @@ -7,7 +7,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -27,7 +26,6 @@ import io.quarkus.devtools.codestarts.Codestart; import io.quarkus.devtools.codestarts.CodestartProjectDefinition; import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Tag; -import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey; import io.quarkus.devtools.project.BuildTool; import io.quarkus.devtools.testing.PlatformAwareTestBase; import io.quarkus.devtools.testing.SnapshotTesting; @@ -35,12 +33,12 @@ import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTesting; @TestInstance(TestInstance.Lifecycle.PER_CLASS) -class QuarkusCodestartRunIT extends PlatformAwareTestBase { +class QuarkusCodestartBuildIT extends PlatformAwareTestBase { private static final Path testDirPath = Paths.get("target/quarkus-codestart-run-test"); private static final Set EXCLUDED = Sets.newHashSet( - "azure-functions-http-example", "commandmode-example"); + "azure-functions-http-example"); private static final Set RUN_ALONE = Sets.newHashSet("resteasy-reactive-example", "picocli-example"); @@ -106,44 +104,6 @@ public void generateAzureFunctionsHttpExampleProjectRun() throws Exception { Collections.emptyMap()); } - @Test - public void generateCustomizedRESTEasyProjectRun() throws Exception { - final HashMap data = new HashMap<>(); - data.put(QuarkusDataKey.PROJECT_PACKAGE_NAME.key(), "com.test.andy"); - data.put(QuarkusDataKey.RESTEASY_EXAMPLE_RESOURCE_CLASS_NAME.key(), "AndyEndpoint"); - data.put(QuarkusDataKey.RESTEASY_EXAMPLE_RESOURCE_PATH.key(), "/andy"); - final String buildTool = "maven"; - final String language = "java"; - final List codestarts = singletonList("resteasy-example"); - generateProjectRunTests(buildTool, language, codestarts, data, - genName(buildTool, language, codestarts) + "-customized"); - } - - @Test - public void generateCustomizedSpringWebProjectRun() throws Exception { - final HashMap data = new HashMap<>(); - data.put(QuarkusDataKey.PROJECT_PACKAGE_NAME.key(), "com.test.spring.web"); - data.put(QuarkusDataKey.SPRING_WEB_EXAMPLE_RESOURCE_CLASS_NAME.key(), "SpringWebEndpoint"); - data.put(QuarkusDataKey.SPRING_WEB_EXAMPLE_RESOURCE_PATH.key(), "/springweb"); - final String buildTool = "maven"; - final String language = "java"; - final List codestarts = singletonList("spring-web-example"); - generateProjectRunTests(buildTool, language, codestarts, data, - genName(buildTool, language, codestarts) + "-customized"); - } - - @Test - public void generateCustomizedCommandModeProjectRun() throws Exception { - final HashMap data = new HashMap<>(); - data.put(QuarkusDataKey.PROJECT_PACKAGE_NAME.key(), "com.test.andy"); - data.put(QuarkusDataKey.COMMANDMODE_EXAMPLE_RESOURCE_CLASS_NAME.key(), "AndyCommando"); - final String buildTool = "maven"; - final String language = "java"; - final List codestarts = Collections.emptyList(); - generateProjectRunTests(buildTool, language, codestarts, data, - genName(buildTool, language, codestarts) + "-customized"); - } - private void generateProjectRunTests(String buildTool, String language, List codestarts, Map data) throws Exception { generateProjectRunTests(buildTool, language, codestarts, data, genName(buildTool, language, codestarts)); @@ -208,11 +168,11 @@ private Stream provideLanguages() { private Stream getAllExamples() throws IOException { return getCatalog().getCodestarts().stream() - .filter(QuarkusCodestartCatalog::isExample) + .filter(QuarkusCodestartCatalog::isExtensionCodestart) .filter(c -> !EXCLUDED.contains(c.getName())); } private boolean isRunAloneExample(Codestart c) { - return c.containsTag(Tag.SINGLETON_EXAMPLE.key()) || RUN_ALONE.contains(c.getName()); + return c.containsTag(Tag.EXAMPLE.key()) || RUN_ALONE.contains(c.getName()); } } diff --git a/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/TestRESTEasyReactiveExtensionsCodestart.java b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyReactiveExtensionsCodestartTest.java similarity index 93% rename from integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/TestRESTEasyReactiveExtensionsCodestart.java rename to integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyReactiveExtensionsCodestartTest.java index 15f89f66103855..390536dc83b0cc 100644 --- a/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/TestRESTEasyReactiveExtensionsCodestart.java +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyReactiveExtensionsCodestartTest.java @@ -9,7 +9,7 @@ import io.quarkus.devtools.testing.PlatformAwareTestBase; import io.quarkus.registry.catalog.Extension; -public class TestRESTEasyReactiveExtensionsCodestart extends PlatformAwareTestBase { +public class RESTEasyReactiveExtensionsCodestartTest extends PlatformAwareTestBase { @Test void checkCodestart() { diff --git a/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_java_ilove_quark_us_SomePage.java b/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_java_ilove_quark_us_SomePage.java new file mode 100644 index 00000000000000..67c59b69d8e420 --- /dev/null +++ b/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_java_ilove_quark_us_SomePage.java @@ -0,0 +1,24 @@ +package ilove.quark.us; + +import io.quarkus.qute.Template; +import io.quarkus.qute.TemplateInstance; + +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +@Path("/some-page") +public class SomePage { + + @Inject + Template somePage; + + @GET + @Produces(MediaType.TEXT_HTML) + public TemplateInstance get(String name) { + return somePage.data("name", name); + } + +} diff --git a/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_kotlin_ilove_quark_us_SomePage.kt b/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_kotlin_ilove_quark_us_SomePage.kt new file mode 100644 index 00000000000000..088fe55771cf54 --- /dev/null +++ b/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_kotlin_ilove_quark_us_SomePage.kt @@ -0,0 +1,22 @@ +package ilove.quark.us + +import io.quarkus.qute.Template +import io.quarkus.qute.TemplateInstance +import javax.inject.Inject +import javax.ws.rs.GET +import javax.ws.rs.Path +import javax.ws.rs.Produces +import javax.ws.rs.core.MediaType + +@Path("/some-page") +class SomePage { + + @Inject + lateinit var somePage: Template + + @GET + @Produces(MediaType.TEXT_HTML) + operator fun get(name: String?): TemplateInstance { + return somePage.data("name", name) + } +} \ No newline at end of file diff --git a/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_resources_templates_some-page.qute.html b/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_resources_templates_some-page.qute.html new file mode 100644 index 00000000000000..46c12a74b617c6 --- /dev/null +++ b/integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_resources_templates_some-page.qute.html @@ -0,0 +1,25 @@ + + + + + Hello {name ?: Qute} + + + +

    Hello {name ?: Qute}

    + +

    Create your web page using Quarkus RESTEasy & Qute

    + +