svn commit: r564692 - in /activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote: FromFileToFtpTest.java FtpRouteTest.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r564692 - in /activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote: FromFileToFtpTest.java FtpRouteTest.java

jstrachan-2
Author: jstrachan
Date: Fri Aug 10 10:39:11 2007
New Revision: 564692

URL: http://svn.apache.org/viewvc?view=rev&rev=564692
Log:
fixed ftp tests to use different ports

Modified:
    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/FtpRouteTest.java

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?view=diff&rev=564692&r1=564691&r2=564692
==============================================================================
--- 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 Fri Aug 10 10:39:11 2007
@@ -29,10 +29,12 @@
         resultEndpoint.assertIsSatisfied();
     }
 
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        ftpUrl = "ftp://admin@localhost:20011/tmp2/camel?password=admin";
-
+    protected String createFtpUrl() {
+        port = "20011";
+        return "ftp://admin@localhost:" + port + "/tmp2/camel?password=admin";
+    }
 
+    protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
                 from("file:src/main/data?noop=true").to(ftpUrl);

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpRouteTest.java?view=diff&rev=564692&r1=564691&r2=564692
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpRouteTest.java Fri Aug 10 10:39:11 2007
@@ -32,9 +32,10 @@
  */
 public class FtpRouteTest extends ContextTestSupport {
     protected MockEndpoint resultEndpoint;
-    protected String ftpUrl = "ftp://admin@localhost:20010/tmp/camel?password=admin";
+    protected String ftpUrl;
     protected FtpServer ftpServer;
     protected String expectedBody = "Hello there!";
+    protected String port = "20010";
 
     public void testFtpRoute() throws Exception {
 
@@ -55,6 +56,7 @@
 
     @Override
     protected void setUp() throws Exception {
+        ftpUrl = createFtpUrl();
         ftpServer = createFtpServer();
         ftpServer.start();
 
@@ -80,6 +82,10 @@
         };
     }
 
+    protected String createFtpUrl() {
+        return "ftp://admin@localhost:" + port + "/tmp/camel?password=admin";
+    }
+
     protected FtpServer createFtpServer() throws Exception {
         // get the configuration object
         Properties properties = createFtpServerProperties();
@@ -95,7 +101,7 @@
     protected Properties createFtpServerProperties() {
         Properties properties = new Properties();
         //properties.setProperty("config.data-connection.passive.ports", "20010");
-        properties.setProperty("config.listeners.default.port", "20010");
+        properties.setProperty("config.listeners.default.port", port);
         properties.setProperty("config.create-default-user", "true");
         return properties;
     }