camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r685022 - in /activemq/camel/trunk/components/camel-ftp: ./ src/main/java/org/apache/camel/component/file/remote/ src/test/java/org/apache/camel/component/file/remote/
Date Tue, 12 Aug 2008 02:17:13 GMT
Author: ningjiang
Date: Mon Aug 11 19:17:11 2008
New Revision: 685022

URL: http://svn.apache.org/viewvc?rev=685022&view=rev
Log:
CAMEL-809 Applied patch with thanks to Jonathan

Modified:
    activemq/camel/trunk/components/camel-ftp/pom.xml
    activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpDeleteFileTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpExclusiveReadTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePostfixTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePrefixTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFileTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNoFilesTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNonExclusiveReadTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpPollFileOnlyTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRegexPatternTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpSetNamesWithMultiDirectoriesTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileNoBodyConversionTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFileTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFilesTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToFileNoFileNameHeaderTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToMockTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerSkipDotFilesTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java

Modified: activemq/camel/trunk/components/camel-ftp/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/pom.xml?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/pom.xml (original)
+++ activemq/camel/trunk/components/camel-ftp/pom.xml Mon Aug 11 19:17:11 2008
@@ -76,15 +76,22 @@
     <dependency>
       <groupId>org.apache.ftpserver</groupId>
       <artifactId>ftpserver-core</artifactId>
-      <version>1.0-incubator-SNAPSHOT</version>
+      <version>1.0.0-M2</version>
       <scope>test</scope>
     </dependency>
 
-    <!-- ftpserver using mina 1.0.2 -->
+    <dependency>
+      <groupId>org.apache.ftpserver</groupId>
+      <artifactId>ftplet-api</artifactId>
+      <version>1.0.0-M2</version>
+      <scope>test</scope>
+    </dependency>
+
+    <!-- ftpserver using mina 2.0.0-M2 -->
     <dependency>
       <groupId>org.apache.mina</groupId>
       <artifactId>mina-core</artifactId>
-      <version>1.0.2</version>
+      <version>2.0.0-M2</version>
       <scope>test</scope>
     </dependency>
 
