You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/01/16 12:40:18 UTC
[2/8] camel git commit: Fixed uris in tests
Fixed uris in tests
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5d69ca2c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5d69ca2c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5d69ca2c
Branch: refs/heads/master
Commit: 5d69ca2ce54b21948be5a6fb159813da6ca9bc89
Parents: a061340
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Jan 16 12:32:28 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Jan 16 12:32:28 2016 +0100
----------------------------------------------------------------------
.../camel/component/hdfs2/HdfsConsumerTest.java | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/5d69ca2c/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java b/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
index 58643f8..4ffd543 100644
--- a/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
+++ b/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
@@ -119,6 +119,7 @@ public class HdfsConsumerTest extends HdfsTestSupport {
return;
}
+ final File rootdir = new File(".");
final File dir = new File("target/test/multiple-consumers");
dir.mkdirs();
for (int i = 1; i <= ITERATIONS; i++) {
@@ -140,10 +141,10 @@ public class HdfsConsumerTest extends HdfsTestSupport {
context.addRoutes(new RouteBuilder() {
public void configure() {
- from("hdfs2://" + dir.toURI() + "/?pattern=*.txt&fileSystemType=LOCAL&chunkSize=100&initialDelay=0").to("mock:result");
- from("hdfs2://" + dir.toURI() + "/?pattern=*.txt&fileSystemType=LOCAL&chunkSize=200&initialDelay=0").to("mock:result");
- from("hdfs2://" + dir.toURI() + "/?pattern=*.txt&fileSystemType=LOCAL&chunkSize=300&initialDelay=0").to("mock:result");
- from("hdfs2://" + dir.toURI() + "/?pattern=*.txt&fileSystemType=LOCAL&chunkSize=400&initialDelay=0").to("mock:result");
+ from("hdfs2://" + rootdir.toURI() + "/target/test/multiple-consumers?pattern=*.txt&fileSystemType=LOCAL&chunkSize=100&initialDelay=0").to("mock:result");
+ from("hdfs2://" + rootdir.toURI() + "/target/test/multiple-consumers?pattern=*.txt&fileSystemType=LOCAL&chunkSize=200&initialDelay=0").to("mock:result");
+ from("hdfs2://" + rootdir.toURI() + "/target/test/multiple-consumers?pattern=*.txt&fileSystemType=LOCAL&chunkSize=300&initialDelay=0").to("mock:result");
+ from("hdfs2://" + rootdir.toURI() + "/target/test/multiple-consumers?pattern=*.txt&fileSystemType=LOCAL&chunkSize=400&initialDelay=0").to("mock:result");
}
});
context.start();
@@ -262,14 +263,12 @@ public class HdfsConsumerTest extends HdfsTestSupport {
context.addRoutes(new RouteBuilder() {
public void configure() {
- from("hdfs2:localhost/" + file.getParent().toUri() + "?consumerProperties=#cprops&pattern=*&fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0&readSuffix=handled").to("mock:result");
+ from("hdfs2:localhost/" + file.getParent().toUri() + "?scheduler=#myScheduler&pattern=*&fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0&readSuffix=handled").to("mock:result");
}
});
- Map<String, Object> props = new HashMap<String, Object>();
ScheduledExecutorService pool = context.getExecutorServiceManager().newScheduledThreadPool(null, "unitTestPool", 1);
DefaultScheduledPollConsumerScheduler scheduler = new DefaultScheduledPollConsumerScheduler(pool);
- props.put("scheduler", scheduler);
- ((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("cprops", props);
+ ((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("myScheduler", scheduler);
context.start();
MockEndpoint resultEndpoint = context.getEndpoint("mock:result", MockEndpoint.class);
@@ -368,7 +367,7 @@ public class HdfsConsumerTest extends HdfsTestSupport {
context.addRoutes(new RouteBuilder() {
public void configure() {
- from("hdfs2:localhost/" + file.toUri() + "??fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0").to("mock:result");
+ from("hdfs2:localhost/" + file.toUri() + "?fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0").to("mock:result");
}
});
context.start();
@@ -398,7 +397,7 @@ public class HdfsConsumerTest extends HdfsTestSupport {
context.addRoutes(new RouteBuilder() {
public void configure() {
- from("hdfs2:localhost/" + file.toUri() + "??fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0").to("mock:result");
+ from("hdfs2:localhost/" + file.toUri() + "?fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0").to("mock:result");
}
});
context.start();