incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r497036 - /incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/SSLTestTemplate.java
Date Wed, 17 Jan 2007 15:02:58 GMT
Author: ngn
Date: Wed Jan 17 07:02:57 2007
New Revision: 497036

URL: http://svn.apache.org/viewvc?view=rev&rev=497036
Log:
More agressive retry as the SSL engine seems to take some time to initialize with MINE

Modified:
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/SSLTestTemplate.java

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?view=diff&rev=497036&r1=497035&r2=497036
==============================================================================
--- 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
Wed Jan 17 07:02:57 2007
@@ -24,6 +24,8 @@
 import java.io.IOException;
 import java.util.Properties;
 
+import javax.net.ssl.SSLException;
+
 import junit.framework.TestCase;
 
 import org.apache.commons.logging.Log;
@@ -203,13 +205,21 @@
             }
         });
 
-        try {
-            client.connect("localhost", port);
-        } catch (FTPConnectionClosedException e) {
-            // try again
-            Thread.sleep(200);
-            client.connect("localhost", port);
+        int attempts = 0;
+        
+        while(attempts < 5) {
+            try {
+                client.connect("localhost", port);
+                break;
+            } catch (SSLException e) {
+                // try again
+            } catch (FTPConnectionClosedException e) {
+                // try again
+            }
+            Thread.sleep(500);
+            attempts++;
         }
+        
     }
 
     protected void cleanTmpDirs() throws IOException {



Mime
View raw message