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/2200e51d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2200e51d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2200e51d

Branch: refs/heads/camel-2.16.x
Commit: 2200e51df280a65780494469ffe0c83355b239b5
Parents: a0757e0
Author: Claus Ibsen <davscl...@apache.org>
Authored: Sat Jan 16 12:39:14 2016 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sat Jan 16 12:40:04 2016 +0100

----------------------------------------------------------------------
 .../camel/component/hdfs/HdfsConsumerTest.java   | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2200e51d/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
 
b/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
index e85362c..adf2e4d 100644
--- 
a/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
+++ 
b/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
@@ -118,6 +118,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++) {
@@ -139,10 +140,10 @@ public class HdfsConsumerTest extends HdfsTestSupport {
 
         context.addRoutes(new RouteBuilder() {
             public void configure() {
-                from("hdfs://" + dir.toURI() + 
"/?pattern=*.txt&fileSystemType=LOCAL&chunkSize=100&initialDelay=0").to("mock:result");
-                from("hdfs://" + dir.toURI() + 
"/?pattern=*.txt&fileSystemType=LOCAL&chunkSize=200&initialDelay=0").to("mock:result");
-                from("hdfs://" + dir.toURI() + 
"/?pattern=*.txt&fileSystemType=LOCAL&chunkSize=300&initialDelay=0").to("mock:result");
-                from("hdfs://" + dir.toURI() + 
"/?pattern=*.txt&fileSystemType=LOCAL&chunkSize=400&initialDelay=0").to("mock:result");
+                from("hdfs://" + rootdir.toURI() + 
"/target/test/multiple-consumers?pattern=*.txt&fileSystemType=LOCAL&chunkSize=100&initialDelay=0").to("mock:result");
+                from("hdfs://" + rootdir.toURI() + 
"/target/test/multiple-consumers?pattern=*.txt&fileSystemType=LOCAL&chunkSize=200&initialDelay=0").to("mock:result");
+                from("hdfs://" + rootdir.toURI() + 
"/target/test/multiple-consumers?pattern=*.txt&fileSystemType=LOCAL&chunkSize=300&initialDelay=0").to("mock:result");
+                from("hdfs://" + rootdir.toURI() + 
"/target/test/multiple-consumers?pattern=*.txt&fileSystemType=LOCAL&chunkSize=400&initialDelay=0").to("mock:result");
             }
         });
         context.start();
@@ -263,14 +264,12 @@ public class HdfsConsumerTest extends HdfsTestSupport {
 
         context.addRoutes(new RouteBuilder() {
             public void configure() {
-                from("hdfs:localhost/" + file.getParent().toUri() + 
"?consumerProperties=#cprops&pattern=*&fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0&readSuffix=handled").to("mock:result");
+                from("hdfs: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);
@@ -372,7 +371,7 @@ public class HdfsConsumerTest extends HdfsTestSupport {
 
         context.addRoutes(new RouteBuilder() {
             public void configure() {
-                from("hdfs:localhost/" + file.toUri() + 
"??fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0").to("mock:result");
+                from("hdfs:localhost/" + file.toUri() + 
"?fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0").to("mock:result");
             }
         });
         context.start();
@@ -403,7 +402,7 @@ public class HdfsConsumerTest extends HdfsTestSupport {
 
         context.addRoutes(new RouteBuilder() {
             public void configure() {
-                from("hdfs:localhost/" + file.toUri() + 
"??fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0").to("mock:result");
+                from("hdfs:localhost/" + file.toUri() + 
"?fileSystemType=LOCAL&fileType=SEQUENCE_FILE&initialDelay=0").to("mock:result");
             }
         });
         context.start();

Reply via email to