camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r752362 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/component/file/FileConsumer.java test/java/org/apache/camel/language/FileLanguageTest.java
Date Wed, 11 Mar 2009 03:47:38 GMT
Author: ningjiang
Date: Wed Mar 11 03:47:37 2009
New Revision: 752362

URL: http://svn.apache.org/viewvc?rev=752362&view=rev
Log:
Fixed the test errors of FileLanguageTest

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java?rev=752362&r1=752361&r2=752362&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
Wed Mar 11 03:47:37 2009
@@ -20,6 +20,7 @@
 import java.util.List;
 
 import org.apache.camel.Processor;
+import org.apache.camel.util.FileUtil;
 import org.apache.camel.util.ObjectHelper;
 
 /**
@@ -97,9 +98,9 @@
             answer.setRelativeFilePath(file.getAbsolutePath());
         } else {
             File path;
-            if (file.getPath().startsWith(endpointPath)) {
+            if (file.getPath().startsWith(FileUtil.normalizePath(endpointPath))) {
                 // skip duplicate endpoint path
-                path = new File(ObjectHelper.after(file.getPath(), endpointPath + File.separator));
+                path = new File(ObjectHelper.after(file.getPath(), FileUtil.normalizePath(endpointPath)
+ File.separator));
             } else {
                 path = new File(file.getPath());
             }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java?rev=752362&r1=752361&r2=752362&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java Wed
Mar 11 03:47:37 2009
@@ -94,12 +94,12 @@
     }
 
     public void testSimpleAndFile() throws Exception {
-        assertExpression("backup-${in.header.foo}-${file:name.noext}.bak", "backup-abc-test/hello.bak");
+        assertExpression("backup-${in.header.foo}-${file:name.noext}.bak", "backup-abc-test"
+ File.separator + "hello.bak");
         assertExpression("backup-${in.header.foo}-${file:onlyname.noext}.bak", "backup-abc-hello.bak");
     }
 
     public void testSimpleAndFileAndBean() throws Exception {
-        assertExpression("backup-${in.header.foo}-${bean:generator}-${file:name.noext}.bak",
"backup-abc-generatorbybean-test/hello.bak");
+        assertExpression("backup-${in.header.foo}-${bean:generator}-${file:name.noext}.bak",
"backup-abc-generatorbybean-test" + File.separator + "hello.bak");
         assertExpression("backup-${in.header.foo}-${bean:generator}-${file:onlyname.noext}.bak",
"backup-abc-generatorbybean-hello.bak");
     }
 



Mime
View raw message