Author: ngn
Date: Fri Dec 26 04:32:18 2008
New Revision: 729486

URL: http://svn.apache.org/viewvc?rev=729486&view=rev
Log:
Cleaning up the code for how we create active data connections and setting 
active sockets to be available for reuse, this is to fix FTPSERVER-250.
Adding tests from FTPSERVER-250 that shows that multiple active connections can 
not be opened when specifying the local address.
Attempting a better behavior on what local address to default to, we now choose 
the same address as the client used when connecting to us, this removes the 
need to disable remote verification.

Added:
    
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionParallelTest.java
    
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java
Modified:
    
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
    
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java
    
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java
    
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java
    
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java
    
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java

Modified: 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java?rev=729486&r1=729485&r2=729486&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
 (original)
+++ 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
 Fri Dec 26 04:32:18 2008
@@ -49,18 +49,6 @@
     private boolean implicitSsl;
 
     /**
-     * Default constructor
-     */
-    public DataConnectionConfigurationFactory() {
-        try {
-            activeLocalAddress = InetAddress.getLocalHost().getHostAddress();
-        } catch (UnknownHostException e) {
-            throw new FtpServerConfigurationException(
-                    "Failed to resolve localhost", e);
-        }
-    }
-    
-    /**
      * Create a {...@link DataConnectionConfiguration} instance based on the 
      * configuration on this factory
      * @return The {...@link DataConnectionConfiguration} instance

Modified: 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java?rev=729486&r1=729485&r2=729486&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java
 (original)
+++ 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java
 Fri Dec 26 04:32:18 2008
@@ -24,6 +24,7 @@
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.net.SocketAddress;
 import java.net.UnknownHostException;
 import java.security.GeneralSecurityException;
 
@@ -80,7 +81,8 @@
             final FtpIoSession session) {
         this.session = session;
         this.serverContext = serverContext;
-        if 
(session.getListener().getDataConnectionConfiguration().isImplicitSsl()) {
+        if (session.getListener().getDataConnectionConfiguration()
+                .isImplicitSsl()) {
             secure = true;
         }
     }
@@ -142,18 +144,19 @@
     }
 
     private SslConfiguration getSslConfiguration() {
-        DataConnectionConfiguration dataCfg = 
session.getListener().getDataConnectionConfiguration();
-        
+        DataConnectionConfiguration dataCfg = session.getListener()
+                .getDataConnectionConfiguration();
+
         SslConfiguration configuration = dataCfg.getSslConfiguration();
 
         // fall back if no configuration has been provided on the data 
connection config
-        if(configuration == null) {
+        if (configuration == null) {
             configuration = session.getListener().getSslConfiguration();
         }
-        
+
         return configuration;
     }
-    
+
     /**
      * Initiate a data connection in passive mode (server listening). It 
returns
      * the success flag.
@@ -175,17 +178,15 @@
 
         // open passive server socket and get parameters
         try {
-               DataConnectionConfiguration dataCfg = session.getListener()
+            DataConnectionConfiguration dataCfg = session.getListener()
                     .getDataConnectionConfiguration();
-               
-               String passiveAddress=dataCfg.getPassiveAddress();
-               
-               
+
+            String passiveAddress = dataCfg.getPassiveAddress();
 
             if (passiveAddress == null) {
                 address = serverControlAddress;
-            }else{
-               address = resolveAddress(dataCfg.getPassiveAddress());
+            } else {
+                address = resolveAddress(dataCfg.getPassiveAddress());
             }
 
             if (secure) {
@@ -198,7 +199,7 @@
                     throw new DataConnectionException(
                             "Data connection SSL required but not 
configured.");
                 }
-                
+
                 // this method does not actually create the SSL socket, due to 
a JVM bug 
                 // (https://issues.apache.org/jira/browse/FTPSERVER-241).
                 // Instead, it creates a regular
@@ -274,7 +275,6 @@
                 .getDataConnectionConfiguration();
         try {
             if (!passive) {
-                int localPort = dataConfig.getActiveLocalPort();
                 if (secure) {
                     LOG.debug("Opening secure active data connection");
                     SslConfiguration ssl = getSslConfiguration();
@@ -282,61 +282,84 @@
                         throw new FtpException(
                                 "Data connection SSL not configured");
                     }
-                    if (localPort == 0) {
-                        dataSoc = createSocket(ssl, address, port, null,
-                                localPort, false);
-                    } else {
-                        InetAddress localAddr = resolveAddress(dataConfig
-                                .getActiveLocalAddress());
-                        dataSoc = createSocket(ssl, address, port, localAddr,
-                                localPort, false);
+
+                    // get socket factory
+                    SSLContext ctx = ssl.getSSLContext();
+                    SSLSocketFactory socFactory = ctx.getSocketFactory();
+
+                    // create socket
+                    SSLSocket ssoc = (SSLSocket) socFactory.createSocket();
+                    ssoc.setUseClientMode(false);
+
+                    // initialize socket
+                    if (ssl.getEnabledCipherSuites() != null) {
+                        
ssoc.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
                     }
+                    dataSoc = ssoc;
                 } else {
                     LOG.debug("Opening active data connection");
-                    if (localPort == 0) {
-                        dataSoc = new Socket(address, port);
-                    } else {
-                        InetAddress localAddr =resolveAddress(dataConfig
-                                .getActiveLocalAddress());
-                        dataSoc = new Socket(address, port, localAddr,
-                                localPort);
-                    }
+                    dataSoc = new Socket();
                 }
+
+                dataSoc.setReuseAddress(true);
+
+                InetAddress localAddr = resolveAddress(dataConfig
+                        .getActiveLocalAddress());
+
+                // if no local address has been configured, make sure we use 
the same as the client connects from
+                if(localAddr == null) {
+                    localAddr = 
((InetSocketAddress)session.getLocalAddress()).getAddress();
+                }       
+
+                SocketAddress localSocketAddress = new 
InetSocketAddress(localAddr, dataConfig.getActiveLocalPort());
+                
+                LOG.debug("Binding active data connection to {}", 
localSocketAddress);
+                dataSoc.bind(localSocketAddress);
+
+                dataSoc.connect(new InetSocketAddress(address, port));
             } else {
 
-                if(secure) {
+                if (secure) {
                     LOG.debug("Opening secure passive data connection");
                     // this is where we wrap the unsecured socket as a 
SSLSocket. This is 
                     // due to the JVM bug described in FTPSERVER-241.
-                    
+
                     // get server socket factory
                     SslConfiguration ssl = getSslConfiguration();
+                    
+                    // we've already checked this, but let's do it again
+                    if (ssl == null) {
+                        throw new FtpException(
+                                "Data connection SSL not configured");
+                    }
 
                     SSLContext ctx = ssl.getSSLContext();
                     SSLSocketFactory ssocketFactory = ctx.getSocketFactory();
-                    
+
                     Socket serverSocket = servSoc.accept();
-                    
-                    SSLSocket sslSocket = (SSLSocket) 
ssocketFactory.createSocket(serverSocket,
-                            serverSocket.getInetAddress().getHostName(), 
serverSocket.getPort(), false);
+
+                    SSLSocket sslSocket = (SSLSocket) ssocketFactory
+                            .createSocket(serverSocket, serverSocket
+                                    .getInetAddress().getHostName(),
+                                    serverSocket.getPort(), false);
                     sslSocket.setUseClientMode(false);
-                    
+
                     // initialize server socket
                     if (ssl.getClientAuth() == ClientAuth.NEED) {
                         sslSocket.setNeedClientAuth(true);
                     } else if (ssl.getClientAuth() == ClientAuth.WANT) {
                         sslSocket.setWantClientAuth(true);
                     }
-    
+
                     if (ssl.getEnabledCipherSuites() != null) {
-                        sslSocket
-                                
.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
+                        sslSocket.setEnabledCipherSuites(ssl
+                                .getEnabledCipherSuites());
                     }
-                    
+
                     dataSoc = sslSocket;
                 } else {
                     LOG.debug("Opening passive data connection");
-                    
+
                     dataSoc = servSoc.accept();
                 }
                 LOG.debug("Passive data connection opened");
@@ -346,9 +369,8 @@
             LOG.warn("FtpDataConnection.getDataSocket()", ex);
             throw ex;
         }
-        dataSoc.setSoTimeout(dataConfig.getIdleTime()*1000);
-        
-        
+        dataSoc.setSoTimeout(dataConfig.getIdleTime() * 1000);
+
         // Make sure we initiate the SSL handshake, or we'll
         // get an error if we turn out not to send any data
         // e.g. during the listing of an empty directory
@@ -359,43 +381,23 @@
         return dataSoc;
     }
 
-    private Socket createSocket(final SslConfiguration ssl,
-            final InetAddress address2, final int port2,
-            final InetAddress localAddress, final int localPort,
-            final boolean clientMode) throws IOException,
-            GeneralSecurityException {
-
-        // get socket factory
-        SSLContext ctx = ssl.getSSLContext();
-        SSLSocketFactory socFactory = ctx.getSocketFactory();
-
-        // create socket
-        SSLSocket ssoc;
-        if (localPort != 0) {
-            ssoc = (SSLSocket) socFactory.createSocket(address2, port2);
-        } else {
-            ssoc = (SSLSocket) socFactory.createSocket(address2, port2,
-                    localAddress, localPort);
-        }
-        ssoc.setUseClientMode(clientMode);
-
-        // initialize socket
-        if (ssl.getEnabledCipherSuites() != null) {
-            ssoc.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
-        }
-        return ssoc;
-    }
     /*
      *  (non-Javadoc)
      *   Returns an InetAddress object from a hostname or IP address.
      */
