incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r571214 - /incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/
Date Thu, 30 Aug 2007 15:44:32 GMT
Author: ngn
Date: Thu Aug 30 08:44:21 2007
New Revision: 571214

URL: http://svn.apache.org/viewvc?rev=571214&view=rev
Log:
Doubled up all SSL tests so that both MINA and IO listeners are covered

Added:
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/IOCipherSuitesTest.java
      - copied, changed from r560793, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaClientAuthTest.java
      - copied, changed from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitSSLTest.java
      - copied, changed from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitSSLTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitTLSTest.java
      - copied, changed from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitTLSTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitClientAuthTest.java
      - copied, changed from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitClientAuthTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitSSLTest.java
      - copied, changed from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitSSLTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitTLSTest.java
      - copied, changed from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitTLSTest.java
Removed:
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitSSLTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitTLSTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitClientAuthTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitSSLTest.java
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitTLSTest.java
Modified:
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/SSLTestTemplate.java

Copied: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/IOCipherSuitesTest.java
(from r560793, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/IOCipherSuitesTest.java?p2=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/IOCipherSuitesTest.java&p1=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java&r1=560793&r2=571214&rev=571214&view=diff
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/IOCipherSuitesTest.java
Thu Aug 30 08:44:21 2007
@@ -21,13 +21,13 @@
 
 import java.util.Properties;
 
-import org.apache.ftpserver.listener.mina.MinaListener;
+import org.apache.ftpserver.listener.io.IOListener;
 
-public class MinaCipherSuitesTest extends IOCipherSuitesTest {
+public class IOCipherSuitesTest extends MinaCipherSuitesTest {
 
     protected Properties createConfig() {
         Properties config = super.createConfig();
-        config.setProperty("config.listeners.default.class", MinaListener.class.getName());
+        config.setProperty("config.listeners.default.class", IOListener.class.getName());
 
         return config;
     }

Added: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java?rev=571214&view=auto
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
(added)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
Thu Aug 30 08:44:21 2007
@@ -0,0 +1,80 @@
+/*
+ * 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.ssl;
+
+import java.util.Properties;
+
+import javax.net.ssl.SSLHandshakeException;
+
+import org.apache.commons.net.ftp.FTPSClient;
+
+public class MinaCipherSuitesTest extends SSLTestTemplate {
+
+    protected String getAuthValue() {
+        return "TLS";
+    }
+    
+    protected Properties createConfig() {
+        Properties config = super.createConfig();
+        config.setProperty("config.listeners.default.implicitSsl",
+        "true");
+
+        config.setProperty("config.listeners.default.ssl.enabledCipherSuites", "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA");
+
+        return config;
+    }
+
+    protected FTPSClient createFTPClient() throws Exception {
+        return new FTPSClient(true);
+    }
+
+    protected void doConnect() throws Exception {
+    }
+
+    
+    /*
+     * Only certain cipher suites will work with the keys and protocol 
+     * we're using for this test. 
+     * Two suites known to work is:
+     *  * SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
+     *  * SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
+     */
+    public void testEnabled() throws Exception {
+        
+        client.setEnabledCipherSuites(new String[]{ 
+                "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA"});
+        
+        super.doConnect();
+    }
+    
+    public void testDisabled() throws Exception {
+        
+        client.setEnabledCipherSuites(new String[]{ 
+                "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA"});
+        
+        try {
+            super.doConnect();
+            fail("Must throw SSLHandshakeException"); 
+        } catch(SSLHandshakeException e) {
+            // OK
+        }
+    }
+
+}

Copied: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaClientAuthTest.java
(from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaClientAuthTest.java?p2=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaClientAuthTest.java&p1=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java&r1=521665&r2=571214&rev=571214&view=diff
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaClientAuthTest.java
Thu Aug 30 08:44:21 2007
@@ -28,7 +28,7 @@
 import org.apache.commons.net.ftp.FTPSClient;
 
 
-public class ClientAuthTest extends SSLTestTemplate {
+public class MinaClientAuthTest extends SSLTestTemplate {
 
     protected boolean useImplicit() {
         return false;

Copied: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitSSLTest.java
(from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitSSLTest.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitSSLTest.java?p2=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitSSLTest.java&p1=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitSSLTest.java&r1=521665&r2=571214&rev=571214&view=diff
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitSSLTest.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitSSLTest.java
Thu Aug 30 08:44:21 2007
@@ -20,7 +20,7 @@
 package org.apache.ftpserver.ssl;
 
 
-public class ExplicitSSLTest extends ExplicitSecurityTestTemplate {
+public class MinaExplicitSSLTest extends ExplicitSecurityTestTemplate {
 
     protected String getAuthValue() {
         return "SSL";

Copied: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitTLSTest.java
(from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitTLSTest.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitTLSTest.java?p2=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitTLSTest.java&p1=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitTLSTest.java&r1=521665&r2=571214&rev=571214&view=diff
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ExplicitTLSTest.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaExplicitTLSTest.java
Thu Aug 30 08:44:21 2007
@@ -20,7 +20,7 @@
 package org.apache.ftpserver.ssl;
 
 
-public class ExplicitTLSTest extends ExplicitSecurityTestTemplate {
+public class MinaExplicitTLSTest extends ExplicitSecurityTestTemplate {
 
     protected String getAuthValue() {
         return "TLS";

Copied: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitClientAuthTest.java
(from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitClientAuthTest.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitClientAuthTest.java?p2=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitClientAuthTest.java&p1=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitClientAuthTest.java&r1=521665&r2=571214&rev=571214&view=diff
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitClientAuthTest.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitClientAuthTest.java
Thu Aug 30 08:44:21 2007
@@ -22,7 +22,7 @@
 import java.util.Properties;
 
 
-public class ImplicitClientAuthTest extends ClientAuthTest {
+public class MinaImplicitClientAuthTest extends MinaClientAuthTest {
 
     protected Properties createConfig() {
         Properties config = super.createConfig();

Copied: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitSSLTest.java
(from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitSSLTest.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitSSLTest.java?p2=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitSSLTest.java&p1=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitSSLTest.java&r1=521665&r2=571214&rev=571214&view=diff
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitSSLTest.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitSSLTest.java
Thu Aug 30 08:44:21 2007
@@ -20,7 +20,7 @@
 package org.apache.ftpserver.ssl;
 
 
-public class ImplicitSSLTest extends ImplicitSecurityTestTemplate {
+public class MinaImplicitSSLTest extends ImplicitSecurityTestTemplate {
 
     protected String getAuthValue() {
         return "SSL";

Copied: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitTLSTest.java
(from r521665, incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitTLSTest.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitTLSTest.java?p2=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitTLSTest.java&p1=incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitTLSTest.java&r1=521665&r2=571214&rev=571214&view=diff
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ImplicitTLSTest.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/MinaImplicitTLSTest.java
Thu Aug 30 08:44:21 2007
@@ -20,7 +20,7 @@
 package org.apache.ftpserver.ssl;
 
 
-public class ImplicitTLSTest extends ImplicitSecurityTestTemplate {
+public class MinaImplicitTLSTest extends ImplicitSecurityTestTemplate {
 
     protected String getAuthValue() {
         return "TLS";

Modified: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/SSLTestTemplate.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/SSLTestTemplate.java?rev=571214&r1=571213&r2=571214&view=diff
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/SSLTestTemplate.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/SSLTestTemplate.java
Thu Aug 30 08:44:21 2007
@@ -22,7 +22,6 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.net.SocketException;
 import java.util.Properties;
 
 import javax.net.ssl.SSLException;
@@ -38,7 +37,6 @@
 import org.apache.ftpserver.FtpServer;
 import org.apache.ftpserver.config.PropertiesConfiguration;
 import org.apache.ftpserver.interfaces.FtpServerContext;
-import org.apache.ftpserver.listener.io.IOListener;
 import org.apache.ftpserver.listener.mina.MinaListener;
 import org.apache.ftpserver.util.IoUtils;
 import org.slf4j.Logger;
@@ -86,7 +84,7 @@
         assertTrue(FTPSERVER_KEYSTORE.exists());
         
         Properties configProps = new Properties();
-        configProps.setProperty("config.listeners.default.class", IOListener.class.getName());
+        configProps.setProperty("config.listeners.default.class", MinaListener.class.getName());
         configProps.setProperty("config.listeners.default.port", Integer
                 .toString(port));
         configProps.setProperty("config.listeners.default.ssl.class",
@@ -242,6 +240,7 @@
         }
         
         if(lastException != null) {
+        	lastException.printStackTrace();
             throw lastException;
         }
     }



Mime
View raw message