camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r955193 - in /camel/trunk/components/camel-ftp/src: main/java/org/apache/camel/component/file/remote/FtpsConfiguration.java test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
Date Wed, 16 Jun 2010 11:04:53 GMT
Author: davsclaus
Date: Wed Jun 16 11:04:53 2010
New Revision: 955193

URL: http://svn.apache.org/viewvc?rev=955193&view=rev
Log:
CAMEL-2790: Default ftp port for ftps is now 21 as its more normal port number.

Modified:
    camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsConfiguration.java
    camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java

Modified: camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsConfiguration.java?rev=955193&r1=955192&r2=955193&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsConfiguration.java
(original)
+++ camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsConfiguration.java
Wed Jun 16 11:04:53 2010
@@ -39,11 +39,6 @@ public class FtpsConfiguration extends F
         super(uri);
     }
 
-    @Override
-    protected void setDefaultPort() {
-        setPort(2222);
-    }
-
     /**
      * Returns the underlying security protocol.
      */

Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java?rev=955193&r1=955192&r2=955193&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
(original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
Wed Jun 16 11:04:53 2010
@@ -16,20 +16,16 @@
  */
 package org.apache.camel.component.file.remote;
 
-import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-
 /**
  * @version $Revision$
  */
 public class UriConfigurationTest extends CamelTestSupport {
-    protected CamelContext context = new DefaultCamelContext();
 
     @Test
     public void testFtpConfigurationDefaults() {
@@ -70,7 +66,7 @@ public class UriConfigurationTest extend
 
         assertEquals("ftps", config.getProtocol());
         assertEquals("hostname", config.getHost());
-        assertEquals(2222, config.getPort());
+        assertEquals(21, config.getPort());
         assertNull(config.getUsername());
         assertNull(config.getPassword());
         assertEquals(false, config.isBinary());
@@ -79,6 +75,23 @@ public class UriConfigurationTest extend
     }
 
     @Test
+    public void testFtpsExplicitConfigurationDefaults() {
+        Endpoint endpoint = context.getEndpoint("ftps://hostname:990?isImplicit=true");
+        assertIsInstanceOf(FtpsEndpoint.class, endpoint);
+        FtpsEndpoint ftpsEndpoint = (FtpsEndpoint) endpoint;
+        FtpsConfiguration config = (FtpsConfiguration) ftpsEndpoint.getConfiguration();
+
+        assertEquals("ftps", config.getProtocol());
+        assertEquals("hostname", config.getHost());
+        assertEquals(990, config.getPort());
+        assertNull(config.getUsername());
+        assertNull(config.getPassword());
+        assertEquals(false, config.isBinary());
+        assertEquals(true, config.isImplicit());
+        assertEquals("TLS", config.getSecurityProtocol());
+    }
+
+    @Test
     public void testFtpExplicitConfiguration() {
         Endpoint endpoint = context.getEndpoint("ftp://user@hostname:1021/some/file?password=secret&binary=true");
         assertIsInstanceOf(FtpEndpoint.class, endpoint);



Mime
View raw message