From 271160508391b686f3c112ca39ff177df3c6e237 Mon Sep 17 00:00:00 2001 From: Andy Damevin Date: Wed, 21 Apr 2021 13:05:48 +0200 Subject: [PATCH 1/2] Extension Codestarts are now "really" meant to start coding with an extension --- .../src/main/java/io/quarkus/cli/Create.java | 12 +- .../io/quarkus/maven/CreateProjectMojo.java | 23 +- .../base/README.tpl.qute.md | 0 .../amazon-lambda-example/codestart.yml | 4 +- .../amazon-lambda-example/java/payload.json | 0 .../java/org/acme/lambda/GreetingLambda.java | 0 .../src/main/java/org/acme/lambda/Person.java | 0 .../org/acme/lambda/LambdaHandlerTestIT.java | 0 .../org/acme/lambda/LambdaHandlerTest.java | 0 .../java/src/test/resources/application.yml | 0 .../base/README.tpl.qute.md | 0 .../base/azure-config/function.tpl.qute.json | 0 .../base/azure-config/host.json | 0 .../base/azure-config/local.settings.json | 0 .../base/pom.tpl.qute.xml | 0 .../main/resources/application.tpl.qute.yml | 0 .../codestart.yml | 1 - .../config-example/base/README.tpl.qute.md | 3 - .../base/src/main/resources/application.yml | 5 - .../examples/config-example/codestart.yml | 13 - .../java/org/acme/config/ConfigResource.java | 41 --- .../kotlin/org/acme/config/ConfigResource.kt | 39 --- .../base/README.tpl.qute.md | 0 .../funqy-amazon-lambda-example/codestart.yml | 4 +- .../java/payload.json | 0 .../java/org/acme/funqy/GreetingFunction.java | 0 .../src/main/java/org/acme/funqy/Person.java | 0 .../java/org/acme/funqy/FunqyIT.java | 0 .../java/resources/application.properties | 0 .../test/java/org/acme/funqy/FunqyTest.java | 0 .../java/src/test/resources/application.yml | 0 .../base/README.tpl.qute.md | 0 .../codestart.yml | 4 +- .../GreetingFunctions.java | 0 .../GreetingService.java | 0 .../examples/funqy-http-example/codestart.yml | 15 - .../src/main/java/org/acme/funqy/Funqy.java | 19 -- .../test/java/org/acme/funqy/FunqyTest.java | 23 -- .../base/README.tpl.qute.md | 0 .../codestart.yml | 4 +- .../funqy/cloudevent/CloudEventGreeting.java | 0 .../org/acme/funqy/cloudevent/Person.java | 0 .../src/main/k8s/funqy-service.tpl.qute.yaml | 0 .../src/main/k8s/funqy-trigger.tpl.qute.yaml | 0 .../org/acme/funqy/cloudevent/FunqyIT.java | 0 .../org/acme/funqy/cloudevent/FunqyTest.java | 0 .../base/README.tpl.qute.md | 0 .../codestart.yml | 4 +- .../HelloWorldBackgroundFunction.java | 0 .../HelloWorldHttpFunction.java | 0 .../base/README.tpl.qute.md | 0 .../codestart.yml | 4 +- .../googlecloudfunctions/GreetingFunqy.java | 0 .../GreetingResource.java | 0 .../googlecloudfunctions/GreetingRoutes.java | 0 .../googlecloudfunctions/GreetingServlet.java | 0 .../META-INF/resources/index.entry.qute.html | 1 - .../base/src/main/resources/application.yml | 7 - .../examples/logging-json/codestart.yml | 14 - .../logging/json/LoggingJsonResource.java | 35 --- .../acme/logging/json/LoggingJsonResource.kt | 35 --- .../java/org/acme/picocli/EntryCommand.java | 9 - .../java/org/acme/picocli/GoodbyeCommand.java | 21 -- .../org/acme/picocli/GreetingService.java | 11 - .../java/org/acme/picocli/HelloCommand.java | 39 --- .../kotlin/org/acme/picocli/EntryCommand.kt | 8 - .../kotlin/org/acme/picocli/GoodbyeCommand.kt | 17 -- .../org/acme/picocli/GreetingService.kt | 10 - .../kotlin/org/acme/picocli/HelloCommand.kt | 27 -- .../META-INF/resources/index.entry.qute.html | 1 - .../resteasy-jackson-example/codestart.yml | 14 - .../acme/resteasyjackson/JacksonResource.java | 52 ---- .../MyObjectMapperCustomizer.java | 17 -- .../acme/resteasyjackson/JacksonResource.kt | 48 --- .../MyObjectMapperCustomizer.kt | 14 - .../META-INF/resources/index.entry.qute.html | 1 - .../templates/page.qute.tpl.qute.html | 47 --- .../resteasy-qute-example/codestart.yml | 13 - .../java/org/acme/resteasyqute/Quark.java | 25 -- .../org/acme/resteasyqute/QuteResource.java | 55 ---- .../kotlin/org/acme/resteasyqute/Quark.kt | 11 - .../org/acme/resteasyqute/QuteResource.kt | 54 ---- .../base/README.tpl.qute.md | 3 + .../base/src/main/resources/application.yml | 2 + .../config-yaml-codestart/codestart.yml | 8 + .../main/java/org/acme/GreetingConfig.java | 12 + .../main/kotlin/org/acme/GreetingConfig.kt | 12 + .../base/README.tpl.qute.md | 0 .../META-INF/resources/index.entry.qute.html | 0 .../funqy-http-codestart/codestart.yml | 15 + .../src/main/java/org/acme/MyFunctions.java | 17 ++ .../java/org/acme/MyFunctionsIT.java | 8 + .../test/java/org/acme/MyFunctionsTest.java | 33 +++ .../base/README.tpl.qute.md | 2 +- .../picocli-codestart}/codestart.yml | 4 +- .../main/java/org/acme/GreetingCommand.java | 19 ++ .../main/kotlin/org/acme/GreetingCommand.kt | 16 + .../base/README.tpl.qute.md | 0 .../META-INF/resources/index.entry.qute.html | 0 .../templates/page.qute.tpl.qute.html | 30 ++ .../resteasy-qute-codestart/codestart.yml | 13 + .../java/src/main/java/org/acme/SomePage.java | 25 ++ .../src/main/kotlin/org/acme/SomePage.kt | 23 ++ .../java/org/acme/funqy/FunqyIT.java | 10 - .../quarkus/ConfigYamlCodestartTest.java | 5 +- .../quarkus/FunqyHttpCodestartTest.java | 26 ++ .../quarkus/PicocliCodestartTest.java | 13 +- .../quarkus/RESTEasyQuteCodestartTest.java | 6 +- ...in_java_ilove_quark_us_GreetingConfig.java | 12 + ...in_kotlin_ilove_quark_us_GreetingConfig.kt | 12 + .../src_main_resources_application.yml | 7 +- ..._main_java_ilove_quark_us_MyFunctions.java | 17 ++ ...est_java_ilove_quark_us_MyFunctionsIT.java | 8 + ...t_java_ilove_quark_us_MyFunctionsTest.java | 33 +++ ...n_java_ilove_quark_us_GreetingCommand.java | 19 ++ ...n_kotlin_ilove_quark_us_GreetingCommand.kt | 16 + ...src_main_java_ilove_quark_us_SomePage.java | 25 ++ ...src_main_kotlin_ilove_quark_us_SomePage.kt | 23 ++ ...rc_main_resources_templates_page.qute.html | 47 +-- .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 7 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 7 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../resources/META-INF/quarkus-extension.yaml | 1 - .../code/jbang-picocli-code/codestart.yml | 10 +- .../src/{command.class-name}.tpl.qute.java | 23 +- .../commandmode-example/codestart.yml | 18 -- .../org/acme/{main.class-name}.tpl.qute.java | 19 -- .../org/acme/{main.class-name}.tpl.qute.kt | 17 -- .../resteasy-example/base/README.tpl.qute.md | 1 - .../base/README.tpl.qute.md | 1 - .../base/README.tpl.qute.md | 1 - .../base/README.tpl.qute.md | 0 .../META-INF/resources/index.entry.qute.html | 0 .../resteasy-codestart}/codestart.yml | 10 +- .../acme/{resource.class-name}.tpl.qute.java | 0 ...ative{resource.class-name}IT.tpl.qute.java | 0 .../{resource.class-name}Test.tpl.qute.java | 0 .../acme/{resource.class-name}.tpl.qute.kt | 0 .../Native{resource.class-name}IT.tpl.qute.kt | 0 .../{resource.class-name}Test.tpl.qute.kt | 0 .../acme/{resource.class-name}.tpl.qute.scala | 0 ...tive{resource.class-name}IT.tpl.qute.scala | 0 .../{resource.class-name}Test.tpl.qute.scala | 0 .../base/README.tpl.qute.md | 0 .../META-INF/resources/index.entry.qute.html | 0 .../codestart.yml | 10 +- .../acme/{resource.class-name}.tpl.qute.java | 0 ...ative{resource.class-name}IT.tpl.qute.java | 0 .../{resource.class-name}Test.tpl.qute.java | 0 .../acme/{resource.class-name}.tpl.qute.kt | 0 .../Native{resource.class-name}IT.tpl.qute.kt | 0 .../{resource.class-name}Test.tpl.qute.kt | 0 .../acme/{resource.class-name}.tpl.qute.scala | 0 ...tive{resource.class-name}IT.tpl.qute.scala | 0 .../{resource.class-name}Test.tpl.qute.scala | 0 .../base/README.tpl.qute.md | 0 .../META-INF/resources/index.entry.qute.html | 0 .../spring-web-codestart}/codestart.yml | 12 +- .../acme/{resource.class-name}.tpl.qute.java | 0 ...ative{resource.class-name}IT.tpl.qute.java | 0 .../{resource.class-name}Test.tpl.qute.java | 0 .../acme/{resource.class-name}.tpl.qute.kt | 0 .../Native{resource.class-name}IT.tpl.qute.kt | 0 .../{resource.class-name}Test.tpl.qute.kt | 0 .../acme/{resource.class-name}.tpl.qute.scala | 0 ...tive{resource.class-name}IT.tpl.qute.scala | 0 .../{resource.class-name}Test.tpl.qute.scala | 0 .../project/quarkus/base/README.tpl.qute.md | 9 +- .../quarkus/base/index-entry.include.qute | 2 +- .../META-INF/resources/index.tpl.qute.html | 6 +- .../devtools/codestarts/Codestart.java | 5 + .../quarkus/QuarkusCodestartCatalog.java | 69 +++-- .../quarkus/QuarkusCodestartData.java | 30 +- .../quarkus/QuarkusCodestartProjectInput.java | 29 +- .../QuarkusCodestartProjectInputBuilder.java | 44 +-- .../devtools/commands/CreateProject.java | 22 +- .../handlers/CreateProjectCommandHandler.java | 11 +- .../catalog/processor/ExtensionProcessor.java | 29 +- .../catalog/processor/MetadataValue.java | 6 +- .../codestarts/QuarkusCodestartTest.java | 50 ++-- .../QuarkusCodestartTestBuilder.java | 14 +- .../quarkus/QuarkusCodestartCatalogTest.java | 30 +- .../QuarkusCodestartGenerationTest.java | 280 +----------------- .../quarkus/RESTEasyCodestartTest.java} | 6 +- .../RESTEasyReactiveCodestartTest.java | 26 ++ .../quarkus/SpringWebCodestartTest.java | 26 ++ .../src_main_java_org_acme_HelloCommando.java | 19 -- ..._main_java_com_test_andy_AndyCommando.java | 19 -- .../generateDefault/README.md | 2 +- ...ava_org_acme_NativeGreetingResourceIT.java | 9 - ...st_java_org_acme_GreetingResourceTest.java | 21 -- ...c_main_kotlin_org_acme_GreetingResource.kt | 14 - ...otlin_org_acme_NativeGreetingResourceIT.kt | 6 - ...main_scala_org_acme_GreetingResource.scala | 12 - ...la_org_acme_NativeGreetingResourceIT.scala | 6 - ...c_main_java_org_acme_GreetingResource.java | 16 - ...main_scala_org_acme_GreetingResource.scala | 12 - ...c_main_java_org_acme_GreetingResource.java | 2 +- ...st_java_org_acme_GreetingResourceTest.java | 2 +- ...c_main_java_org_acme_GreetingResource.java | 2 +- ...st_java_org_acme_GreetingResourceTest.java | 2 +- ...c_main_kotlin_org_acme_GreetingResource.kt | 14 - ...otlin_org_acme_NativeGreetingResourceIT.kt | 6 - ...la_org_acme_NativeGreetingResourceIT.scala | 6 - ...in_resources_META-INF_resources_index.html | 12 +- ...c_main_java_org_acme_GreetingResource.java | 16 - ...in_resources_META-INF_resources_index.html | 183 ------------ ...acme_NativeSpringGreetingControllerIT.java | 9 - ...n_java_my_custom_app_GreetingResource.java | 16 - ...c_main_java_my_custom_app_funqy_Funqy.java | 19 -- ...rc_main_java_my_custom_app_qute_Quark.java | 25 -- ..._java_my_custom_app_qute_QuteResource.java | 55 ---- ...java_my_custom_app_resteasyqute_Quark.java | 25 -- ..._custom_app_resteasyqute_QuteResource.java | 55 ---- ...va_my_custom_app_GreetingResourceTest.java | 21 -- ...st_java_my_custom_app_funqy_FunqyTest.java | 23 -- .../src_GreetingCommand.java | 23 +- ..._java_ilove_quark_us_GreetingResource.java | 2 +- ..._kotlin_ilove_quark_us_GreetingResource.kt | 2 +- ...cala_ilove_quark_us_GreetingResource.scala | 2 +- ...a_ilove_quark_us_GreetingResourceTest.java | 2 +- ...ove_quark_us_NativeGreetingResourceIT.java | 0 ...lin_ilove_quark_us_GreetingResourceTest.kt | 2 +- ...ilove_quark_us_NativeGreetingResourceIT.kt | 0 ..._ilove_quark_us_GreetingResourceTest.scala | 2 +- ...ve_quark_us_NativeGreetingResourceIT.scala | 0 ...ve_quark_us_ReactiveGreetingResource.java} | 8 +- ...love_quark_us_ReactiveGreetingResource.kt} | 8 +- ...e_quark_us_ReactiveGreetingResource.scala} | 8 +- ..._us_NativeReactiveGreetingResourceIT.java} | 4 +- ...uark_us_ReactiveGreetingResourceTest.java} | 8 +- ...ark_us_NativeReactiveGreetingResourceIT.kt | 6 + ..._quark_us_ReactiveGreetingResourceTest.kt} | 8 +- ..._us_NativeReactiveGreetingResourceIT.scala | 6 + ...ark_us_ReactiveGreetingResourceTest.scala} | 8 +- ...va_ilove_quark_us_GreetingController.java} | 6 +- ...otlin_ilove_quark_us_GreetingController.kt | 14 + ...la_ilove_quark_us_GreetingController.scala | 12 + ...love_quark_us_GreetingControllerTest.java} | 6 +- ..._quark_us_NativeGreetingControllerIT.java} | 4 +- ..._ilove_quark_us_GreetingControllerTest.kt} | 8 +- ...ove_quark_us_NativeGreetingControllerIT.kt | 6 + ...ove_quark_us_GreetingControllerTest.scala} | 8 +- ..._quark_us_NativeGreetingControllerIT.scala | 6 + .../CustomRESTEasyCodestartBuildIT.java | 29 ++ ...ustomRESTEasyReactiveCodestartBuildIT.java | 29 ++ .../CustomSpringWebCodestartBuildIT.java | 29 ++ ...unIT.java => QuarkusCodestartBuildIT.java} | 78 ++--- ...TEasyReactiveExtensionsCodestartTest.java} | 2 +- .../devtools/commands/CreateProjectTest.java | 8 +- .../catalog/ExtensionProcessorTest.java | 4 +- ...src_main_java_ilove_quark_us_SomePage.java | 24 ++ ...src_main_kotlin_ilove_quark_us_SomePage.kt | 22 ++ ...in_resources_templates_some-page.qute.html | 25 ++ 266 files changed, 1040 insertions(+), 2177 deletions(-) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/amazon-lambda-example/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/amazon-lambda-example/codestart.yml (90%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/amazon-lambda-example/java/payload.json (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/amazon-lambda-example/java/src/main/java/org/acme/lambda/GreetingLambda.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/amazon-lambda-example/java/src/main/java/org/acme/lambda/Person.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/amazon-lambda-example/java/src/native-test/java/org/acme/lambda/LambdaHandlerTestIT.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/amazon-lambda-example/java/src/test/java/org/acme/lambda/LambdaHandlerTest.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/amazon-lambda-example/java/src/test/resources/application.yml (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/azure-functions-http-example/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/azure-functions-http-example/base/azure-config/function.tpl.qute.json (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/azure-functions-http-example/base/azure-config/host.json (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/azure-functions-http-example/base/azure-config/local.settings.json (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/azure-functions-http-example/base/pom.tpl.qute.xml (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/azure-functions-http-example/base/src/main/resources/application.tpl.qute.yml (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/azure-functions-http-example/codestart.yml (96%) delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/README.tpl.qute.md delete mode 100755 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/base/src/main/resources/application.yml delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/codestart.yml delete mode 100755 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/java/src/main/java/org/acme/config/ConfigResource.java delete mode 100755 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/config-example/kotlin/src/main/kotlin/org/acme/config/ConfigResource.kt rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-amazon-lambda-example/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-amazon-lambda-example/codestart.yml (92%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-amazon-lambda-example/java/payload.json (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/GreetingFunction.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-amazon-lambda-example/java/src/main/java/org/acme/funqy/Person.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/{funqy-http-example => funqy-amazon-lambda-example}/java/src/native-test/java/org/acme/funqy/FunqyIT.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-amazon-lambda-example/java/src/native-test/java/resources/application.properties (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-amazon-lambda-example/java/src/test/java/org/acme/funqy/FunqyTest.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-amazon-lambda-example/java/src/test/resources/application.yml (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-google-cloud-functions-example/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-google-cloud-functions-example/codestart.yml (90%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingFunctions.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-google-cloud-functions-example/java/src/main/java/org/acme/funqygooglecloudfunctions/GreetingService.java (100%) delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/codestart.yml delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/main/java/org/acme/funqy/Funqy.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/funqy-http-example/java/src/test/java/org/acme/funqy/FunqyTest.java rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-knative-events-example/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-knative-events-example/codestart.yml (93%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/CloudEventGreeting.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-knative-events-example/java/src/main/java/org/acme/funqy/cloudevent/Person.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-knative-events-example/java/src/main/k8s/funqy-service.tpl.qute.yaml (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-knative-events-example/java/src/main/k8s/funqy-trigger.tpl.qute.yaml (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-knative-events-example/java/src/native-test/java/org/acme/funqy/cloudevent/FunqyIT.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/funqy-knative-events-example/java/src/test/java/org/acme/funqy/cloudevent/FunqyTest.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-example/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-example/codestart.yml (90%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldBackgroundFunction.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-example/java/src/main/java/org/acme/googlecloudfunctions/HelloWorldHttpFunction.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-http-example/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-http-example/codestart.yml (94%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingFunqy.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingResource.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingRoutes.java (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{singleton-examples => examples}/google-cloud-functions-http-example/java/src/main/java/org/acme/googlecloudfunctions/GreetingServlet.java (100%) delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/src/main/resources/META-INF/resources/index.entry.qute.html delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/base/src/main/resources/application.yml delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/codestart.yml delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/java/src/main/java/org/acme/logging/json/LoggingJsonResource.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/logging-json/kotlin/src/main/kotlin/org/acme/logging/json/LoggingJsonResource.kt delete mode 100755 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/EntryCommand.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/GoodbyeCommand.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/GreetingService.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/java/src/main/java/org/acme/picocli/HelloCommand.java delete mode 100755 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/kotlin/src/main/kotlin/org/acme/picocli/EntryCommand.kt delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/kotlin/src/main/kotlin/org/acme/picocli/GoodbyeCommand.kt delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/kotlin/src/main/kotlin/org/acme/picocli/GreetingService.kt delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/picocli-example/kotlin/src/main/kotlin/org/acme/picocli/HelloCommand.kt delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/base/src/main/resources/META-INF/resources/index.entry.qute.html delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/codestart.yml delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/java/src/main/java/org/acme/resteasyjackson/JacksonResource.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/java/src/main/java/org/acme/resteasyjackson/MyObjectMapperCustomizer.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/kotlin/src/main/kotlin/org/acme/resteasyjackson/JacksonResource.kt delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example/kotlin/src/main/kotlin/org/acme/resteasyjackson/MyObjectMapperCustomizer.kt delete mode 100644 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 delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/base/src/main/resources/templates/page.qute.tpl.qute.html delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/codestart.yml delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/java/src/main/java/org/acme/resteasyqute/Quark.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/java/src/main/java/org/acme/resteasyqute/QuteResource.java delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/kotlin/src/main/kotlin/org/acme/resteasyqute/Quark.kt delete mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example/kotlin/src/main/kotlin/org/acme/resteasyqute/QuteResource.kt create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/base/README.tpl.qute.md create mode 100755 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/base/src/main/resources/application.yml create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/codestart.yml create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/java/src/main/java/org/acme/GreetingConfig.java create mode 100755 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/config-yaml-codestart/kotlin/src/main/kotlin/org/acme/GreetingConfig.kt rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{examples/funqy-http-example => extension-codestarts/funqy-http-codestart}/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{examples/config-example => extension-codestarts/funqy-http-codestart}/base/src/main/resources/META-INF/resources/index.entry.qute.html (100%) create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/codestart.yml create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/main/java/org/acme/MyFunctions.java create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/native-test/java/org/acme/MyFunctionsIT.java create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/funqy-http-codestart/java/src/test/java/org/acme/MyFunctionsTest.java rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{examples/picocli-example => extension-codestarts/picocli-codestart}/base/README.tpl.qute.md (84%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{examples/picocli-example => extension-codestarts/picocli-codestart}/codestart.yml (89%) create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/java/src/main/java/org/acme/GreetingCommand.java create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/picocli-codestart/kotlin/src/main/kotlin/org/acme/GreetingCommand.kt rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{examples/logging-json => extension-codestarts/resteasy-qute-codestart}/base/README.tpl.qute.md (100%) rename devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/{examples/funqy-http-example => extension-codestarts/resteasy-qute-codestart}/base/src/main/resources/META-INF/resources/index.entry.qute.html (100%) create mode 100644 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 create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/codestart.yml create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/java/src/main/java/org/acme/SomePage.java create mode 100644 devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-qute-codestart/kotlin/src/main/kotlin/org/acme/SomePage.kt delete mode 100644 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 create mode 100644 devtools/project-core-extension-codestarts/src/test/java/io/quarkus/devtools/codestarts/quarkus/FunqyHttpCodestartTest.java create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingConfig.java create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/ConfigYamlCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingConfig.kt create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_main_java_ilove_quark_us_MyFunctions.java create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_test_java_ilove_quark_us_MyFunctionsIT.java create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/FunqyHttpCodestartTest/testContent/src_test_java_ilove_quark_us_MyFunctionsTest.java create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/PicocliCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingCommand.java create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/PicocliCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingCommand.kt create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_java_ilove_quark_us_SomePage.java create mode 100644 devtools/project-core-extension-codestarts/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_kotlin_ilove_quark_us_SomePage.kt delete mode 100644 independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/commandmode-example/codestart.yml delete mode 100644 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 delete mode 100644 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 delete mode 100644 independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-example/base/README.tpl.qute.md delete mode 100644 independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-reactive-example/base/README.tpl.qute.md delete mode 100644 independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/examples/spring-web-example/base/README.tpl.qute.md rename {devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-jackson-example => independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart}/base/README.tpl.qute.md (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/base/src/main/resources/META-INF/resources/index.entry.qute.html (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/codestart.yml (66%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-example => extension-codestarts/resteasy-codestart}/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala (100%) rename {devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/examples/resteasy-qute-example => independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart}/base/README.tpl.qute.md (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/base/src/main/resources/META-INF/resources/index.entry.qute.html (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/codestart.yml (64%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/resteasy-reactive-example => extension-codestarts/resteasy-reactive-codestart}/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/commandmode-example => extension-codestarts/spring-web-codestart}/base/README.tpl.qute.md (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/base/src/main/resources/META-INF/resources/index.entry.qute.html (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/codestart.yml (59%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/java/src/native-test/java/org/acme/Native{resource.class-name}IT.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/kotlin/src/native-test/kotlin/org/acme/Native{resource.class-name}IT.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/scala/src/native-test/scala/org/acme/Native{resource.class-name}IT.tpl.qute.scala (100%) rename independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/{examples/spring-web-example => extension-codestarts/spring-web-codestart}/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala (100%) rename independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/{testing/codestarts/QuarkusCodestartTestExtensionTest.java => codestarts/quarkus/RESTEasyCodestartTest.java} (85%) create mode 100644 independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyReactiveCodestartTest.java create mode 100644 independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/SpringWebCodestartTest.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateCommandMode/src_main_java_org_acme_HelloCommando.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateCommandModeCustom/src_main_java_com_test_andy_AndyCommando.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_native-test_java_org_acme_NativeGreetingResourceIT.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_test_java_org_acme_GreetingResourceTest.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_native-test_kotlin_org_acme_NativeGreetingResourceIT.kt delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_main_scala_org_acme_GreetingResource.scala delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_native-test_scala_org_acme_NativeGreetingResourceIT.scala delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyJava/src_main_java_org_acme_GreetingResource.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyScala/src_main_scala_org_acme_GreetingResource.scala delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_test_kotlin_org_acme_NativeGreetingResourceIT.kt delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_test_scala_org_acme_NativeGreetingResourceIT.scala delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_java_org_acme_GreetingResource.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_resources_META-INF_resources_index.html delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_NativeSpringGreetingControllerIT.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_GreetingResource.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_funqy_Funqy.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_qute_Quark.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_qute_QuteResource.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_resteasyqute_Quark.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_main_java_my_custom_app_resteasyqute_QuteResource.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_GreetingResourceTest.java delete mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_funqy_FunqyTest.java rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_main_java_ilove_quark_us_GreetingResource.java (91%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_main_kotlin_ilove_quark_us_GreetingResource.kt (90%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_main_scala_ilove_quark_us_GreetingResource.scala (89%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_test_java_ilove_quark_us_GreetingResourceTest.java (90%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_test_java_ilove_quark_us_NativeGreetingResourceIT.java (100%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_test_kotlin_ilove_quark_us_GreetingResourceTest.kt (89%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingResourceIT.kt (100%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_test_scala_ilove_quark_us_GreetingResourceTest.scala (89%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartTestExtensionTest => RESTEasyCodestartTest}/testContent/src_test_scala_ilove_quark_us_NativeGreetingResourceIT.scala (100%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateGradleResteasyJava/src_main_java_org_acme_GreetingResource.java => RESTEasyReactiveCodestartTest/testContent/src_main_java_ilove_quark_us_ReactiveGreetingResource.java} (61%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateGradleWithKotlinDslResteasyKotlin/src_main_kotlin_org_acme_GreetingResource.kt => RESTEasyReactiveCodestartTest/testContent/src_main_kotlin_ilove_quark_us_ReactiveGreetingResource.kt} (57%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_main_scala_org_acme_GreetingResource.scala => RESTEasyReactiveCodestartTest/testContent/src_main_scala_ilove_quark_us_ReactiveGreetingResource.scala} (54%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateWithCustomPackage/src_test_java_my_custom_app_NativeGreetingResourceIT.java => RESTEasyReactiveCodestartTest/testContent/src_test_java_ilove_quark_us_NativeReactiveGreetingResourceIT.java} (51%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_GreetingResourceTest.java => RESTEasyReactiveCodestartTest/testContent/src_test_java_ilove_quark_us_ReactiveGreetingResourceTest.java} (66%) create mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeReactiveGreetingResourceIT.kt rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateGradleResteasyKotlin/src_test_kotlin_org_acme_GreetingResourceTest.kt => RESTEasyReactiveCodestartTest/testContent/src_test_kotlin_ilove_quark_us_ReactiveGreetingResourceTest.kt} (65%) create mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/RESTEasyReactiveCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeReactiveGreetingResourceIT.scala rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateGradleResteasyScala/src_test_scala_org_acme_GreetingResourceTest.scala => RESTEasyReactiveCodestartTest/testContent/src_test_scala_ilove_quark_us_ReactiveGreetingResourceTest.scala} (65%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_main_java_org_acme_SpringGreetingController.java => SpringWebCodestartTest/testContent/src_main_java_ilove_quark_us_GreetingController.java} (75%) create mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_kotlin_ilove_quark_us_GreetingController.kt create mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_main_scala_ilove_quark_us_GreetingController.scala rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_SpringGreetingControllerTest.java => SpringWebCodestartTest/testContent/src_test_java_ilove_quark_us_GreetingControllerTest.java} (77%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateRESTEasySpringWeb/src_test_java_org_acme_NativeGreetingResourceIT.java => SpringWebCodestartTest/testContent/src_test_java_ilove_quark_us_NativeGreetingControllerIT.java} (54%) rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateMavenResteasyKotlin/src_test_kotlin_org_acme_GreetingResourceTest.kt => SpringWebCodestartTest/testContent/src_test_kotlin_ilove_quark_us_GreetingControllerTest.kt} (68%) create mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_kotlin_ilove_quark_us_NativeGreetingControllerIT.kt rename independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/{QuarkusCodestartGenerationTest/generateMavenResteasyScala/src_test_scala_org_acme_GreetingResourceTest.scala => SpringWebCodestartTest/testContent/src_test_scala_ilove_quark_us_GreetingControllerTest.scala} (68%) create mode 100644 independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/SpringWebCodestartTest/testContent/src_test_scala_ilove_quark_us_NativeGreetingControllerIT.scala create mode 100644 integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyCodestartBuildIT.java create mode 100644 integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyReactiveCodestartBuildIT.java create mode 100644 integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomSpringWebCodestartBuildIT.java rename integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/{QuarkusCodestartRunIT.java => QuarkusCodestartBuildIT.java} (63%) rename integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/{TestRESTEasyReactiveExtensionsCodestart.java => RESTEasyReactiveExtensionsCodestartTest.java} (93%) create mode 100644 integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_java_ilove_quark_us_SomePage.java create mode 100644 integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_kotlin_ilove_quark_us_SomePage.kt create mode 100644 integration-tests/devtools/src/test/resources/__snapshots__/RESTEasyQuteCodestartTest/testContent/src_main_resources_templates_some-page.qute.html 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 c1156e2a74a6d..fca521414d6f3 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 914a61d183623..921f1c7580905 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 8afe7ecbb7afb..40de3a544e76a 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 bffb79cd5a7dc..b2dba0af52ccf 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 4d1a05ebb5d47..0000000000000 --- 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 57ebddd227388..0000000000000 --- 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 a9ac14deb627b..0000000000000 --- 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 60925f5da57ad..0000000000000 --- 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 9e4062a8dc020..0000000000000 --- 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 08ff591491429..ff7bfaf26b25d 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 ec961f8eab675..eee6f19f7669a 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 c07bf5bbabf23..0000000000000 --- 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 1459171f0a48a..0000000000000 --- 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 54e2f89371594..0000000000000 --- 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 9357d42994e22..2e7729c6fcc81 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 9d433d9bbe576..4d7637caf8d55 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 0e452283e55af..ef590eacbbfc5 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 a1768e062a782..0000000000000 --- 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 595acd4bf3c00..0000000000000 --- 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 a7bce02831a26..0000000000000 --- 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 5f6e996669b2e..0000000000000 --- 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 3972de99a5c3a..0000000000000 --- 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 4447b7610861e..0000000000000 --- 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 653ba227a5540..0000000000000 --- 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 9aab532b25d51..0000000000000 --- 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 05b638be16534..0000000000000 --- 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 fd5b34937dd2c..0000000000000 --- 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 a1768e062a782..0000000000000 --- 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 14982d0f5b581..0000000000000 --- 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 be9b0f4a246ca..0000000000000 --- 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 7c54bb8ad80fe..0000000000000 --- 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 91dec46ab26b6..0000000000000 --- 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 18b7a813d3361..0000000000000 --- 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 cf292f66726be..0000000000000 --- 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 0000000000000..c80dfdef4fd94 --- /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 0000000000000..3f3ebe1d67d7a --- /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 0000000000000..d2feac9e6d0bf --- /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 0000000000000..11c6eff61bdc4 --- /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 0000000000000..4afdccbe6eae8 --- /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 0000000000000..a92559daaf135 --- /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: /greet + 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 0000000000000..c098e2c1e937d --- /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 fun(FunInput input) { + return String.format("Hello %s!", input != null ? input.name : "Funqy"); + } + + + public static class FunInput { + 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 0000000000000..da26cfe4f2283 --- /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 0000000000000..d192d90bf55db --- /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 testFun() { + given() + .post("/fun") + .then() + .statusCode(200) + .body(containsString("Hello Funqy!")); + } + + @Test + public void testFunWithName() { + given() + .contentType(ContentType.JSON) + .body("{\"name\": \"Friend\"}") + .post("/fun") + .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 eb1ae983ef01e..ef900f75e1962 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 84a8140dd0b23..4709ebde9cbe3 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 0000000000000..f8e217057eb30 --- /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 0000000000000..8ad84b573f1e1 --- /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 0000000000000..ee48d214c4ebf --- /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 0000000000000..8574e9fd9b399 --- /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 0000000000000..2b070ebf8bb7c --- /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 0000000000000..4fa7e805020ee --- /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 cce22690603da..0000000000000 --- 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 997f0a940a8ea..d6952d49e6aca 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 0000000000000..52e192c2c83b1 --- /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 cc55b8031d55b..f331290d8260f 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 29754ba38018d..5fa10cfe06324 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 0000000000000..b7ae8f885850a --- /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 0000000000000..c954d4e6c3d0f --- /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 48690a97f6104..527a35f658076 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 0000000000000..c9efc16d6e47b --- /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 fun(FunInput input) { + return String.format("Hello %s!", input != null ? input.name : "Funqy"); + } + + + public static class FunInput { + 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 0000000000000..39a25c95d57b7 --- /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 0000000000000..65850cad613eb --- /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 testFun() { + given() + .post("/fun") + .then() + .statusCode(200) + .body(containsString("Hello Funqy!")); + } + + @Test + public void testFunWithName() { + given() + .contentType(ContentType.JSON) + .body("{\"name\": \"Friend\"}") + .post("/fun") + .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 0000000000000..3ca5dc4809f83 --- /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 0000000000000..b49b1c9819564 --- /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 0000000000000..b38e25e600637 --- /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 0000000000000..367550a571035 --- /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 a9918d531acbd..203bd4b37d469 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 2ee1bbc6ae8e3..f8087d19aa159 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 2aeee3ab9503c..74f01f7f2cee7 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 1204e40213087..b86d2e3b778d7 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 7bc9f799d026c..26377d23af48c 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 b5c836c5a9080..6dd65780d0a36 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 f6cf411f8601e..6433a304f9082 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 5e00f4a8b8e4e..5c211e4a81f05 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 5f0a942727e55..fa2cf527f96fa 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 fdbcba4ad7625..2b19e2ea94e93 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 bca80ee52813f..6f5015609223a 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 a4ed290c92e1c..da8a7a32ac1f4 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 b61573c084f6f..98e00fd0e8915 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 5b4dfa0e71239..03324472adbb7 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 eab2a1018bdf3..d5e141fad045d 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 f90c09141b2d4..0813536db403c 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 974429c85bdcf..6a89b9b50640c 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 56accde672505..166616c962f27 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 a61da811b5e39..4c3f909616418 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 9b0c1ece311d1..0000000000000 --- 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 dfc21d94a5acc..0000000000000 --- 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 8b326610e49ed..0000000000000 --- 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 405280158877d..0000000000000 --- 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 405280158877d..0000000000000 --- 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 405280158877d..0000000000000 --- 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 585b0f88623f5..5394def3a880e 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: "/hello" 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 163a7d1048b9c..e5cc09866bd9e 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: "/hello" 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 a4c51fa3e6ba8..84dcabedf1593 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: "/greeting" 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 a932a3ed00626..ca98c75e4515c 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 c11ee97da52d2..ffa3c4a86bd44 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 7106cecab53f6..6acd81cc100e6 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 a5fc82a2afea7..78eedc3781b94 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 8b550bf04a15d..6ffc8b3ae1769 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) { - // remove other examples - projectCodestarts.removeIf(c -> isExample(c) && !c.containsTag(Tag.SINGLETON_EXAMPLE.key())); - } else if (examplesWithCompatIssues > 1) { + if (examples == 1) { + // remove extension codestarts + projectCodestarts.removeIf(QuarkusCodestartCatalog::isExtensionCodestart); + } 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 ba6d52cbdb97a..14240b7cf274c 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 ddd1fc8b0c61b..90f54683aea72 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 0111f446cadc4..00ca78c79c20c 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 0c78f241e84e5..f0081d35f04a5 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 d2ad85cee823e..960cdc3939157 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 ff50a14cc703f..a729a2b6d6fa7 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 3e24f24ad7ea4..954cf6c12291e 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 0c83dfc9dfc29..e263d0b178617 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 68a7a8aa74509..4d48844378eec 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 1134de2841d16..7ae5b59820852 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 ba4bb287fff80..c75a848b601d7 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 0000000000000..aa5cbd29b07e5 --- /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 0000000000000..88441b439ae61 --- /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 1454bd7963fab..0000000000000 --- 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 3673964fd569b..0000000000000 --- 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 1826c6389baa2..cc6a46353b6ee 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 043ae18256485..0000000000000 --- 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 ca2efef29c249..0000000000000 --- 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 e9f434ae958e9..0000000000000 --- 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 9a773adc7db0c..0000000000000 --- 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 afe92d9014073..0000000000000 --- 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 c31493e7be710..0000000000000 --- 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 6adb758a7dc6d..0000000000000 --- 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 afe92d9014073..0000000000000 --- 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 6adb758a7dc6d..055f53c6fe033 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("/hello") 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 ca2efef29c249..87fbd5c63652f 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("/hello") .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 6adb758a7dc6d..055f53c6fe033 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("/hello") 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 ca2efef29c249..87fbd5c63652f 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("/hello") .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 e9f434ae958e9..0000000000000 --- 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 9a773adc7db0c..0000000000000 --- 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 c31493e7be710..0000000000000 --- 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 6575420c4a96f..87939211b8d01 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 6adb758a7dc6d..0000000000000 --- 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 1a845be55557d..0000000000000 --- 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 38428ce8f7200..0000000000000 --- 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 accf61bcb44ed..0000000000000 --- 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 aa229c8105b7c..0000000000000 --- 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 a1f180edbd3d5..0000000000000 --- 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 2ab3f23f36948..0000000000000 --- 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 b159293e074ee..0000000000000 --- 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 c5c2baf606956..0000000000000 --- 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 f248d0a6a953f..0000000000000 --- 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 ca3531786ccce..0000000000000 --- 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 a4f62e6ea3fb0..c2f215e4d510f 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 b8fffb7dcc77c..ff566718859d8 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("/hello") 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 284a82f1b5542..b014bba668107 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("/hello") 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 27d34bef636ce..7d287aeb54226 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("/hello") 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 15b7922618a52..782809e3d11ab 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("/hello") .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 6c5b523897c30..3584408aceb3c 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("/hello") .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 93e1d7e85a54d..12d028989cb44 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("/hello") .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 6adb758a7dc6d..73b398d89e886 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("/hello") +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 e9f434ae958e9..f169f9c72002b 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("/hello") +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 afe92d9014073..6910900107c67 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("/hello") +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 c6d392dff6654..0beb8220d0c3b 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 66% 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 ca2efef29c249..f730ccf24b773 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("/hello") .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 0000000000000..5343d1af2ecfb --- /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 7a515af98eee9..ebc549d31c83b 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("/hello") .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 0000000000000..32595d995510d --- /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 65% 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 baafe965d0e08..55307c2690a39 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("/hello") .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 c28f85ded5343..9ad9c29d4324d 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("/greeting") +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 0000000000000..563b39d6a3d82 --- /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("/greeting") +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 0000000000000..6c8e027dd7928 --- /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]("/greeting")) +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 bb0b3d27feb88..ca8fe7e06cb92 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("/greeting") .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 043ae18256485..67f8d20c28bf4 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 7a515af98eee9..5786775ebea5d 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("/greeting") .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 0000000000000..572dba0935569 --- /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 baafe965d0e08..d0d5e78076f99 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("/greeting") .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 0000000000000..5ef5066add797 --- /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 0000000000000..12cb0e739a393 --- /dev/null +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyCodestartBuildIT.java @@ -0,0 +1,29 @@ +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 java.io.IOException; + +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") + .build(); + + @Test + void testBuild() throws IOException { + 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 0000000000000..5768403da330f --- /dev/null +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomRESTEasyReactiveCodestartBuildIT.java @@ -0,0 +1,29 @@ +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 java.io.IOException; + +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") + .build(); + + @Test + void testBuild() throws IOException { + 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 0000000000000..23e229eb3609a --- /dev/null +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/CustomSpringWebCodestartBuildIT.java @@ -0,0 +1,29 @@ +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 java.io.IOException; + +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) + .build(); + + @Test + void testBuild() throws IOException { + 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 63% 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 ea1828ad8cbaf..41f15ff0077e9 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,14 +33,14 @@ 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 Path testDirPath = Paths.get("target/quarkus-codestart-build-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"); + private static final Set RUN_ALONE = Sets.newHashSet("resteasy-reactive-codestart", "picocli-codestart"); @BeforeAll static void setUp() throws IOException { @@ -55,47 +53,47 @@ private Map getTestInputData(final Map override) @Test public void testRunTogetherCodestartsJava() throws Exception { - generateProjectRunTests("maven", "java", getRunTogetherExamples(), Collections.emptyMap()); + generateProjectRunTests("maven", "java", getExtensionCodestarts(), Collections.emptyMap()); } @Test public void testRunTogetherCodestartsKotlin() throws Exception { - generateProjectRunTests("maven", "kotlin", getRunTogetherExamples(), Collections.emptyMap()); + generateProjectRunTests("maven", "kotlin", getExtensionCodestarts(), Collections.emptyMap()); } @Test public void testRunTogetherCodestartsScala() throws Exception { - generateProjectRunTests("maven", "scala", getRunTogetherExamples(), Collections.emptyMap()); + generateProjectRunTests("maven", "scala", getExtensionCodestarts(), Collections.emptyMap()); } @ParameterizedTest @MethodSource("provideLanguages") public void testGradle(String language) throws Exception { - final List codestarts = getRunTogetherExamples(); + final List codestarts = getExtensionCodestarts(); generateProjectRunTests("gradle", language, codestarts, Collections.emptyMap()); } @ParameterizedTest @MethodSource("provideLanguages") public void testGradleKotlinDSL(String language) throws Exception { - final List codestarts = getRunTogetherExamples(); + final List codestarts = getExtensionCodestarts(); generateProjectRunTests("gradle-kotlin-dsl", language, codestarts, Collections.emptyMap()); } @ParameterizedTest - @MethodSource("provideRunAloneExamples") + @MethodSource("provideRunAloneCodestarts") public void testRunAloneCodestartsJava(String codestart) throws Exception { generateProjectRunTests("maven", "java", singletonList(codestart), Collections.emptyMap()); } @ParameterizedTest - @MethodSource("provideRunAloneExamples") + @MethodSource("provideRunAloneCodestarts") public void testRunAloneCodestartsKotlin(String codestart) throws Exception { generateProjectRunTests("maven", "kotlin", singletonList(codestart), Collections.emptyMap()); } @ParameterizedTest - @MethodSource("provideRunAloneExamples") + @MethodSource("provideRunAloneCodestarts") public void testRunAloneCodestartsScala(String codestart) throws Exception { generateProjectRunTests("maven", "scala", singletonList(codestart), Collections.emptyMap()); } @@ -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)); @@ -187,16 +147,16 @@ private QuarkusCodestartCatalog getCatalog() throws IOException { return QuarkusCodestartCatalog.fromExtensionsCatalog(getExtensionsCatalog(), getCodestartsResourceLoaders()); } - private List getRunTogetherExamples() throws IOException { + private List getExtensionCodestarts() throws IOException { return getAllExamples() - .filter(c -> !isRunAloneExample(c)) + .filter(c -> !shouldRunAlone(c)) .map(Codestart::getName) .collect(Collectors.toList()); } - private Stream provideRunAloneExamples() throws IOException { + private Stream provideRunAloneCodestarts() throws IOException { return getAllExamples() - .filter(this::isRunAloneExample) + .filter(this::shouldRunAlone) .map(Codestart::getName) .map(Arguments::of); } @@ -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()); + private boolean shouldRunAlone(Codestart c) { + 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 15f89f6610385..390536dc83b0c 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/java/io/quarkus/devtools/commands/CreateProjectTest.java b/integration-tests/devtools/src/test/java/io/quarkus/devtools/commands/CreateProjectTest.java index 9e14966cb0cd7..940be1866d5ab 100644 --- a/integration-tests/devtools/src/test/java/io/quarkus/devtools/commands/CreateProjectTest.java +++ b/integration-tests/devtools/src/test/java/io/quarkus/devtools/commands/CreateProjectTest.java @@ -124,18 +124,18 @@ public void createRESTEasyAndSpringWeb() throws Exception { .satisfies(checkContains("quarkus-spring-web")) .satisfies(checkContains("quarkus-resteasy")); - assertThat(projectDir.resolve("src/main/java/io/test/SpringGreetingController.java")) + assertThat(projectDir.resolve("src/main/java/io/test/GreetingController.java")) .exists() .satisfies(checkContains("package io.test;")) .satisfies(checkContains("@RestController")) - .satisfies(checkContains("class SpringGreetingController")) - .satisfies(checkContains("@RequestMapping(\"/hello-spring\")")); + .satisfies(checkContains("class GreetingController")) + .satisfies(checkContains("@RequestMapping(\"/greeting\")")); assertThat(projectDir.resolve("src/main/java/io/test/GreetingResource.java")) .exists() .satisfies(checkContains("package io.test;")) .satisfies(checkContains("class GreetingResource")) - .satisfies(checkContains("@Path(\"/hello-resteasy\")")); + .satisfies(checkContains("@Path(\"/hello\")")); } @Test diff --git a/integration-tests/devtools/src/test/java/io/quarkus/platform/catalog/ExtensionProcessorTest.java b/integration-tests/devtools/src/test/java/io/quarkus/platform/catalog/ExtensionProcessorTest.java index 2e33029d23796..5dfa99f0dbb52 100644 --- a/integration-tests/devtools/src/test/java/io/quarkus/platform/catalog/ExtensionProcessorTest.java +++ b/integration-tests/devtools/src/test/java/io/quarkus/platform/catalog/ExtensionProcessorTest.java @@ -19,10 +19,10 @@ void testRESTEasyMetadata() { final Extension resteasy = findExtension(catalog, "quarkus-resteasy"); final ExtensionProcessor extensionProcessor = ExtensionProcessor.of(resteasy); - assertThat(extensionProcessor.getTags()).contains("provides-example"); + assertThat(extensionProcessor.getTags()).contains("provides-code"); assertThat(extensionProcessor.getShortName()).contains("jax-rs"); assertThat(extensionProcessor.getCategories()).contains("web"); - assertThat(extensionProcessor.getCodestartKind()).isEqualTo(ExtensionProcessor.CodestartKind.EXAMPLE); + assertThat(extensionProcessor.getCodestartKind()).isEqualTo(ExtensionProcessor.CodestartKind.EXTENSION_CODESTART); assertThat(extensionProcessor.getCodestartName()).isEqualTo("resteasy"); assertThat(extensionProcessor.getCodestartArtifact()) .isEqualTo("io.quarkus:quarkus-project-core-extension-codestarts::jar:" + getQuarkusCoreVersion()); 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 0000000000000..67c59b69d8e42 --- /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 0000000000000..088fe55771cf5 --- /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 0000000000000..46c12a74b617c --- /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

    + + From c635100530225bbf1eb4cbdf310a3d74fadd5a55 Mon Sep 17 00:00:00 2001 From: Andy Damevin Date: Thu, 22 Apr 2021 13:36:59 +0200 Subject: [PATCH 2/2] Make devtools-testing test independent from platform --- .../devtools/codestarts/utils/NestedMaps.java | 14 +- .../codestarts/utils/NestedMapsTest.java | 38 +- .../src/test/resources/nested-map-1.yml | 2 + .../jbang/QuarkusJBangCodestartCatalog.java | 8 + .../quarkus/QuarkusCodestartCatalog.java | 18 +- .../testing/PlatformAwareTestBase.java | 16 +- .../devtools/testing/RegistryClientTest.java | 18 + .../codestarts/QuarkusCodestartTest.java | 12 +- .../QuarkusCodestartTestBuilder.java | 14 + ...arkusExtensionCodestartGenerationTest.java | 3 +- .../QuarkusJBangCodestartGenerationTest.java | 5 +- .../quarkus/FakeExtensionCatalog.java | 39 +++ .../quarkus/QuarkusCodestartCatalogTest.java | 6 +- .../QuarkusCodestartGenerationTest.java | 9 +- .../quarkus/RESTEasyCodestartTest.java | 4 + .../RESTEasyReactiveCodestartTest.java | 4 + .../quarkus/SpringWebCodestartTest.java | 4 + .../src/test/resources/fake-catalog.json | 325 ++++++++++++++++++ 18 files changed, 493 insertions(+), 46 deletions(-) create mode 100644 independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/RegistryClientTest.java create mode 100644 independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/FakeExtensionCatalog.java create mode 100644 independent-projects/tools/devtools-testing/src/test/resources/fake-catalog.json diff --git a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/utils/NestedMaps.java b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/utils/NestedMaps.java index b664ce3deba75..535ed649dc1af 100644 --- a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/utils/NestedMaps.java +++ b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/utils/NestedMaps.java @@ -46,10 +46,22 @@ public static void deepMerge(Map left, Map right) { c.addAll((Collection) leftValue); c.addAll((Collection) rightValue); left.put(key, c); - } else { + } else if (rightValue instanceof Map) { + final Map map = new HashMap(); + deepMerge(map, (Map) rightValue); + left.put(key, map); + } else if (rightValue instanceof Collection) { + left.put(key, new LinkedHashSet((Collection) rightValue)); + } else if (rightValue instanceof Integer + || rightValue instanceof Boolean + || rightValue instanceof Float + || rightValue instanceof Long + || rightValue instanceof Double + || rightValue instanceof String) { // Override left.put(key, rightValue); } + // else ignore } } diff --git a/independent-projects/tools/codestarts/src/test/java/io/quarkus/devtools/codestarts/utils/NestedMapsTest.java b/independent-projects/tools/codestarts/src/test/java/io/quarkus/devtools/codestarts/utils/NestedMapsTest.java index f970487572e3a..55b6a977ddb0e 100644 --- a/independent-projects/tools/codestarts/src/test/java/io/quarkus/devtools/codestarts/utils/NestedMapsTest.java +++ b/independent-projects/tools/codestarts/src/test/java/io/quarkus/devtools/codestarts/utils/NestedMapsTest.java @@ -21,22 +21,6 @@ class NestedMapsTest { private static final Map NESTED_MAP_1 = readTestYamlMap("/nested-map-1.yml"); private static final Map NESTED_MAP_2 = readTestYamlMap("/nested-map-2.yml"); - @Test - void testGetValue() { - assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.baz")).hasValue("baz"); - assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.foo")).hasValue("bar"); - assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.bar.baz")).isEmpty(); - assertThat(NestedMaps.getValue(NESTED_MAP_1, "baa")).isEmpty(); - assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.bar.foo")).hasValue("bar"); - assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.bar.bar")).hasValue("foo"); - assertThat(NestedMaps.getValue(NESTED_MAP_1, "bar.foo.bar.foo")).hasValue("baz"); - assertThat((Collection) NestedMaps.getValue(NESTED_MAP_1, "list").get()).containsExactly("foo", "bar"); - assertThat(NestedMaps.getValue(NESTED_MAP_1, "bar.foo.bar")).hasValueSatisfying(v -> { - assertThat(v).isInstanceOf(Map.class); - assertThat((Map) v).hasFieldOrPropertyWithValue("foo", "baz"); - }); - } - @Test void testDeepMerge() { final HashMap target = new HashMap<>(); @@ -54,10 +38,30 @@ void testDeepMergeStream() { checkTargetMap(target); } + @Test + void testGetValue() { + assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.baz")).hasValue("baz"); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.int")).hasValue(1); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.bool")).hasValue(false); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.foo")).hasValue("bar"); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.bar.baz")).isEmpty(); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "baa")).isEmpty(); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.bar.foo")).hasValue("bar"); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "foo.bar.bar")).hasValue("foo"); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "bar.foo.bar.foo")).hasValue("baz"); + assertThat((Collection) NestedMaps.getValue(NESTED_MAP_1, "list").get()).containsExactly("foo", "bar"); + assertThat(NestedMaps.getValue(NESTED_MAP_1, "bar.foo.bar")).hasValueSatisfying(v -> { + assertThat(v).isInstanceOf(Map.class); + assertThat((Map) v).hasFieldOrPropertyWithValue("foo", "baz"); + }); + } + private void checkTargetMap(Map target) { assertThat(NestedMaps.getValue(target, "foo.baz")).hasValue("baz"); assertThat(NestedMaps.getValue(target, "foo.foo")).hasValue("bar"); assertThat(NestedMaps.getValue(target, "foo.bar")).hasValue("foo"); + assertThat(NestedMaps.getValue(target, "foo.int")).hasValue(1); + assertThat(NestedMaps.getValue(target, "foo.bool")).hasValue(false); assertThat(NestedMaps.getValue(target, "foo.bar.baz")).isEmpty(); assertThat(NestedMaps.getValue(target, "baz")).hasValue("bar"); @@ -73,6 +77,8 @@ void testUnflatten() { data.put("foo.baz", "baz"); data.put("foo.foo", "bar"); data.put("foo.bar", "foo"); + data.put("foo.int", 1); + data.put("foo.bool", false); data.put("baz", "bar"); data.put("bar.foo.bar.foo", "bar"); data.put("bar.foo.bar.baz", "foo"); diff --git a/independent-projects/tools/codestarts/src/test/resources/nested-map-1.yml b/independent-projects/tools/codestarts/src/test/resources/nested-map-1.yml index 7e73e29f876f2..5aa33972efb4e 100644 --- a/independent-projects/tools/codestarts/src/test/resources/nested-map-1.yml +++ b/independent-projects/tools/codestarts/src/test/resources/nested-map-1.yml @@ -2,6 +2,8 @@ foo: baz: baz foo: bar + int: 1 + bool: false bar: foo: bar bar: foo diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/jbang/QuarkusJBangCodestartCatalog.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/jbang/QuarkusJBangCodestartCatalog.java index cabd9b483ce8e..ddac5bca8b347 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/jbang/QuarkusJBangCodestartCatalog.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/jbang/QuarkusJBangCodestartCatalog.java @@ -1,6 +1,7 @@ package io.quarkus.devtools.codestarts.jbang; import static io.quarkus.devtools.codestarts.CodestartResourceLoader.loadCodestartsFromResources; +import static io.quarkus.devtools.project.QuarkusProjectHelper.getBaseCodestartResourceLoaders; import io.quarkus.devtools.codestarts.Codestart; import io.quarkus.devtools.codestarts.DataKey; @@ -46,6 +47,13 @@ private QuarkusJBangCodestartCatalog(Collection codestarts) { super(codestarts); } + public static QuarkusJBangCodestartCatalog fromBaseCodestartsResources() + throws IOException { + final Map codestarts = loadCodestartsFromResources(getBaseCodestartResourceLoaders(), + QUARKUS_JBANG_CODESTARTS_DIR); + return new QuarkusJBangCodestartCatalog(codestarts.values()); + } + public static QuarkusJBangCodestartCatalog fromResourceLoaders(List resourceLoaders) throws IOException { final Map codestarts = loadCodestartsFromResources(resourceLoaders, QUARKUS_JBANG_CODESTARTS_DIR); 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 6ffc8b3ae1769..513f159fffa6b 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 @@ -3,6 +3,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.getBaseCodestartResourceLoaders; 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; @@ -23,6 +24,7 @@ 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; @@ -76,7 +78,19 @@ private QuarkusCodestartCatalog(Collection codestarts, this.extensionsMapping = extensionsMapping; } - public static QuarkusCodestartCatalog fromQuarkusPlatformDescriptorAndDirectories( + public static QuarkusCodestartCatalog fromBaseCodestartsResources(Map extensionsMapping) + throws IOException { + final Map codestarts = loadCodestartsFromResources(getBaseCodestartResourceLoaders(), + QUARKUS_CODESTARTS_DIR); + return new QuarkusCodestartCatalog(codestarts.values(), extensionsMapping); + } + + public static QuarkusCodestartCatalog fromBaseCodestartsResources() + throws IOException { + return fromBaseCodestartsResources(Collections.emptyMap()); + } + + public static QuarkusCodestartCatalog fromExtensionsCatalogAndDirectories( ExtensionCatalog catalog, Collection directories) throws IOException { final Map codestarts = loadCodestartsFromResources(getCodestartResourceLoaders(catalog), @@ -220,7 +234,7 @@ public static boolean isExample(Codestart codestart) { return codestart.getType() == CodestartType.CODE && codestart.containsTag(Tag.EXAMPLE.key()); } - private static Map buildExtensionsMapping( + public static Map buildExtensionsMapping( Collection extensions) { final Map map = new HashMap<>(extensions.size()); extensions.forEach(e -> { diff --git a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/PlatformAwareTestBase.java b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/PlatformAwareTestBase.java index b182a3f11e5f6..0d00441aac728 100644 --- a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/PlatformAwareTestBase.java +++ b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/PlatformAwareTestBase.java @@ -6,24 +6,16 @@ import io.quarkus.registry.catalog.ExtensionCatalog; import java.util.List; import java.util.Properties; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.RegisterExtension; public class PlatformAwareTestBase { + @RegisterExtension + static final RegistryClientTest registryClientTest = new RegistryClientTest(); + private ExtensionCatalog catalog; private Properties quarkusProps; - @BeforeAll - static void enableDevToolsTestConfig() { - RegistryClientTestHelper.enableRegistryClientTestConfig(); - } - - @AfterAll - static void disableDevToolsTestConfig() { - RegistryClientTestHelper.disableRegistryClientTestConfig(); - } - protected List getCodestartsResourceLoaders() { return QuarkusProjectHelper.getCodestartResourceLoaders(getExtensionsCatalog()); } diff --git a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/RegistryClientTest.java b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/RegistryClientTest.java new file mode 100644 index 0000000000000..a1e2fb82ff6ab --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/RegistryClientTest.java @@ -0,0 +1,18 @@ +package io.quarkus.devtools.testing; + +import org.junit.jupiter.api.extension.AfterAllCallback; +import org.junit.jupiter.api.extension.BeforeAllCallback; +import org.junit.jupiter.api.extension.ExtensionContext; + +public class RegistryClientTest implements BeforeAllCallback, AfterAllCallback { + + @Override + public void beforeAll(ExtensionContext extensionContext) throws Exception { + RegistryClientTestHelper.enableRegistryClientTestConfig(); + } + + @Override + public void afterAll(ExtensionContext extensionContext) throws Exception { + RegistryClientTestHelper.disableRegistryClientTestConfig(); + } +} 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 e263d0b178617..96aa297597c12 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 @@ -47,6 +47,7 @@ public class QuarkusCodestartTest implements BeforeAllCallback, AfterAllCallback private final BuildTool buildTool; private final Set hasGeneratedProjectsWithMockedData = new HashSet<>(); private final Set hasGeneratedProjectsWithRealData = new HashSet<>(); + private final boolean enableRegistryClient; private Path targetDir; private ExtensionCatalog extensionCatalog; private QuarkusCodestartCatalog quarkusCodestartCatalog; @@ -55,6 +56,9 @@ public class QuarkusCodestartTest implements BeforeAllCallback, AfterAllCallback this.codestarts = builder.codestarts; this.languages = builder.languages; this.buildTool = builder.buildTool; + this.quarkusCodestartCatalog = builder.quarkusCodestartCatalog; + this.extensionCatalog = builder.extensionCatalog; + this.enableRegistryClient = builder.extensionCatalog == null; this.data = builder.data; } @@ -64,7 +68,9 @@ public static QuarkusCodestartTestBuilder builder() { @Override public void beforeAll(ExtensionContext extensionContext) throws Exception { - enableRegistryClientTestConfig(); + if (enableRegistryClient) { + enableRegistryClientTestConfig(); + } targetDir = Paths.get("target/quarkus-codestart-test/" + getTestId()); SnapshotTesting.deleteTestDirectory(targetDir.toFile()); } @@ -200,7 +206,9 @@ private Path getProjectWithMockedDataDir(Language language) throws IOException { @Override public void afterAll(ExtensionContext extensionContext) throws Exception { - disableRegistryClientTestConfig(); + if (enableRegistryClient) { + disableRegistryClientTestConfig(); + } } protected List getCodestartsResourceLoaders() { diff --git a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTestBuilder.java b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTestBuilder.java index 40004b3cae59f..66ca512ad0e14 100644 --- a/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTestBuilder.java +++ b/independent-projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/codestarts/QuarkusCodestartTestBuilder.java @@ -1,8 +1,10 @@ package io.quarkus.devtools.testing.codestarts; import io.quarkus.devtools.codestarts.DataKey; +import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog; import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language; import io.quarkus.devtools.project.BuildTool; +import io.quarkus.registry.catalog.ExtensionCatalog; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -14,6 +16,8 @@ public class QuarkusCodestartTestBuilder { BuildTool buildTool; Set codestarts; Set languages; + QuarkusCodestartCatalog quarkusCodestartCatalog; + ExtensionCatalog extensionCatalog; public QuarkusCodestartTestBuilder codestarts(String... codestarts) { this.codestarts = new HashSet<>(Arrays.asList(codestarts)); @@ -40,6 +44,16 @@ public QuarkusCodestartTestBuilder putData(DataKey key, Object value) { return this; } + public QuarkusCodestartTestBuilder quarkusCodestartCatalog(QuarkusCodestartCatalog quarkusCodestartCatalog) { + this.quarkusCodestartCatalog = quarkusCodestartCatalog; + return this; + } + + public QuarkusCodestartTestBuilder extensionCatalog(ExtensionCatalog extensionCatalog) { + this.extensionCatalog = extensionCatalog; + return this; + } + public QuarkusCodestartTest build() { return new QuarkusCodestartTest(this); } diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/extension/QuarkusExtensionCodestartGenerationTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/extension/QuarkusExtensionCodestartGenerationTest.java index 4138384b2f1b7..5a2e6f4eca0e0 100644 --- a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/extension/QuarkusExtensionCodestartGenerationTest.java +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/extension/QuarkusExtensionCodestartGenerationTest.java @@ -3,7 +3,6 @@ import static io.quarkus.devtools.testing.SnapshotTesting.assertThatDirectoryTreeMatchSnapshots; import io.quarkus.devtools.codestarts.extension.QuarkusExtensionCodestartCatalog.QuarkusExtensionData; -import io.quarkus.devtools.testing.PlatformAwareTestBase; import io.quarkus.devtools.testing.SnapshotTesting; import java.io.IOException; import java.nio.file.Path; @@ -12,7 +11,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -class QuarkusExtensionCodestartGenerationTest extends PlatformAwareTestBase { +class QuarkusExtensionCodestartGenerationTest { private static final Path testDirPath = Paths.get("target/extension-codestart-gen-test"); diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/jbang/QuarkusJBangCodestartGenerationTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/jbang/QuarkusJBangCodestartGenerationTest.java index fcbbf385b7c05..24b0f63139bab 100644 --- a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/jbang/QuarkusJBangCodestartGenerationTest.java +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/jbang/QuarkusJBangCodestartGenerationTest.java @@ -6,7 +6,6 @@ import static io.quarkus.devtools.testing.SnapshotTesting.assertThatDirectoryTreeMatchSnapshots; import static io.quarkus.devtools.testing.SnapshotTesting.assertThatMatchSnapshot; -import io.quarkus.devtools.testing.PlatformAwareTestBase; import io.quarkus.devtools.testing.SnapshotTesting; import java.io.IOException; import java.nio.file.Path; @@ -15,7 +14,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -class QuarkusJBangCodestartGenerationTest extends PlatformAwareTestBase { +class QuarkusJBangCodestartGenerationTest { private static final Path testDirPath = Paths.get("target/jbang-codestart-gen-test"); @@ -52,7 +51,7 @@ void generatePicocliProject(TestInfo testInfo) throws Throwable { } private QuarkusJBangCodestartCatalog getCatalog() throws IOException { - return QuarkusJBangCodestartCatalog.fromResourceLoaders(getCodestartsResourceLoaders()); + return QuarkusJBangCodestartCatalog.fromBaseCodestartsResources(); } } diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/FakeExtensionCatalog.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/FakeExtensionCatalog.java new file mode 100644 index 0000000000000..6b35bfc923e22 --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/FakeExtensionCatalog.java @@ -0,0 +1,39 @@ +package io.quarkus.devtools.codestarts.quarkus; + +import io.quarkus.registry.catalog.ExtensionCatalog; +import io.quarkus.registry.catalog.json.JsonCatalogMapperHelper; +import io.quarkus.registry.catalog.json.JsonExtensionCatalog; +import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; + +public final class FakeExtensionCatalog { + + private static final String FAKE_EXTENSION_CATALOG_PATH = "/fake-catalog.json"; + public static final ExtensionCatalog FAKE_EXTENSION_CATALOG = getFakeExtensionCatalog(); + public static final QuarkusCodestartCatalog FAKE_QUARKUS_CODESTART_CATALOG = getQuarkusCodestartCatalog(); + + private FakeExtensionCatalog() { + } + + private static QuarkusCodestartCatalog getQuarkusCodestartCatalog() { + try { + return QuarkusCodestartCatalog.fromBaseCodestartsResources( + QuarkusCodestartCatalog.buildExtensionsMapping(FAKE_EXTENSION_CATALOG.getExtensions())); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private static ExtensionCatalog getFakeExtensionCatalog() { + InputStream inputString = FakeExtensionCatalog.class.getResourceAsStream(FAKE_EXTENSION_CATALOG_PATH); + if (inputString == null) { + throw new IllegalStateException("Failed to locate " + FAKE_EXTENSION_CATALOG_PATH + " on the classpath"); + } + try { + return JsonCatalogMapperHelper.deserialize(inputString, JsonExtensionCatalog.class); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } +} 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 4d48844378eec..e918f3f2774d4 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 @@ -1,12 +1,12 @@ package io.quarkus.devtools.codestarts.quarkus; +import static io.quarkus.devtools.codestarts.quarkus.FakeExtensionCatalog.FAKE_QUARKUS_CODESTART_CATALOG; import static org.assertj.core.api.Assertions.assertThat; import io.quarkus.devtools.codestarts.Codestart; import io.quarkus.devtools.codestarts.CodestartProjectDefinition; import io.quarkus.devtools.codestarts.CodestartType; import io.quarkus.devtools.project.BuildTool; -import io.quarkus.devtools.testing.PlatformAwareTestBase; import io.quarkus.devtools.testing.SnapshotTesting; import io.quarkus.maven.ArtifactKey; import java.io.IOException; @@ -15,7 +15,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -class QuarkusCodestartCatalogTest extends PlatformAwareTestBase { +class QuarkusCodestartCatalogTest { private final Path projectPath = Paths.get("target/quarkus-codestart-catalog-test"); @@ -140,7 +140,7 @@ void prepareProjectTestResteasy() throws IOException { } private QuarkusCodestartCatalog getCatalog() throws IOException { - return QuarkusCodestartCatalog.fromExtensionsCatalog(getExtensionsCatalog(), getCodestartsResourceLoaders()); + return FAKE_QUARKUS_CODESTART_CATALOG; } } 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 7ae5b59820852..4a174f8b91c2a 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,5 +1,6 @@ package io.quarkus.devtools.codestarts.quarkus; +import static io.quarkus.devtools.codestarts.quarkus.FakeExtensionCatalog.FAKE_QUARKUS_CODESTART_CATALOG; import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey.PROJECT_PACKAGE_NAME; 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; @@ -8,12 +9,10 @@ import static org.assertj.core.api.Assertions.assertThat; import io.quarkus.devtools.project.BuildTool; -import io.quarkus.devtools.testing.PlatformAwareTestBase; import io.quarkus.devtools.testing.SnapshotTesting; import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTesting; import io.quarkus.maven.ArtifactCoords; import io.quarkus.maven.ArtifactKey; -import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; @@ -22,7 +21,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -class QuarkusCodestartGenerationTest extends PlatformAwareTestBase { +class QuarkusCodestartGenerationTest { private static final Path testDirPath = Paths.get("target/quarkus-codestart-gen-test"); @@ -364,8 +363,8 @@ private void checkGradleWithKotlinDsl(Path projectDir) { .satisfies(checkContains("rootProject.name=\"test-codestart\"")); } - private QuarkusCodestartCatalog getCatalog() throws IOException { - return QuarkusCodestartCatalog.fromExtensionsCatalog(getExtensionsCatalog(), getCodestartsResourceLoaders()); + private QuarkusCodestartCatalog getCatalog() { + return FAKE_QUARKUS_CODESTART_CATALOG; } } diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyCodestartTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyCodestartTest.java index c75a848b601d7..67d8e57a77501 100644 --- a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyCodestartTest.java +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/RESTEasyCodestartTest.java @@ -1,5 +1,7 @@ package io.quarkus.devtools.codestarts.quarkus; +import static io.quarkus.devtools.codestarts.quarkus.FakeExtensionCatalog.FAKE_EXTENSION_CATALOG; +import static io.quarkus.devtools.codestarts.quarkus.FakeExtensionCatalog.FAKE_QUARKUS_CODESTART_CATALOG; 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; @@ -12,6 +14,8 @@ class RESTEasyCodestartTest { @RegisterExtension public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .quarkusCodestartCatalog(FAKE_QUARKUS_CODESTART_CATALOG) + .extensionCatalog(FAKE_EXTENSION_CATALOG) .codestarts("resteasy") .languages(JAVA, KOTLIN, SCALA) .build(); 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 index aa5cbd29b07e5..43c8e4dc2ae8d 100644 --- 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 @@ -1,5 +1,7 @@ package io.quarkus.devtools.codestarts.quarkus; +import static io.quarkus.devtools.codestarts.quarkus.FakeExtensionCatalog.FAKE_EXTENSION_CATALOG; +import static io.quarkus.devtools.codestarts.quarkus.FakeExtensionCatalog.FAKE_QUARKUS_CODESTART_CATALOG; 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; @@ -12,6 +14,8 @@ class RESTEasyReactiveCodestartTest { @RegisterExtension public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .quarkusCodestartCatalog(FAKE_QUARKUS_CODESTART_CATALOG) + .extensionCatalog(FAKE_EXTENSION_CATALOG) .codestarts("resteasy-reactive") .languages(JAVA, KOTLIN, SCALA) .build(); 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 index 88441b439ae61..9c6bf6c96952c 100644 --- 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 @@ -1,5 +1,7 @@ package io.quarkus.devtools.codestarts.quarkus; +import static io.quarkus.devtools.codestarts.quarkus.FakeExtensionCatalog.FAKE_EXTENSION_CATALOG; +import static io.quarkus.devtools.codestarts.quarkus.FakeExtensionCatalog.FAKE_QUARKUS_CODESTART_CATALOG; 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; @@ -12,6 +14,8 @@ class SpringWebCodestartTest { @RegisterExtension public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() + .quarkusCodestartCatalog(FAKE_QUARKUS_CODESTART_CATALOG) + .extensionCatalog(FAKE_EXTENSION_CATALOG) .codestarts("spring-web") .languages(JAVA, KOTLIN, SCALA) .build(); diff --git a/independent-projects/tools/devtools-testing/src/test/resources/fake-catalog.json b/independent-projects/tools/devtools-testing/src/test/resources/fake-catalog.json new file mode 100644 index 0000000000000..801fd9dea3fae --- /dev/null +++ b/independent-projects/tools/devtools-testing/src/test/resources/fake-catalog.json @@ -0,0 +1,325 @@ +{ + "id": "io.quarkus:quarkus-bom-quarkus-platform-descriptor:999-SNAPSHOT:json:999-SNAPSHOT", + "platform": true, + "bom": "io.quarkus:quarkus-bom::pom:999-SNAPSHOT", + "derived-from": [], + "extensions": [ + { + "name": "RESTEasy Reactive", + "description": "Reactive implementation of JAX-RS with additional features. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.", + "metadata": { + "short-name": "resteasy-reactive", + "keywords": [ + "jaxrs", + "web", + "rest" + ], + "categories": [ + "web", + "reactive" + ], + "status": "experimental", + "codestart": { + "name": "resteasy-reactive", + "languages": [ + "java", + "kotlin", + "scala" + ], + "artifact": "io.quarkus:quarkus-descriptor-json" + }, + "built-with-quarkus-core": "999-SNAPSHOT" + }, + "artifact": "io.quarkus:quarkus-resteasy-reactive::jar:999-SNAPSHOT", + "origins": [ + "io.quarkus:quarkus-bom-quarkus-platform-descriptor:999-SNAPSHOT:json:999-SNAPSHOT" + ] + }, + { + "name": "YAML Configuration", + "description": "Use YAML to configure your Quarkus application", + "metadata": { + "keywords": [ + "config", + "configuration", + "yaml" + ], + "categories": [ + "core" + ], + "status": "stable", + "guide": "https://quarkus.io/guides/config#yaml", + "codestart": { + "name": "config-yaml", + "kind": "core", + "languages": [ + "java", + "kotlin" + ], + "artifact": "io.quarkus:quarkus-descriptor-json" + }, + "built-with-quarkus-core": "999-SNAPSHOT" + }, + "artifact": "io.quarkus:quarkus-config-yaml::jar:999-SNAPSHOT", + "origins": [ + "io.quarkus:quarkus-bom-quarkus-platform-descriptor:999-SNAPSHOT:json:999-SNAPSHOT" + ] + }, + { + "name": "RESTEasy JAX-RS", + "description": "REST endpoint framework implementing JAX-RS and more", + "metadata": { + "short-name": "jax-rs", + "keywords": [ + "resteasy", + "jaxrs", + "web", + "rest" + ], + "guide": "https://quarkus.io/guides/rest-json", + "categories": [ + "web" + ], + "status": "stable", + "codestart": { + "name": "resteasy", + "languages": [ + "java", + "kotlin", + "scala" + ], + "artifact": "io.quarkus:quarkus-descriptor-json" + }, + "built-with-quarkus-core": "999-SNAPSHOT" + }, + "artifact": "io.quarkus:quarkus-resteasy::jar:999-SNAPSHOT", + "origins": [ + "io.quarkus:quarkus-bom-quarkus-platform-descriptor:999-SNAPSHOT:json:999-SNAPSHOT" + ] + }, + { + "name": "Quarkus Extension for Spring Web API", + "description": "Use Spring Web annotations to create your REST services", + "metadata": { + "keywords": [ + "spring-web", + "spring" + ], + "guide": "https://quarkus.io/guides/spring-web", + "categories": [ + "compatibility" + ], + "status": "preview", + "codestart": { + "name": "spring-web", + "languages": [ + "java", + "kotlin", + "scala" + ], + "artifact": "io.quarkus:quarkus-descriptor-json" + }, + "built-with-quarkus-core": "999-SNAPSHOT" + }, + "artifact": "io.quarkus:quarkus-spring-web::jar:999-SNAPSHOT", + "origins": [ + "io.quarkus:quarkus-bom-quarkus-platform-descriptor:999-SNAPSHOT:json:999-SNAPSHOT" + ] + }, + { + "name": "Kotlin", + "description": "Write your services in Kotlin", + "metadata": { + "keywords": [ + "kotlin" + ], + "guide": "https://quarkus.io/guides/kotlin", + "categories": [ + "alt-languages" + ], + "status": "preview", + "codestart": { + "name": "kotlin", + "kind": "core", + "artifact": "io.quarkus:quarkus-descriptor-json" + }, + "built-with-quarkus-core": "999-SNAPSHOT" + }, + "artifact": "io.quarkus:quarkus-kotlin::jar:999-SNAPSHOT", + "origins": [ + "io.quarkus:quarkus-bom-quarkus-platform-descriptor:999-SNAPSHOT:json:999-SNAPSHOT" + ] + }, + { + "name": "Scala", + "description": "Write your services in Scala", + "metadata": { + "keywords": [ + "scala" + ], + "categories": [ + "alt-languages" + ], + "status": "preview", + "codestart": { + "name": "scala", + "kind": "core", + "artifact": "io.quarkus:quarkus-descriptor-json" + }, + "built-with-quarkus-core": "999-SNAPSHOT" + }, + "artifact": "io.quarkus:quarkus-scala::jar:999-SNAPSHOT", + "origins": [ + "io.quarkus:quarkus-bom-quarkus-platform-descriptor:999-SNAPSHOT:json:999-SNAPSHOT" + ] + } + ], + "categories": [ + { + "id": "web", + "name": "Web", + "description": "Everything you need for REST endpoints, HTTP and web formats like JSON", + "metadata": { + "pinned": [ + "io.quarkus:quarkus-resteasy", + "io.quarkus:quarkus-resteasy-jackson", + "io.quarkus:quarkus-resteasy-jsonb" + ] + } + }, + { + "id": "data", + "name": "Data", + "description": "Accessing and managing your data (RDBMS, NoSQL, caching, transaction management, etc)", + "metadata": { + "pinned": [ + "io.quarkus:quarkus-hibernate-orm", + "io.quarkus:quarkus-hibernate-orm-panache", + "io.quarkus:quarkus-jdbc-postgresql", + "io.quarkus:quarkus-jdbc-mariadb", + "io.quarkus:quarkus-jdbc-mysql", + "io.quarkus:quarkus-jdbc-mssql", + "io.quarkus:quarkus-jdbc-db2", + "io.quarkus:quarkus-jdbc-h2", + "io.quarkus:quarkus-jdbc-derby" + ] + } + }, + { + "id": "messaging", + "name": "Messaging", + "description": "Send and receives message to various messaging systems (AMQP, KAfka etc)", + "metadata": { + "pinned": [ + "io.quarkus:quarkus-smallrye-reactive-messaging", + "io.quarkus:quarkus-smallrye-reactive-messaging-amqp", + "io.quarkus:quarkus-smallrye-reactive-messaging-kafka", + "io.quarkus:quarkus-smallrye-reactive-messaging-mqtt" + ] + } + }, + { + "id": "core", + "name": "Core", + "description": "Core Quarkus components: engine, logging, etc.", + "metadata": { + "pinned": [ + "io.quarkus:quarkus-config-yaml", + "io.quarkus:quarkus-logging-json" + ] + } + }, + { + "id": "reactive", + "name": "Reactive", + "description": "Non blocking stack and connectors", + "metadata": { + "pinned": [ + "io.quarkus:quarkus-vertx", + "io.quarkus:quarkus-mutiny" + ] + } + }, + { + "id": "cloud", + "name": "Cloud", + "description": "Useful for Cloud Native deployments platforms like Kubernetes and cloud providers", + "metadata": { + "pinned": [ + "io.quarkus:quarkus-kubernetes", + "io.quarkus:quarkus-openshift", + "io.quarkus:quarkus-smallrye-health", + "io.quarkus:quarkus-smallrye-fault-tolerance" + ] + } + }, + { + "id": "observability", + "name": "Observability", + "description": "Metrics, tracing, etc", + "metadata": {} + }, + { + "id": "security", + "name": "Security", + "description": "Everything you need to secure your application", + "metadata": { + "pinned": [ + "io.quarkus:quarkus-oidc", + "io.quarkus:quarkus-smallrye-jwt" + ] + } + }, + { + "id": "serialization", + "name": "Serialization", + "description": "Serializing and deserializing various formats", + "metadata": {} + }, + { + "id": "miscellaneous", + "name": "Miscellaneous", + "description": "Mixed bag of good stuff", + "metadata": {} + }, + { + "id": "compatibility", + "name": "Compatibility", + "description": "Support for alternative programming models on Quarkus", + "metadata": {} + }, + { + "id": "alt-languages", + "name": "Alternative languages", + "description": "Support for other JVM based languages", + "metadata": {} + } + ], + "metadata": { + "project": { + "properties": { + "doc-root": "https://quarkus.io", + "rest-assured-version": "4.3.2", + "compiler-plugin-version": "3.8.1", + "surefire-plugin-version": "3.0.0-M5", + "kotlin-version": "1.4.31", + "scala-version": "2.12.13", + "scala-plugin-version": "4.4.0", + "quarkus-core-version": "999-SNAPSHOT", + "maven-plugin-groupId": "io.quarkus", + "maven-plugin-artifactId": "quarkus-maven-plugin", + "maven-plugin-version": "999-SNAPSHOT", + "gradle-plugin-id": "io.quarkus", + "gradle-plugin-version": "999-SNAPSHOT", + "supported-maven-versions": "[3.6.2,)", + "proposed-maven-version": "3.6.3", + "maven-wrapper-version": "0.7.7", + "gradle-wrapper-version": "6.8.3" + } + }, + "codestarts-artifacts": [ + "io.quarkus:quarkus-platform-descriptor-json::jar:999-SNAPSHOT" + ] + }, + "quarkus-core-version": "999-SNAPSHOT" +} \ No newline at end of file