@@ -96,8 +103,15 @@
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <scope>test</scope>
+      <version>1.5.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>
+      <version>1.5.2</version>
     </dependency>
     <dependency>
       <groupId>log4j</groupId>

Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
Mon Aug 11 19:17:11 2008
@@ -56,7 +56,7 @@
     @Override
     protected void doStart() throws Exception {
         log.info("Starting");
-        // do not connect when componet starts, just wait until we process as we will
+        // do not connect when component starts, just wait until we process as we will
         // connect at that time if needed
         super.doStart();
     }

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java
Mon Aug 11 19:17:11 2008
@@ -24,7 +24,7 @@
  */
 public class FromFileToFtpTest extends FtpServerTestSupport {
 
-    private String port = "20011";
+    private int port = 20011;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/tmp2/camel?password=admin";
 
     public void testFromFileToFtp() throws Exception {
@@ -36,7 +36,7 @@
         Thread.sleep(1000);
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpDeleteFileTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpDeleteFileTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpDeleteFileTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpDeleteFileTest.java
Mon Aug 11 19:17:11 2008
@@ -30,10 +30,10 @@
  */
 public class FromFtpDeleteFileTest extends FtpServerTestSupport {
 
-    private String port = "20022";
+    private int port = 20022;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/deletefile?password=admin&binary=false&consumer.deleteFile=true";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpExclusiveReadTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpExclusiveReadTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpExclusiveReadTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpExclusiveReadTest.java
Mon Aug 11 19:17:11 2008
@@ -30,10 +30,10 @@
 
     private static final Log LOG = LogFactory.getLog(FromFtpExclusiveReadTest.class);
 
-    private String port = "20090";
+    private int port = 20090;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/slowfile?password=admin&consumer.exclusiveReadLock=true&consumer.delay=500";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePostfixTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePostfixTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePostfixTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePostfixTest.java
Mon Aug 11 19:17:11 2008
@@ -30,11 +30,11 @@
  */
 public class FromFtpMoveFilePostfixTest extends FtpServerTestSupport {
 
-    private String port = "20031";
+    private int port = 20031;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/movefile?password=admin&binary=false"
         + "&consumer.moveNamePostfix=.old";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -84,4 +84,4 @@
         };
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePrefixTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePrefixTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePrefixTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFilePrefixTest.java
Mon Aug 11 19:17:11 2008
@@ -30,11 +30,11 @@
  */
 public class FromFtpMoveFilePrefixTest extends FtpServerTestSupport {
 
-    private String port = "20030";
+    private int port = 20030;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/movefile?password=admin&binary=false"
         + "&consumer.moveNamePrefix=done/";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -84,4 +84,4 @@
         };
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFileTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFileTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFileTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpMoveFileTest.java
Mon Aug 11 19:17:11 2008
@@ -30,11 +30,11 @@
  */
 public class FromFtpMoveFileTest extends FtpServerTestSupport {
 
-    private String port = "20032";
+    private int port = 20032;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/movefile?password=admin&binary=false"
         + "&consumer.moveNamePrefix=done/sub2/&consumer.moveNamePostfix=.old";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -84,4 +84,4 @@
         };
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNoFilesTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNoFilesTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNoFilesTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNoFilesTest.java
Mon Aug 11 19:17:11 2008
@@ -30,10 +30,10 @@
 
     private static final Log LOG = LogFactory.getLog(FromFtpExclusiveReadTest.class);
 
-    private String port = "20020";
+    private int port = 20020;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/slowfile?password=admin&binary=false&consumer.exclusiveReadLock=true&consumer.delay=500";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -61,4 +61,4 @@
         File file = new File(s);
         file.mkdirs();
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNonExclusiveReadTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNonExclusiveReadTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNonExclusiveReadTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpNonExclusiveReadTest.java
Mon Aug 11 19:17:11 2008
@@ -31,10 +31,10 @@
 
     private static final Log LOG = LogFactory.getLog(FromFtpExclusiveReadTest.class);
 
-    private String port = "20027";
+    private int port = 20027;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/slowfile?password=admin&consumer.exclusiveReadLock=false&consumer.delay=500";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -81,4 +81,4 @@
         File file = new File(s);
         file.mkdirs();
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpPollFileOnlyTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpPollFileOnlyTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpPollFileOnlyTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpPollFileOnlyTest.java
Mon Aug 11 19:17:11 2008
@@ -28,7 +28,7 @@
  */
 public class FromFtpPollFileOnlyTest extends FtpServerTestSupport {
 
-    private String port = "20028";
+    private int port = 20028;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/fileonly/report.txt?password=admin&directory=false";
 
     public void testPollFileOnly() throws Exception {
@@ -39,7 +39,7 @@
         mock.assertIsSatisfied();
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -70,4 +70,4 @@
         };
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRegexPatternTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRegexPatternTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRegexPatternTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRegexPatternTest.java
Mon Aug 11 19:17:11 2008
@@ -25,7 +25,7 @@
  */
 public class FromFtpRegexPatternTest extends FtpServerTestSupport {
 
-    private String port = "20097";
+    private int port = 20097;
 
     private String ftpUrl = "ftp://admin@localhost:" + port + "/regexp?password=admin&consumer.regexPattern=report.*";
 
@@ -36,7 +36,7 @@
         mock.assertIsSatisfied();
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -64,4 +64,4 @@
         };
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpSetNamesWithMultiDirectoriesTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpSetNamesWithMultiDirectoriesTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpSetNamesWithMultiDirectoriesTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpSetNamesWithMultiDirectoriesTest.java
Mon Aug 11 19:17:11 2008
@@ -32,7 +32,7 @@
  */
 public class FromFtpSetNamesWithMultiDirectoriesTest extends FtpServerTestSupport {
 
-    private String port = "20016";
+    private int port = 20016;
     
     // must user "consumer." prefix on the parameters to the file component
     private String ftpUrl = "ftp://admin@localhost:" + port + "/incoming?password=admin&binary=true"
@@ -63,7 +63,7 @@
         Thread.sleep(1000);
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -106,4 +106,4 @@
         };
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileNoBodyConversionTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileNoBodyConversionTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileNoBodyConversionTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileNoBodyConversionTest.java
Mon Aug 11 19:17:11 2008
@@ -29,7 +29,7 @@
  */
 public class FromFtpToAsciiFileNoBodyConversionTest extends FtpServerTestSupport {
 
-    private String port = "20012";
+    private int port = 20012;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/tmp5/camel?password=admin&binary=false";
 
     public void testFromFtpToAsciiFileNoBodyConversion() throws Exception {
@@ -42,7 +42,7 @@
         Thread.sleep(1000);
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java
Mon Aug 11 19:17:11 2008
@@ -30,7 +30,7 @@
  */
 public class FromFtpToAsciiFileTest extends FtpServerTestSupport {
 
-    private String port = "20013";
+    private int port = 20013;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/tmp3/camel?password=admin&binary=false";
 
     public void testFtpRoute() throws Exception {
@@ -51,7 +51,7 @@
         Thread.sleep(1000);
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -86,3 +86,4 @@
 
 }
 
+

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFileTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFileTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFileTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFileTest.java
Mon Aug 11 19:17:11 2008
@@ -31,7 +31,7 @@
  */
 public class FromFtpToBinaryFileTest extends FtpServerTestSupport {
 
-    private String port = "20014";
+    private int port = 20014;
     // must user "consumer." prefix on the parameters to the file component
     private String ftpUrl = "ftp://admin@localhost:" + port + "/tmp4/camel?password=admin&binary=true"
         + "&consumer.delay=2000&consumer.recursive=false&consumer.append=false";
@@ -56,7 +56,7 @@
         Thread.sleep(1000);
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -89,4 +89,4 @@
         };
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFilesTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFilesTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFilesTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToBinaryFilesTest.java
Mon Aug 11 19:17:11 2008
@@ -31,7 +31,7 @@
  */
 public class FromFtpToBinaryFilesTest extends FtpServerTestSupport {
 
-    private String port = "20015";
+    private int port = 20015;
     // must user "consumer." prefix on the parameters to the file component
     private String ftpUrl = "ftp://admin@localhost:" + port + "/incoming?password=admin&binary=true"
         + "&consumer.delay=2000&consumer.recursive=true&consumer.append=false";
@@ -61,7 +61,7 @@
         Thread.sleep(1000);
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToFileNoFileNameHeaderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToFileNoFileNameHeaderTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToFileNoFileNameHeaderTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToFileNoFileNameHeaderTest.java
Mon Aug 11 19:17:11 2008
@@ -31,7 +31,7 @@
  */
 public class FromFtpToFileNoFileNameHeaderTest extends FtpServerTestSupport {
 
-    private String port = "20017";
+    private int port = 20017;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/tmp3/camel?password=admin&binary=false";
 
     public void testCorrectFilename() throws Exception {
@@ -52,7 +52,7 @@
         Thread.sleep(1000);
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToMockTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToMockTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToMockTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToMockTest.java
Mon Aug 11 19:17:11 2008
@@ -25,7 +25,7 @@
 public class FromFtpToMockTest extends FtpServerTestSupport {
     protected MockEndpoint resultEndpoint;
     protected String expectedBody = "Hello there!";
-    protected String port = "2001";
+    protected int port = 2001;
     protected String ftpUrl = "ftp://admin@localhost:" + port + "/tmp/camel?password=admin&consumer.recursive=true";
 
     public void testFtpRoute() throws Exception {
@@ -55,7 +55,7 @@
         };
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java
Mon Aug 11 19:17:11 2008
@@ -25,7 +25,7 @@
  */
 public class FtpConsumerExcludeNameTest extends FtpServerTestSupport {
 
-    private String port = "20095";
+    private int port = 20095;
 
     private String ftpUrl = "ftp://admin@localhost:" + port + "/excludename?password=admin"
         + "&consumer.excludedNamePrefix=secret&consumer.excludedNamePostfix=xml";
@@ -37,7 +37,7 @@
         mock.assertIsSatisfied();
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -65,4 +65,4 @@
         };
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerSkipDotFilesTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerSkipDotFilesTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerSkipDotFilesTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerSkipDotFilesTest.java
Mon Aug 11 19:17:11 2008
@@ -25,7 +25,7 @@
  */
 public class FtpConsumerSkipDotFilesTest extends FtpServerTestSupport {
 
-    private String port = "20096";
+    private int port = 20096;
 
     private String ftpUrl = "ftp://admin@localhost:" + port + "/dotfiles?password=admin";
 
@@ -36,7 +36,7 @@
         mock.assertIsSatisfied();
     }
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java
Mon Aug 11 19:17:11 2008
@@ -26,10 +26,10 @@
  */
 public class FtpProducerBuildDirectoryTest extends FtpServerTestSupport {
 
-    private String port = "20089";
+    private int port = 20089;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/upload/user/claus?binary=false&password=admin";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java
Mon Aug 11 19:17:11 2008
@@ -26,10 +26,10 @@
  */
 public class FtpProducerBuildPartOfDirectoryTest extends FtpServerTestSupport {
 
-    private String port = "20021";
+    private int port = 20021;
     private String ftpUrl = "ftp://admin@localhost:" + port + "/upload/user/claus?binary=false&password=admin";
 
-    public String getPort() {
+    public int getPort() {
         return port;
     }
 
@@ -50,4 +50,4 @@
         file.mkdirs();
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java?rev=685022&r1=685021&r2=685022&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java
Mon Aug 11 19:17:11 2008
@@ -16,13 +16,8 @@
  */
 package org.apache.camel.component.file.remote;
 
-import java.util.Properties;
-
 import org.apache.camel.ContextTestSupport;
-import org.apache.ftpserver.ConfigurableFtpServerContext;
 import org.apache.ftpserver.FtpServer;
-import org.apache.ftpserver.config.PropertiesConfiguration;
-import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 
 /**
@@ -31,7 +26,7 @@
 public abstract class FtpServerTestSupport extends ContextTestSupport {
     protected FtpServer ftpServer;
 
-    public abstract String getPort();
+    public abstract int getPort();
 
     protected void setUp() throws Exception {
         super.setUp();
@@ -44,29 +39,13 @@
     protected void tearDown() throws Exception {
         super.tearDown();
         if (!ftpServer.isStopped()) {
-            // must stop server after super to let the clients stop correctly (CAMEL-444)
-            ftpServer.getServerContext().getConnectionManager().closeAllConnections();
             ftpServer.getServerContext().dispose();
             ftpServer.stop();
         }
     }
 
     protected void initFtpServer() throws Exception {
-        // get the configuration object
-        Properties properties = createFtpServerProperties();
-        Configuration config = new PropertiesConfiguration(properties);
-
-        // create service context
-        FtpServerContext ftpConfig = new ConfigurableFtpServerContext(config);
-
-        // create the server object and start it
-        ftpServer = new FtpServer(ftpConfig);
-    }
-
-    protected Properties createFtpServerProperties() {
-        Properties properties = new Properties();
-        properties.setProperty("config.listeners.default.port", getPort());
-        properties.setProperty("config.create-default-user", "true");
-        return properties;
+        ftpServer = new FtpServer();
+        ftpServer.getListener("default").setPort(getPort());
     }
 }



Mime
View raw message