camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r897760 - in /camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote: FtpShutdownCompleteAllTasksTest.java FtpShutdownCompleteCurrentTaskOnlyTest.java FtpsServerTestSupport.java
Date Mon, 11 Jan 2010 06:09:41 GMT
Author: davsclaus
Date: Mon Jan 11 06:09:41 2010
New Revision: 897760

URL: http://svn.apache.org/viewvc?rev=897760&view=rev
Log:
Fixing unit test on other boxes

Modified:
    camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteAllTasksTest.java
    camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteCurrentTaskOnlyTest.java
    camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsServerTestSupport.java

Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteAllTasksTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteAllTasksTest.java?rev=897760&r1=897759&r2=897760&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteAllTasksTest.java
(original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteAllTasksTest.java
Mon Jan 11 06:09:41 2010
@@ -47,9 +47,6 @@
         template.sendBodyAndHeader(ftpUrl, "C", Exchange.FILE_NAME, "c.txt");
         template.sendBodyAndHeader(ftpUrl, "D", Exchange.FILE_NAME, "d.txt");
         template.sendBodyAndHeader(ftpUrl, "E", Exchange.FILE_NAME, "e.txt");
-        template.sendBodyAndHeader(ftpUrl, "F", Exchange.FILE_NAME, "f.txt");
-        template.sendBodyAndHeader(ftpUrl, "G", Exchange.FILE_NAME, "g.txt");
-        template.sendBodyAndHeader(ftpUrl, "H", Exchange.FILE_NAME, "h.txt");
     }
 
     @Test
@@ -63,8 +60,8 @@
         // shutdown during processing
         context.stop();
 
-        // should route all 8
-        assertEquals("Should complete all messages", 8, bar.getReceivedCounter());
+        // should route all 5
+        assertEquals("Should complete all messages", 5, bar.getReceivedCounter());
     }
 
     @Override

Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteCurrentTaskOnlyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteCurrentTaskOnlyTest.java?rev=897760&r1=897759&r2=897760&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteCurrentTaskOnlyTest.java
(original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpShutdownCompleteCurrentTaskOnlyTest.java
Mon Jan 11 06:09:41 2010
@@ -47,9 +47,6 @@
         template.sendBodyAndHeader(ftpUrl, "C", Exchange.FILE_NAME, "c.txt");
         template.sendBodyAndHeader(ftpUrl, "D", Exchange.FILE_NAME, "d.txt");
         template.sendBodyAndHeader(ftpUrl, "E", Exchange.FILE_NAME, "e.txt");
-        template.sendBodyAndHeader(ftpUrl, "F", Exchange.FILE_NAME, "f.txt");
-        template.sendBodyAndHeader(ftpUrl, "G", Exchange.FILE_NAME, "g.txt");
-        template.sendBodyAndHeader(ftpUrl, "H", Exchange.FILE_NAME, "h.txt");
     }
 
     @Test
@@ -63,8 +60,8 @@
         // shutdown during processing
         context.stop();
 
-        // should NOT route all 8
-        assertTrue("Should NOT complete all messages, was: " + bar.getReceivedCounter(),
bar.getReceivedCounter() < 8);
+        // should NOT route all 5
+        assertTrue("Should NOT complete all messages, was: " + bar.getReceivedCounter(),
bar.getReceivedCounter() < 5);
     }
 
     @Override

Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsServerTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsServerTestSupport.java?rev=897760&r1=897759&r2=897760&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsServerTestSupport.java
(original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsServerTestSupport.java
Mon Jan 11 06:09:41 2010
@@ -19,6 +19,7 @@
 import java.io.File;
 import java.security.NoSuchAlgorithmException;
 
+import org.apache.camel.util.ObjectHelper;
 import org.apache.ftpserver.FtpServerFactory;
 import org.apache.ftpserver.listener.ListenerFactory;
 import org.apache.ftpserver.ssl.SslConfigurationFactory;
@@ -41,9 +42,16 @@
     protected FtpServerFactory createFtpServerFactory() throws Exception {
         try {
             return doCreateFtpServerFactory();
-        } catch (NoSuchAlgorithmException e) {
-            String name = System.getProperty("os.name");
-            System.out.println("SunX509 is not avail on this platform [" + name + "] Testing
is skipped! Real cause: " + e.getMessage());
+        } catch (Exception e) {
+            // ignore if algorithm is not on the OS
+            NoSuchAlgorithmException nsae = ObjectHelper.getException(NoSuchAlgorithmException.class,
e);
+            if (nsae != null) {
+                String name = System.getProperty("os.name");
+                System.out.println("SunX509 is not avail on this platform [" + name + "]
Testing is skipped! Real cause: " + nsae.getMessage());
+            } else {
+                // some other error then throw it so the test can fail
+                throw e;
+            }
         }
 
         return null;



Mime
View raw message