Skip to content

Commit

Permalink
Add migration rules for Camel 4.1.0. Added tests for each rule and te…
Browse files Browse the repository at this point in the history
…st resources.
  • Loading branch information
cunningt committed Oct 16, 2023
1 parent 7969042 commit d94cc4b
Show file tree
Hide file tree
Showing 12 changed files with 915 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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");
}
};
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="direct:listActivities"/>
<setHeader headerName="CamelAwsStateMachineOperation">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachinesMaxResults">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStepFunctionsStateMachineActivityName">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStepFunctionsStateMachineActivityArn">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineActivitiesMaxResults">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionArn">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionName">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionInput">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionTraceHeader">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionHistoryMaxResults">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionHistoryIncludeExecutionData">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionHistoryReverseOrder">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionMaxResults">
<constant>5</constant>
</setHeader>
<to uri="direct:to-twitter-streaming"/>
</route>
</camelContext>
</blueprint>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

<camelContext id="twitter-streaming" xmlns="http://camel.apache.org/schema/spring" autoStartup="true">
<route>
<from uri="twitter-streaming://filter?type=event&amp;twitterStream=#twitterStream&amp;keywords=#cameltest"/>
<setHeader headerName="CamelAwsStateMachineOperation">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachinesMaxResults">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStepFunctionsStateMachineActivityName">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStepFunctionsStateMachineActivityArn">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineActivitiesMaxResults">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionArn">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionName">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionInput">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionTraceHeader">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionHistoryMaxResults">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionHistoryIncludeExecutionData">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionHistoryReverseOrder">
<constant>5</constant>
</setHeader>
<setHeader headerName="CamelAwsStateMachineExecutionMaxResults">
<constant>5</constant>
</setHeader>
<to uri="direct:to-twitter-streaming"/>
</route>
</camelContext>
</beans>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
175 changes: 175 additions & 0 deletions rules/rules-reviewed/camel4/camel3/tests/data/xml-41-changes/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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
http://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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>3.20.1.redhat-00001</version>
</parent>

<artifactId>camel-example-spring-boot-xml</artifactId>
<name>Camel SB Examples :: XML</name>
<description>An example showing how to work with Camel routes in XML files and Spring Boot</description>

<properties>
<category>Beginner</category>
<title>Spring Boot XML</title>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring.boot-version>${spring-boot-version}</spring.boot-version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.redhat.camel.springboot.platform</groupId>
<artifactId>camel-spring-boot-bom</artifactId>
<version>${camel-spring-boot-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>

<!-- Spring Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-aws2-pdf</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-aws2-sns</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-management</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-scheduler</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-timer</artifactId>
</dependency>

<!-- Camel -->
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-spring-boot-xml-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-xml-jaxb-dsl-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-stream-starter</artifactId>
</dependency>

<!-- test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel-community.version}</version>
<!-- allows to fail if not all routes are fully covered during testing -->
<!--
<configuration>
<failOnError>true</failOnError>
</configuration>
-->
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>openshift</id>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>openshift-maven-plugin</artifactId>
<version>${jkube-maven-plugin-version}</version>
<executions>
<execution>
<goals>
<goal>resource</goal>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading

0 comments on commit d94cc4b

Please sign in to comment.