camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1463544 - /camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/
Date Tue, 02 Apr 2013 13:46:38 GMT
Author: davsclaus
Date: Tue Apr  2 13:46:37 2013
New Revision: 1463544

URL: http://svn.apache.org/r1463544
Log:
Fixed test on CI servers from other platforms

Modified:
    camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentDuplicateNamesTest.java
    camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentRedeliveryTest.java
    camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentTest.java
    camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentsUmlautIssueTest.java
    camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailHtmlAttachmentTest.java

Modified: camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentDuplicateNamesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentDuplicateNamesTest.java?rev=1463544&r1=1463543&r2=1463544&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentDuplicateNamesTest.java
(original)
+++ camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentDuplicateNamesTest.java
Tue Apr  2 13:46:37 2013
@@ -81,11 +81,10 @@ public class MailAttachmentDuplicateName
         DataHandler handler = out.getIn().getAttachment("logo.jpeg");
         assertNotNull("The logo should be there", handler);
 
-        if (isJava16()) {
-            assertEquals("image/jpeg; name=logo.jpeg", handler.getContentType());
-        } else {
-            assertEquals("application/octet-stream; name=logo.jpeg", handler.getContentType());
-        }
+        // content type should match
+        boolean match1 = "image/jpeg; name=logo.jpeg".equals(handler.getContentType());
+        boolean match2 = "application/octet-stream; name=logo.jpeg".equals(handler.getContentType());
+        assertTrue("Should match 1 or 2", match1 || match2);
 
         producer.stop();
     }

Modified: camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentRedeliveryTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentRedeliveryTest.java?rev=1463544&r1=1463543&r2=1463544&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentRedeliveryTest.java
(original)
+++ camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentRedeliveryTest.java
Tue Apr  2 13:46:37 2013
@@ -85,6 +85,10 @@ public class MailAttachmentRedeliveryTes
         } else {
             assertEquals("application/octet-stream; name=logo.jpeg", handler.getContentType());
         }
+        // content type should match
+        boolean match1 = "image/jpeg; name=logo.jpeg".equals(handler.getContentType());
+        boolean match2 = "application/octet-stream; name=logo.jpeg".equals(handler.getContentType());
+        assertTrue("Should match 1 or 2", match1 || match2);
 
         assertEquals("Handler name should be the file name", "logo.jpeg", handler.getName());
 

Modified: camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentTest.java?rev=1463544&r1=1463543&r2=1463544&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentTest.java
(original)
+++ camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentTest.java
Tue Apr  2 13:46:37 2013
@@ -80,11 +80,10 @@ public class MailAttachmentTest extends 
         DataHandler handler = out.getIn().getAttachment("logo.jpeg");
         assertNotNull("The logo should be there", handler);
 
-        if (isJava16()) {
-            assertEquals("image/jpeg; name=logo.jpeg", handler.getContentType());
-        } else {
-            assertEquals("application/octet-stream; name=logo.jpeg", handler.getContentType());
-        }
+        // content type should match
+        boolean match1 = "image/jpeg; name=logo.jpeg".equals(handler.getContentType());
+        boolean match2 = "application/octet-stream; name=logo.jpeg".equals(handler.getContentType());
+        assertTrue("Should match 1 or 2", match1 || match2);
 
         assertEquals("Handler name should be the file name", "logo.jpeg", handler.getName());
 

Modified: camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentsUmlautIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentsUmlautIssueTest.java?rev=1463544&r1=1463543&r2=1463544&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentsUmlautIssueTest.java
(original)
+++ camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentsUmlautIssueTest.java
Tue Apr  2 13:46:37 2013
@@ -78,11 +78,10 @@ public class MailAttachmentsUmlautIssueT
         DataHandler handler = out.getIn().getAttachment(name);
         assertNotNull("The " + name + " should be there", handler);
 
-        if (isJava16()) {
-            assertEquals("image/jpeg; name=\"" + name + "\"", handler.getContentType());
-        } else {
-            assertEquals("application/octet-stream; name=\"" + name + "\"", handler.getContentType());
-        }
+        // content type should match
+        boolean match1 = ("image/jpeg; name=\"" + name + "\"").equals(handler.getContentType());
+        boolean match2 = ("application/octet-stream; name=\"" + name + "\"").equals(handler.getContentType());
+        assertTrue("Should match 1 or 2", match1 || match2);
 
         assertEquals("Handler name should be the file name", name, handler.getName());
 

Modified: camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailHtmlAttachmentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailHtmlAttachmentTest.java?rev=1463544&r1=1463543&r2=1463544&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailHtmlAttachmentTest.java
(original)
+++ camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailHtmlAttachmentTest.java
Tue Apr  2 13:46:37 2013
@@ -84,11 +84,9 @@ public class MailHtmlAttachmentTest exte
         assertTrue("logo should be more than 1000 bytes", bytes.length > 1000);
 
         // content type should match
-        if (isJava16()) {
-            assertEquals("image/jpeg; name=logo.jpeg", handler.getContentType());
-        } else {
-            assertEquals("application/octet-stream; name=logo.jpeg", handler.getContentType());
-        }
+        boolean match1 = "image/jpeg; name=logo.jpeg".equals(handler.getContentType());
+        boolean match2 = "application/octet-stream; name=logo.jpeg".equals(handler.getContentType());
+        assertTrue("Should match 1 or 2", match1 || match2);
 
         // save logo for visual inspection
         template.sendBodyAndHeader("file://target", bytes, Exchange.FILE_NAME, "maillogo.jpg");



Mime
View raw message