From 98cc6b691ba4fa71ac1531c3e130e56689f978dd Mon Sep 17 00:00:00 2001 From: Tom Cunningham Date: Fri, 27 Oct 2023 04:40:05 -0400 Subject: [PATCH] Add migration rules for Camel 4.1.0. Added tests for each rule and test resources. (#1029) Co-authored-by: Phil Cattanach <31246010+PhilipCattanach@users.noreply.github.com> --- .../data/xml-41-changes/AwsStreaming.java | 27 ++ .../aws-streaming-blueprint.xml | 48 +++ .../xml-41-changes/aws-streaming-spring.xml | 52 +++ .../xml-41-changes/camel-aws2-pdf-4.1.0.jar | Bin 0 -> 478 bytes .../xml-41-changes/camel-aws2-sns-4.1.0.jar | Bin 0 -> 478 bytes .../data/xml-41-changes/camel-kafka-4.1.0.jar | Bin 0 -> 475 bytes .../xml-41-changes/camel-management-4.1.0.jar | Bin 0 -> 480 bytes .../xml-41-changes/camel-scheduler-4.1.0.jar | Bin 0 -> 478 bytes .../data/xml-41-changes/camel-timer-4.1.0.jar | Bin 0 -> 475 bytes .../camel3/tests/data/xml-41-changes/pom.xml | 175 +++++++++ .../tests/xml-41-changes.windup.test.xml | 252 ++++++++++++ .../camel4/camel3/xml-41-changes.windup.xml | 361 ++++++++++++++++++ 12 files changed, 915 insertions(+) create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/AwsStreaming.java create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/aws-streaming-blueprint.xml create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/aws-streaming-spring.xml create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-aws2-pdf-4.1.0.jar create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-aws2-sns-4.1.0.jar create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-kafka-4.1.0.jar create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-management-4.1.0.jar create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-scheduler-4.1.0.jar create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-timer-4.1.0.jar create mode 100644 rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/pom.xml create mode 100644 rules/rules-reviewed/camel4/camel3/tests/xml-41-changes.windup.test.xml create mode 100644 rules/rules-reviewed/camel4/camel3/xml-41-changes.windup.xml diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/AwsStreaming.java b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/AwsStreaming.java new file mode 100644 index 000000000..71be44e55 --- /dev/null +++ b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/AwsStreaming.java @@ -0,0 +1,27 @@ +import org.apache.camel.builder.RouteBuilder; + +public class Aws1Streaming { + + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + public void configure() { + from("direct:listActivities") + .setHeader("CamelAwsStateMachineOperation",5) + .setHeader("CamelAwsStateMachinesMaxResults",5) + .setHeader("CamelAwsStepFunctionsStateMachineActivityName",5) + .setHeader("CamelAwsStepFunctionsStateMachineActivityArn",5) + .setHeader("CamelAwsStateMachineActivitiesMaxResults",5) + .setHeader("CamelAwsStateMachineExecutionArn",5) + .setHeader("CamelAwsStateMachineExecutionName",5) + .setHeader("CamelAwsStateMachineExecutionInput",5) + .setHeader("CamelAwsStateMachineExecutionTraceHeader",5) + .setHeader("CamelAwsStateMachineExecutionHistoryMaxResults",5) + .setHeader("CamelAwsStateMachineExecutionHistoryIncludeExecutionData",5) + .setHeader("CamelAwsStateMachineExecutionHistoryReverseOrder",5) + .setHeader("CamelAwsStateMachineExecutionMaxResults",5) + .to("aws2-step-functions://test?awsSfnClient=#awsSfnClient&operation=listActivities"); + } + }; + } + +} diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/aws-streaming-blueprint.xml b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/aws-streaming-blueprint.xml new file mode 100644 index 000000000..6851e9176 --- /dev/null +++ b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/aws-streaming-blueprint.xml @@ -0,0 +1,48 @@ + + + + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + \ No newline at end of file diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/aws-streaming-spring.xml b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/aws-streaming-spring.xml new file mode 100644 index 000000000..18dd9bbcc --- /dev/null +++ b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/aws-streaming-spring.xml @@ -0,0 +1,52 @@ + + + + + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-aws2-pdf-4.1.0.jar b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-aws2-pdf-4.1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..3793136c8bc1a2d7e455697770549e67d3fa1080 GIT binary patch literal 478 zcmWIWW@Zs#;Nak3D6kC(XFvj+3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|C;M6Pv zQ~}rQ>*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5~=g zT)*`2eBlu_vH4USJh?0Av}xteik)D)+x&j5vI3fH4a5k$^D!LGz>rd!n_H<@Qc-eR z-|M=!j)%`VkE`B(XME3YWSYFI^XXByU96g!VQN)vRctX}qxl-E)Kq}Rs)3DWWD;RO z4HcM|L7{>Q;NAp*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5~=g zT)*`2eBlu_vH4USJh?0Av}xteik)D)+x&j5vI3fH4aB(Z<^;;7l;-AE>XlTKoYwcc z?yckDbI#+cx8E7xvm2Qv@9KPd)NR+%%A;XwRc%#lF<_(b^jqYp05z(Cjb>yLVL%NP zn3qAJf(qc?1cgz6H>y@-7lXnC0c?RxxK^YPLN@`~VIZF&z)m0&?#}>kRyL3nGZ1b8 J(jtr?9svE(VWR*5 literal 0 HcmV?d00001 diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-kafka-4.1.0.jar b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-kafka-4.1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..7d052daaae5480d3f0833e3691b47adc7e1b9f9f GIT binary patch literal 475 zcmWIWW@Zs#;Nak3D6kC(XFvj+3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|C;M6Pv zQ~}rQ>*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5~=g zT)*`2eBlu_vH4USJh?0Av}xteik)D)+x&j5vI3fH4aB(Z<^;;7l;-AE>XlTKoYwcc z?yckDbI#+cx8E7xvm2Qv@4DHUd9yQ2t*WhxEe32ZOTA~MB2bqy*jz>?5eC#Cf%z8{ zB&Y!HM^FF-c%y1Xb}lGD5Wp75glk0#9&{6s9R~6i0_+4b;hqfeW@Q6OF$3WiAT7uU G;sF4dk6rx$ literal 0 HcmV?d00001 diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-management-4.1.0.jar b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-management-4.1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..586efc528c7a099a5a84ede91a4d33c0cfe8e17c GIT binary patch literal 480 zcmWIWW@Zs#;Nak3$hQp$XFvj+3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|C;M6Pv zQ~}rQ>*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5~=g zT)*`2eBlu_vH4USJh?0Av}xteik)D)+x&j5vI3fH4aB(Z<^;;7l;-AE>XlTKoYwcc z?yckDbI#+cx8E7xvm2Qv@7mc}+4*wi&Xtv_VQN)vRctX}!!0j+Rj2{AYJd%AWD;RO z4HuZFLE(Z5;2s5qQh+zAR%ADWLInYAflRnoq%cA^0oh?7zahX*AQSG>0B=?{kQ6fz LZUNF_j36EW$-`mG literal 0 HcmV?d00001 diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-scheduler-4.1.0.jar b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-scheduler-4.1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..c6218eaeb4c357ab974b337ddfbf3075157109b6 GIT binary patch literal 478 zcmWIWW@Zs#;Nak3$hQp$XFvj+3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|C;M6Pv zQ~}rQ>*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5~=g zT)*`2eBlu_vH4USJh?0Av}xteik)D)+x&j5vI3fH4aB(Z<^;;7l;-AE>XlTKoYwcc z?yckDbI#+cx8E7xvm2Qv?>g$xIOWouD@xkJw$8T9dSIjF{kJlx05z(Ejb>yLVL%NP zn3qAJf(qc?1cgz6H>y@-7lXnC0c?RxxK^YPLN@`~VIZF&z)m0&?#}>kRyL3nGZ1b8 J(jtr?9spOaUFiS- literal 0 HcmV?d00001 diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-timer-4.1.0.jar b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/camel-timer-4.1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..3e9cdb1841c0f37df882e5a52c66e07b9c843474 GIT binary patch literal 475 zcmWIWW@Zs#;Nak3$hQp$XFvj+3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|C;M6Pv zQ~}rQ>*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5~=g zT)*`2eBlu_vH4USJh?0Av}xteik)D)+x&j5vI3fH4aB(Z<^;;7l;-AE>XlTKoYwcc z?yckDbI#+cx8E7xvm2Qv?^2z)bERvTT2)&WTMXFT#9spSia=e;U~?InL>N$m1m<5* zke~v%A3*^W;Ek#k*}0$qK>%AI6Rs60c+gEib{NQ82(S~#gnKf;o0SbD#SDa7fV3bZ Ghz9_W5ng!! literal 0 HcmV?d00001 diff --git a/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/pom.xml b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/pom.xml new file mode 100644 index 000000000..754b6e6a5 --- /dev/null +++ b/rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/pom.xml @@ -0,0 +1,175 @@ + + + + + 4.0.0 + + + org.apache.camel.springboot.example + examples + 3.20.1.redhat-00001 + + + camel-example-spring-boot-xml + Camel SB Examples :: XML + An example showing how to work with Camel routes in XML files and Spring Boot + + + Beginner + Spring Boot XML + + UTF-8 + UTF-8 + ${spring-boot-version} + + + + + + com.redhat.camel.springboot.platform + camel-spring-boot-bom + ${camel-spring-boot-version} + pom + import + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.apache.camel + camel-aws2-pdf + + + org.apache.camel + camel-aws2-sns + + + org.apache.camel + camel-kafka + + + org.apache.camel + camel-management + + + org.apache.camel + camel-scheduler + + + org.apache.camel + camel-timer + + + + + org.apache.camel.springboot + camel-spring-boot-xml-starter + + + org.apache.camel.springboot + camel-xml-jaxb-dsl-starter + + + org.apache.camel.springboot + camel-stream-starter + + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.apache.camel + camel-test-spring-junit5 + test + + + org.junit.vintage + junit-vintage-engine + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot-version} + + + + repackage + + + + + + + org.apache.camel + camel-maven-plugin + ${camel-community.version} + + + + + + + + openshift + + + + org.eclipse.jkube + openshift-maven-plugin + ${jkube-maven-plugin-version} + + + + resource + build + + + + + + + + + diff --git a/rules/rules-reviewed/camel4/camel3/tests/xml-41-changes.windup.test.xml b/rules/rules-reviewed/camel4/camel3/tests/xml-41-changes.windup.test.xml new file mode 100644 index 000000000..03ef2281d --- /dev/null +++ b/rules/rules-reviewed/camel4/camel3/tests/xml-41-changes.windup.test.xml @@ -0,0 +1,252 @@ + + + data/xml-41-changes + ../xml-41-changes.windup.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rules/rules-reviewed/camel4/camel3/xml-41-changes.windup.xml b/rules/rules-reviewed/camel4/camel3/xml-41-changes.windup.xml new file mode 100644 index 000000000..7f02583c8 --- /dev/null +++ b/rules/rules-reviewed/camel4/camel3/xml-41-changes.windup.xml @@ -0,0 +1,361 @@ + + + + + Rules for changes between Camel 4.0 and Camel 4.1 + + + + + + + + + + + + + + + + + + + + Dumping routes to JMX no longer includes customId=true in the XML nodes. + + + + + + + + + + + + + + + + The scheduler no longer includes header with the timestamp of when the exchange was fired. This means the exchange by default has no headers, and null body.The option includeMetadata can be set to true on the endpoint or component level, to turn on these additional metadata headers again. + + + + + + + + + + + + + + + + The timer no longer includes header firedTime with the timestamp of when the exchange was fired. This means the exchange by default has no headers, and null body.The firedTime header has been renamed to CamelTimerFireTime. The option includeMetadata can be set to true on the endpoint or component level, to turn on these additional metadata headers again. + + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineOperation message header has been replaced with CamelAwsStepFunctionsOperation + + + + + + + + + + + + + + + + + + + CamelAwsStateMachinesMaxResults message header has been replaced with CamelAwsStepFunctionsStateMachinesMaxResults + + + + + + + + + + + + + + + + + + + CamelAwsStepFunctionsStateMachineActivityName message header has been replaced with CamelAwsStepFunctionsActivityName + + + + + + + + + + + + + + + + + + + CamelAwsStepFunctionsStateMachineActivityArn message header has been replaced with CamelAwsStepFunctionsActivityArn + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineActivitiesMaxResults message header has been replaced with CamelAwsStepFunctionsActivitiesMaxResults + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineExecutionArn message header has been replaced with CamelAwsStepFunctionsExecutionArn + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineExecutionName message header has been replaced with CamelAwsStepFunctionsExecutionName + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineExecutionInput message header has been replaced with CamelAwsStepFunctionsExecutionInput + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineExecutionTraceHeader message header has been replaced with CamelAwsStepFunctionsExecutionTraceHeader + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineExecutionHistoryMaxResults message header has been replaced with CamelAwsStepFunctionsExecutionHistoryMaxResults + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineExecutionHistoryIncludeExecutionData message header has been replaced with CamelAwsStepFunctionsExecutionHistoryIncludeExecutionData + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineExecutionHistoryReverseOrder message header has been replaced with CamelAwsStepFunctionsExecutionHistoryReverseOrder + + + + + + + + + + + + + + + + + + + CamelAwsStateMachineExecutionMaxResults message header has been replaced with CamelAwsStepFunctionsExecutionMaxResults + + + + + + + + + + + + + + + + The queueUrl parameter has been replaced by the queueArn parameter. + + + + + + + + + + + + + + + + The Camel-PDF component has been updated to Apache PDFBox 3.0.0 and the font parameter is now defined through the following enum values: COURIER,COURIER_BOLD,COURIER_OBLIQUE,COURIER_BOLD_OBLIQUE, HELVETICA,HELVETICA_BOLD,HELVETICA_OBLIQUE,HELVETICA_BOLD_OBLIQUE,TIMES_ROMAN,TIMES_BOLD,TIMES_ITALIC,TIMES_BOLD_ITALIC,SYMBOL and ZAPF_DINGBATS. + + + + + + + + + + + + + + + + The default value for sessionTimeoutMs has been updated to 45000 ms, while the default value for consumerRequestTimeoutMs has been updated to 30000. + + + + + + +