Author: bvahdat
Date: Fri Aug 17 18:27:56 2012
New Revision: 1374388

URL: http://svn.apache.org/viewvc?rev=1374388&view=rev
Log:
CAMEL-5514:: Warn both through console as well as log if we can not run a given 
test.

Modified:
    
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java
    
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsServerTestSupport.java
    
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java

Modified: 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java?rev=1374388&r1=1374387&r2=1374388&view=diff
==============================================================================
--- 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java
 (original)
+++ 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpServerTestSupport.java
 Fri Aug 17 18:27:56 2012
@@ -67,8 +67,12 @@ public abstract class FtpServerTestSuppo
             NoSuchAlgorithmException nsae = 
ObjectHelper.getException(NoSuchAlgorithmException.class, e);
             if (nsae != null) {
                 canTest = false;
+
+                // warn both through console as well as log that we can not 
run the test
                 String name = System.getProperty("os.name");
-                System.out.println("SunX509 is not avail on this platform [" + 
name + "] Testing is skipped! Real cause: " + nsae.getMessage());
+                String message = nsae.getMessage();
+                System.out.println("SunX509 is not avail on this platform [" + 
name + "] Testing is skipped! Real cause: " + message);
+                log.warn("SunX509 is not avail on this platform [{0}] Testing 
is skipped! Real cause: {1}", name, message);
             } else {
                 // some other error then throw it so the test can fail
                 throw e;

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=1374388&r1=1374387&r2=1374388&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
 Fri Aug 17 18:27:56 2012
@@ -45,15 +45,18 @@ public abstract class FtpsServerTestSupp
             // ignore if algorithm is not on the OS
             NoSuchAlgorithmException nsae = 
ObjectHelper.getException(NoSuchAlgorithmException.class, e);
             if (nsae != null) {
+                // warn both through console as well as log that we can not 
run the test
                 String name = System.getProperty("os.name");
-                System.out.println("SunX509 is not avail on this platform [" + 
name + "] Testing is skipped! Real cause: " + nsae.getMessage());
+                String message = nsae.getMessage();
+                System.out.println("SunX509 is not avail on this platform [" + 
name + "] Testing is skipped! Real cause: " + message);
+                log.warn("SunX509 is not avail on this platform [{0}] Testing 
is skipped! Real cause: {1}", name, message);
+                
+                return null;
             } else {
                 // some other error then throw it so the test can fail
                 throw e;
             }
         }
-
-        return null;
     }
 
     protected FtpServerFactory doCreateFtpServerFactory() throws Exception {

Modified: 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java?rev=1374388&r1=1374387&r2=1374388&view=diff
==============================================================================
--- 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java
 (original)
+++ 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java
 Fri Aug 17 18:27:56 2012
@@ -60,7 +60,12 @@ public class SftpServerTestSupport exten
             NoSuchAlgorithmException nsae = 
ObjectHelper.getException(NoSuchAlgorithmException.class, e);
             if (nsae != null) {
                 canTest = false;
-                log.warn("SunX509 is not avail on this platform [{0}] Testing 
is skipped! Real cause: {1}", System.getProperty("os.name"), nsae.getMessage());
+
+                // warn both through console as well as log that we can not 
run the test
+                String name = System.getProperty("os.name");
+                String message = nsae.getMessage();
+                System.out.println("SunX509 is not avail on this platform [" + 
name + "] Testing is skipped! Real cause: " + message);
+                log.warn("SunX509 is not avail on this platform [{0}] Testing 
is skipped! Real cause: {1}", name, message);
             } else {
                 // some other error then throw it so the test can fail
                 throw e;


Reply via email to