From 902ed03c78050675a11116c5b24e76af2f5aa012 Mon Sep 17 00:00:00 2001 From: Jiri Ondrusek Date: Thu, 16 Jan 2025 17:19:54 +0100 Subject: [PATCH] Bump camel-upgrade-recipes to 4.10.0 --- pom.xml | 2 +- recipes-tests/pom.xml | 14 +++ .../updates/camel/CamelQuarkusTestUtil.java | 5 ++ .../updates/camel/CamelUpdate410Test.java | 16 ++++ .../updates/camel/CamelUpdate49Test.java | 90 ------------------- .../camel-quarkus/3.18.yaml | 31 +++++++ 6 files changed, 67 insertions(+), 91 deletions(-) create mode 100644 recipes-tests/src/test/java/io/quarkus/updates/camel/CamelUpdate410Test.java create mode 100644 recipes/src/main/resources/quarkus-updates/org.apache.camel.quarkus/camel-quarkus/3.18.yaml diff --git a/pom.xml b/pom.xml index 8eda78380c..217928f6de 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 7.0.3 - 4.9.0 + 4.10.0 1.9.17 diff --git a/recipes-tests/pom.xml b/recipes-tests/pom.xml index 92fe8c3589..cd9f52f774 100644 --- a/recipes-tests/pom.xml +++ b/recipes-tests/pom.xml @@ -35,6 +35,7 @@ 4.8.0 6.0.0 4.9.0 + 4.10.0 @@ -454,6 +455,19 @@ ${test.camel-quarkus-3-15.camel-version} ${rewrite-tmp-classpath} + + + org.apache.camel + camel-smb + ${test.camel-quarkus-3-17.camel-version} + ${rewrite-tmp-classpath} + + + org.apache.camel + camel-azure-files + ${test.camel-quarkus-3-17.camel-version} + ${rewrite-tmp-classpath} + jakarta.xml.bind diff --git a/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelQuarkusTestUtil.java b/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelQuarkusTestUtil.java index 3eded160c0..661df551c4 100644 --- a/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelQuarkusTestUtil.java +++ b/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelQuarkusTestUtil.java @@ -30,6 +30,10 @@ public static RecipeSpec recipe3_17(RecipeSpec spec, String... activeRecipes) { return recipeForVersion("3.17", spec, activeRecipes); } + public static RecipeSpec recipe3_18(RecipeSpec spec, String... activeRecipes) { + return recipeForVersion("3.18", spec, activeRecipes); + } + private static RecipeSpec recipeForVersion(String version, RecipeSpec spec, String... activeRecipes) { if(activeRecipes.length == 0) { return recipe(spec, version); @@ -45,6 +49,7 @@ private static RecipeSpec recipe(RecipeSpec spec, String version) { case "3alpha" -> new String[] {"io.quarkus.updates.camel.camel40.CamelQuarkusMigrationRecipe"}; case "3.15" -> new String[] {"io.quarkus.updates.camel.camel47.CamelQuarkusMigrationRecipe"}; case "3.17" -> new String[] {"io.quarkus.updates.camel.camel49.CamelQuarkusMigrationRecipe"}; + case "3.18" -> new String[] {"io.quarkus.updates.camel.camel410.CamelQuarkusMigrationRecipe"}; default -> throw new IllegalArgumentException("Version '" + version + "' is not allowed!"); }; return recipe(spec, version, defaultRecipes); diff --git a/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelUpdate410Test.java b/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelUpdate410Test.java new file mode 100644 index 0000000000..653e1088be --- /dev/null +++ b/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelUpdate410Test.java @@ -0,0 +1,16 @@ +package io.quarkus.updates.camel; + +import org.openrewrite.test.RecipeSpec; +import org.openrewrite.test.TypeValidation; + +public class CamelUpdate410Test extends org.apache.camel.upgrade.CamelUpdate410Test { + + @Override + public void defaults(RecipeSpec spec) { + //let the parser be initialized in the camel parent + super.defaults(spec); + //recipe has to be loaded differently + CamelQuarkusTestUtil.recipe3_18(spec) + .typeValidationOptions(TypeValidation.none()); + } +} diff --git a/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelUpdate49Test.java b/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelUpdate49Test.java index a8a73d2391..ebe75ad02b 100644 --- a/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelUpdate49Test.java +++ b/recipes-tests/src/test/java/io/quarkus/updates/camel/CamelUpdate49Test.java @@ -16,94 +16,4 @@ public void defaults(RecipeSpec spec) { CamelQuarkusTestUtil.recipe3_17(spec) .typeValidationOptions(TypeValidation.none()); } - - /** - * Quarkus-updates recipes somehow groups imports in comparison to camel-upgrade-recipes. - * (The original test method contains a lot of imports which are grouped in the result) - * Therefore, I override this test method to avoid grouping behavior. - * According to the doc, it should b possible to declar import style, see https://docs.openrewrite.org/reference/yaml-format-reference#style-example - * - * camel-debezium - */ - @Test - @Override - public void testDebezium() { - //language=java - rewriteRun(java( - """ - import org.apache.camel.component.debezium.configuration.Db2ConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.configuration.MongodbConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.DebeziumMongodbComponentConfigurer; - import org.apache.camel.component.debezium.DebeziumMongodbComponent; - import org.apache.camel.component.debezium.configuration.MySqlConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.DebeziumMySqlComponent; - import org.apache.camel.component.debezium.configuration.OracleConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.DebeziumOracleComponent; - import org.apache.camel.component.debezium.configuration.PostgresConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.DebeziumPostgresComponent; - import org.apache.camel.component.debezium.configuration.SqlserverConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.DebeziumSqlserverComponent; - - public class DebeziumTest { - - public void method() { - //db2 - Db2ConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumDb2Component component = null; - //mongodb - MongodbConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumMongodbComponent component = null; - //mysql - MySqlConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumMySqlComponent component = null; - //oracle - OracleConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumOracleComponent component = null; - //postgres - PostgresConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumPostgresComponent component = null; - //sqlserver - SqlserverConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumSqlserverComponent component = null; - } - } - """, - """ - import org.apache.camel.component.debezium.configuration.MongodbConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.configuration.SqlserverConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.db2.configuration.Db2ConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.mongodb.DebeziumMongodbComponent; - import org.apache.camel.component.debezium.mysql.DebeziumMySqlComponent; - import org.apache.camel.component.debezium.mysql.configuration.MySqlConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.oracle.DebeziumOracleComponent; - import org.apache.camel.component.debezium.oracle.configuration.OracleConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.postgres.DebeziumPostgresComponent; - import org.apache.camel.component.debezium.postgres.configuration.PostgresConnectorEmbeddedDebeziumConfiguration; - import org.apache.camel.component.debezium.sqlserver.DebeziumSqlserverComponent; - - public class DebeziumTest { - - public void method() { - //db2 - Db2ConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumDb2Component component = null; - //mongodb - MongodbConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumMongodbComponent component = null; - //mysql - MySqlConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumMySqlComponent component = null; - //oracle - OracleConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumOracleComponent component = null; - //postgres - PostgresConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumPostgresComponent component = null; - //sqlserver - SqlserverConnectorEmbeddedDebeziumConfiguration conf = null; - DebeziumSqlserverComponent component = null; - } - } - """)); - } } diff --git a/recipes/src/main/resources/quarkus-updates/org.apache.camel.quarkus/camel-quarkus/3.18.yaml b/recipes/src/main/resources/quarkus-updates/org.apache.camel.quarkus/camel-quarkus/3.18.yaml new file mode 100644 index 0000000000..820e7b3a9b --- /dev/null +++ b/recipes/src/main/resources/quarkus-updates/org.apache.camel.quarkus/camel-quarkus/3.18.yaml @@ -0,0 +1,31 @@ +# +# Copyright 2021 the original author or authors. +#

+# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +#

+# https://www.apache.org/licenses/LICENSE-2.0 +#

+# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +##### +# Rules coming from https://camel.apache.org/manual/camel-4x-upgrade-guide.html +##### + +##### +# Update the Camel - Quarkus extensions +##### +--- +type: specs.openrewrite.org/v1beta/recipe +name: io.quarkus.updates.camel.camel410.CamelQuarkusMigrationRecipe +displayName: Migrates `camel 4.9` application to `camel 4.10` +description: Migrates `camel 4.9` quarkus application to `camel 4.10`. +recipeList: +# use the recipe from camel upgrade recipes project + - org.apache.camel.upgrade.camel410.CamelMigrationRecipe \ No newline at end of file