You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/12/24 12:19:18 UTC
[camel] branch master updated: Camel3 migration
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new a0627c6 Camel3 migration
new 568f9a1 Merge pull request #3441 from fvaleri/bigxml-billboard-camel3
a0627c6 is described below
commit a0627c6e17d4fdec9b62ca2e199bc7c4b952b3aa
Author: Federico Valeri <fv...@localhost>
AuthorDate: Tue Dec 24 13:03:17 2019 +0100
Camel3 migration
---
examples/camel-example-bigxml-split/pom.xml | 23 +++++-----------------
.../org/apache/camel/example/bigxml/Record.java | 3 ++-
.../camel/example/bigxml/StaxTokenizerTest.java | 3 ++-
.../org/apache/camel/example/bigxml/TestUtils.java | 2 +-
.../camel/example/bigxml/XmlTokenizerTest.java | 3 ++-
examples/camel-example-billboard-aggr/pom.xml | 17 ++++++++--------
.../data/billboard_lyrics_1964-2015.csv | 0
.../camel/example/billboard/BillboardAggrTest.java | 6 ++----
8 files changed, 23 insertions(+), 34 deletions(-)
diff --git a/examples/camel-example-bigxml-split/pom.xml b/examples/camel-example-bigxml-split/pom.xml
index 00c1503..0beb129 100644
--- a/examples/camel-example-bigxml-split/pom.xml
+++ b/examples/camel-example-bigxml-split/pom.xml
@@ -37,15 +37,17 @@
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <skipTests>true</skipTests>
<category>EIP</category>
</properties>
<dependencies>
-
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-core</artifactId>
+ <artifactId>camel-core-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-log</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
@@ -56,25 +58,18 @@
<artifactId>woodstox-core</artifactId>
<version>5.2.0</version>
</dependency>
-
- <!-- logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
- <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
- <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
- <scope>runtime</scope>
</dependency>
-
- <!-- for testing -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
@@ -85,7 +80,6 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
-
</dependencies>
<build>
@@ -95,13 +89,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx20m -Dfile.encoding=${project.build.sourceEncoding}</argLine>
- <useSystemClassLoader>true</useSystemClassLoader>
- <rerunFailingTestsCount>0</rerunFailingTestsCount>
- <forkCount>1</forkCount>
- <forkedProcessTimeoutInSeconds>0</forkedProcessTimeoutInSeconds>
- <useFile>true</useFile>
- <failIfNoTests>false</failIfNoTests>
- <runOrder>alphabetical</runOrder>
</configuration>
</plugin>
</plugins>
diff --git a/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/Record.java b/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/Record.java
index 452c7b9..7fd9e72 100644
--- a/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/Record.java
+++ b/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/Record.java
@@ -49,7 +49,8 @@ public class Record {
@Override
public String toString() {
- return "{key='" + getKey() + "', value='" + getValue() + "'}";
+ return "{key='" + getKey()
+ + "', value='" + getValue() + "'}";
}
}
diff --git a/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/StaxTokenizerTest.java b/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/StaxTokenizerTest.java
index eb8b803..321d52b 100644
--- a/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/StaxTokenizerTest.java
+++ b/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/StaxTokenizerTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.example.bigxml;
import java.util.concurrent.TimeUnit;
import org.apache.camel.CamelContext;
+import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit4.CamelTestSupport;
@@ -61,7 +62,7 @@ public class StaxTokenizerTest extends CamelTestSupport {
public void configure() throws Exception {
from("file:" + TestUtils.getBasePath() + "?readLock=changed&noop=true")
.split(stax(Record.class)).streaming().stopOnException()
- //.log(LoggingLevel.TRACE, "org.apache.camel.example.bigxml", "${body}")
+ .log(LoggingLevel.TRACE, "org.apache.camel.example.bigxml", "${body}")
.to("log:org.apache.camel.example.bigxml?level=DEBUG&groupInterval=100&groupDelay=100&groupActiveOnly=false")
.end();
}
diff --git a/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/TestUtils.java b/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/TestUtils.java
index 6dcfffb..3a9672d 100644
--- a/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/TestUtils.java
+++ b/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/TestUtils.java
@@ -78,4 +78,4 @@ public final class TestUtils {
}
}
-}
\ No newline at end of file
+}
diff --git a/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/XmlTokenizerTest.java b/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/XmlTokenizerTest.java
index 0ea315d..91249a4 100644
--- a/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/XmlTokenizerTest.java
+++ b/examples/camel-example-bigxml-split/src/test/java/org/apache/camel/example/bigxml/XmlTokenizerTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.example.bigxml;
import java.util.concurrent.TimeUnit;
import org.apache.camel.CamelContext;
+import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit4.CamelTestSupport;
@@ -59,7 +60,7 @@ public class XmlTokenizerTest extends CamelTestSupport {
public void configure() throws Exception {
from("file:" + TestUtils.getBasePath() + "?readLock=changed&noop=true")
.split(body().tokenizeXML("record", "records")).streaming().stopOnException()
- //.log(LoggingLevel.TRACE, "org.apache.camel.example.bigxml", "${body}")
+ .log(LoggingLevel.TRACE, "org.apache.camel.example.bigxml", "${body}")
.to("log:org.apache.camel.example.bigxml?level=DEBUG&groupInterval=100&groupDelay=100&groupActiveOnly=false")
.end();
}
diff --git a/examples/camel-example-billboard-aggr/pom.xml b/examples/camel-example-billboard-aggr/pom.xml
index 6aa7737..c05c689 100644
--- a/examples/camel-example-billboard-aggr/pom.xml
+++ b/examples/camel-example-billboard-aggr/pom.xml
@@ -32,13 +32,21 @@
<description>Billboard aggregation example</description>
<properties>
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<category>EIP</category>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-core</artifactId>
+ <artifactId>camel-core-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-log</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
@@ -71,13 +79,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
- <useSystemClassLoader>true</useSystemClassLoader>
- <rerunFailingTestsCount>0</rerunFailingTestsCount>
- <forkCount>1</forkCount>
- <forkedProcessTimeoutInSeconds>0</forkedProcessTimeoutInSeconds>
- <useFile>true</useFile>
- <failIfNoTests>false</failIfNoTests>
- <runOrder>alphabetical</runOrder>
</configuration>
</plugin>
</plugins>
diff --git a/examples/camel-example-billboard-aggr/src/test/resources/data/billboard_lyrics_1964-2015.csv b/examples/camel-example-billboard-aggr/src/test/data/billboard_lyrics_1964-2015.csv
similarity index 100%
rename from examples/camel-example-billboard-aggr/src/test/resources/data/billboard_lyrics_1964-2015.csv
rename to examples/camel-example-billboard-aggr/src/test/data/billboard_lyrics_1964-2015.csv
diff --git a/examples/camel-example-billboard-aggr/src/test/java/org/apache/camel/example/billboard/BillboardAggrTest.java b/examples/camel-example-billboard-aggr/src/test/java/org/apache/camel/example/billboard/BillboardAggrTest.java
index d0aecd9..288a297 100644
--- a/examples/camel-example-billboard-aggr/src/test/java/org/apache/camel/example/billboard/BillboardAggrTest.java
+++ b/examples/camel-example-billboard-aggr/src/test/java/org/apache/camel/example/billboard/BillboardAggrTest.java
@@ -33,7 +33,7 @@ import org.junit.Test;
public class BillboardAggrTest extends CamelTestSupport {
- private static final String BASEPATH = System.getProperty("user.dir") + "/src/test/resources/data";
+ private static final String BASEPATH = System.getProperty("user.dir") + "/src/test/data";
@Override
protected CamelContext createCamelContext() throws Exception {
@@ -67,7 +67,6 @@ public class BillboardAggrTest extends CamelTestSupport {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- //@formatter:off
from("file:" + BASEPATH + "?noop=true&idempotent=true")
.split(body().tokenize("\n")).streaming().parallelProcessing()
// skip first line with headers
@@ -87,7 +86,6 @@ public class BillboardAggrTest extends CamelTestSupport {
.aggregate(new MyAggregationStrategy()).header("artist")
.completionPredicate(header("CamelSplitComplete").isEqualTo(true))
.to("mock:result");
- //@formatter:on
}
};
}
@@ -109,7 +107,7 @@ public class BillboardAggrTest extends CamelTestSupport {
}
public void setArtistHeader(Exchange exchange, SongRecord song) {
- exchange.getOut().setHeader("artist", song.getArtist());
+ exchange.getMessage().setHeader("artist", song.getArtist());
}
public Map<String, Integer> getTop20Artists() {