-    private InetAddress resolveAddress(String host) throws 
DataConnectionException{
-       try{
-               return InetAddress.getByName(host);
-       }catch(UnknownHostException ex){
-               throw new DataConnectionException(ex.getLocalizedMessage(),ex);
-       }
+    private InetAddress resolveAddress(String host)
+            throws DataConnectionException {
+        if (host == null) {
+            return null;
+        } else {
+            try {
+                return InetAddress.getByName(host);
+            } catch (UnknownHostException ex) {
+                throw new DataConnectionException("Failed to resolve address", 
ex);
+            }
+        }
     }
+
     /*
      * (non-Javadoc)
      * 

Added: 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionParallelTest.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionParallelTest.java?rev=729486&view=auto
==============================================================================
--- 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionParallelTest.java
 (added)
+++ 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionParallelTest.java
 Fri Dec 26 04:32:18 2008
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ftpserver.clienttests;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.net.ftp.FTPClient;
+import org.apache.ftpserver.ConnectionConfigFactory;
+import org.apache.ftpserver.DataConnectionConfigurationFactory;
+
+/**
+*
+* From FTPSERVER-250
+*
+* @author The Apache MINA Project ([email protected])
+* @version $Rev$, $Date$
+*
+*/
+public class BindExceptionParallelTest extends ClientTestTemplate {
+    private static final int NUMBER_OF_CLIENTS = 200;
+    private List<FTPClient> clients;
+
+    @Override
+    protected FTPClient createFTPClient() throws Exception {
+        FTPClient c = super.createFTPClient();
+        c.setDataTimeout(1000);
+        return c;
+    }
+
+    @Override
+    protected void connectClient() throws Exception {
+        clients = new ArrayList<FTPClient>();
+
+        for (int i = 0; i < NUMBER_OF_CLIENTS; i++) {
+            super.connectClient();
+            client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
+            clients.add(client);
+        }
+
+        client = null;
+    }
+
+    @Override
+    protected ConnectionConfigFactory createConnectionConfigFactory() {
+        ConnectionConfigFactory factory = 
super.createConnectionConfigFactory();
+        factory.setMaxLogins(0);
+        return factory;
+    }
+
+    @Override
+    protected DataConnectionConfigurationFactory 
createDataConnectionConfigurationFactory() {
+        DataConnectionConfigurationFactory factory = 
super.createDataConnectionConfigurationFactory();
+        factory.setActiveLocalPort(2020);
+        factory.setActiveLocalAddress("localhost");
+        return factory;
+    }
+
+    public void testParallelExecution() throws Exception {
+        final BindExceptionTestFailStatus testFailStatus = new 
BindExceptionTestFailStatus();
+        for (int i = 0; i < NUMBER_OF_CLIENTS; i++) {
+            final int c = i;
+            new Thread("client" + (i + 1)) {
+                @Override
+                public void run() {
+                    try {
+                        System.out.println(" -- " + getName() + " before 
command");
+                        System.out.println("--> " + getName() + " " + 
Arrays.asList(clients.get(c).listFiles()));
+                        System.out.println(" -- " + getName() + " command ok");
+                    } catch (IOException e) {
+                        System.err.println(" xx " + getName() + " command ko");
+                        e.printStackTrace();
+                        testFailStatus.failed = true;
+                    }
+                }
+            }.start();
+        }
+
+        // make time to threads to finish its work
+        Thread.sleep(3000);
+
+        assertFalse(testFailStatus.failed);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        for (int i = 1; i < NUMBER_OF_CLIENTS; i++)
+            if (isConnectClient()) {
+                try {
+                    clients.get(i).quit();
+                } catch (Exception e) {
+                    // ignore
+                }
+            }
+        client = clients.get(0);
+        super.tearDown();
+    }
+
+    private static final class BindExceptionTestFailStatus {
+        public boolean failed = false;
+    }
+}
\ No newline at end of file

Added: 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java?rev=729486&view=auto
==============================================================================
--- 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java
 (added)
+++ 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java
 Fri Dec 26 04:32:18 2008
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ftpserver.clienttests;
+
+import org.apache.commons.net.ftp.FTPClient;
+import org.apache.ftpserver.DataConnectionConfigurationFactory;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+/**
+*
+* From FTPSERVER-250
+*
+* @author The Apache MINA Project ([email protected])
+* @version $Rev$, $Date$
+*
+*/
+public class BindExceptionSerialTest extends ClientTestTemplate {
+    @Override
+    protected FTPClient createFTPClient() throws Exception {
+        FTPClient c = super.createFTPClient();
+        c.setDataTimeout(1000);
+        return c;
+    }
+
+    @Override
+    protected DataConnectionConfigurationFactory 
createDataConnectionConfigurationFactory() {
+        DataConnectionConfigurationFactory factory = 
super.createDataConnectionConfigurationFactory();
+        factory.setActiveLocalPort(2020);
+        factory.setActiveLocalAddress("localhost");
+        return factory;
+    }
+
+    @Override
+    protected void connectClient() throws Exception {
+        super.connectClient();
+        client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
+    }
+
+    public void testSerialExecution() throws Exception {
+        try {
+            System.out.println("-- call one");
+            System.out.println(Arrays.asList(client.listFiles()));
+            System.out.println("-- call two");
+            System.out.println(Arrays.asList(client.listFiles()));
+        } catch (IOException e) {
+            e.printStackTrace();
+            fail();
+        }
+    }
+}
\ No newline at end of file

Modified: 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java?rev=729486&r1=729485&r2=729486&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java
 (original)
+++ 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java
 Fri Dec 26 04:32:18 2008
@@ -28,6 +28,8 @@
 import org.apache.commons.net.ProtocolCommandListener;
 import org.apache.commons.net.ftp.FTPClient;
 import org.apache.commons.net.ftp.FTPConnectionClosedException;
+import org.apache.ftpserver.ConnectionConfigFactory;
+import org.apache.ftpserver.DataConnectionConfigurationFactory;
 import org.apache.ftpserver.FtpServerFactory;
 import org.apache.ftpserver.impl.DefaultFtpServer;
 import org.apache.ftpserver.impl.FtpIoSession;
@@ -83,10 +85,18 @@
 
         FtpServerFactory serverFactory = new FtpServerFactory();
 
-        ListenerFactory factory = new ListenerFactory();
-        
-        factory.setPort(port);
-        serverFactory.addListener("default", factory.createListener());
+        serverFactory.setConnectionConfig(createConnectionConfigFactory()
+                .createConnectionConfig());
+
+        ListenerFactory listenerFactory = new ListenerFactory();
+
+        listenerFactory.setPort(port);
+
+        listenerFactory
+                
.setDataConnectionConfiguration(createDataConnectionConfigurationFactory()
+                        .createDataConnectionConfiguration());
+
+        serverFactory.addListener("default", listenerFactory.createListener());
 
         PropertiesUserManagerFactory umFactory = new 
PropertiesUserManagerFactory();
         umFactory.setAdminName("admin");
@@ -98,6 +108,14 @@
         return serverFactory;
     }
 
+    protected ConnectionConfigFactory createConnectionConfigFactory() {
+        return new ConnectionConfigFactory();
+    }
+
+    protected DataConnectionConfigurationFactory 
createDataConnectionConfigurationFactory() {
+        return new DataConnectionConfigurationFactory();
+    }
+
     /*
      * (non-Javadoc)
      * 
@@ -198,7 +216,7 @@
             IoUtils.delete(TEST_TMP_DIR);
         }
     }
-    
+
     protected FtpIoSession getActiveSession() {
         return server.getListener("default").getActiveSessions().iterator()
                 .next();

Modified: 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java?rev=729486&r1=729485&r2=729486&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java
 (original)
+++ 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java
 Fri Dec 26 04:32:18 2008
@@ -110,6 +110,8 @@
     }
 
     public void testStoreWithProtPInActiveMode() throws Exception {
+        client.setRemoteVerificationEnabled(false);
+        
         ((FTPSClient) client).execPROT("P");
         assertTrue(getActiveSession().getDataConnection().isSecure());
 
@@ -144,7 +146,6 @@
     }
 
     public void testListEmptyDir() throws Exception {
-        client.setRemoteVerificationEnabled(false);
         client.enterLocalPassiveMode();
 
         ((FTPSClient) client).execPROT("P");
@@ -157,7 +158,6 @@
     }
 
     public void testReceiveEmptyFile() throws Exception {
-        client.setRemoteVerificationEnabled(false);
         client.enterLocalPassiveMode();
 
         ((FTPSClient) client).execPROT("P");

Modified: 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java?rev=729486&r1=729485&r2=729486&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java
 (original)
+++ 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java
 Fri Dec 26 04:32:18 2008
@@ -47,9 +47,9 @@
         return "SSL";
     }
 
-    protected DataConnectionConfigurationFactory 
createDataConnectionConfiguration() {
+    protected DataConnectionConfigurationFactory 
createDataConnectionConfigurationFactory() {
         DataConnectionConfigurationFactory result = super
-                .createDataConnectionConfiguration();
+                .createDataConnectionConfigurationFactory();
         result.setImplicitSsl(true);
         return result;
     }
@@ -96,7 +96,6 @@
      */
     public void testStoreWithProtPInPassiveMode() throws Exception {
         secureClientDataConnection();
-        client.setRemoteVerificationEnabled(false);
         client.enterLocalPassiveMode();
 
         // Do not send PROT P

Modified: 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java?rev=729486&r1=729485&r2=729486&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java
 (original)
+++ 
mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java
 Fri Dec 26 04:32:18 2008
@@ -81,17 +81,11 @@
 
         
factory.setSslConfiguration(createSslConfiguration().createSslConfiguration());
         
-        
factory.setDataConnectionConfiguration(createDataConnectionConfiguration().createDataConnectionConfiguration());
-        
         server.addListener("default", factory.createListener());
         
         return server;
     }
     
-    protected DataConnectionConfigurationFactory 
createDataConnectionConfiguration() {
-        return new DataConnectionConfigurationFactory();
-    }
-
     protected boolean useImplicit() {
         return false;
     }


Reply via email to