camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r652253 - in /activemq/camel/trunk/components/camel-mail/src: main/java/org/apache/camel/component/mail/MailConverters.java test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java
Date Wed, 30 Apr 2008 04:10:12 GMT
Author: davsclaus
Date: Tue Apr 29 21:10:12 2008
New Revision: 652253

URL: http://svn.apache.org/viewvc?rev=652253&view=rev
Log:
CAMEL-335
- fixed TODO in unit test.
- javadoc polished

Modified:
    activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConverters.java
    activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java

Modified: activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConverters.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConverters.java?rev=652253&r1=652252&r2=652253&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConverters.java
(original)
+++ activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConverters.java
Tue Apr 29 21:10:12 2008
@@ -27,17 +27,16 @@
 import org.apache.camel.Converter;
 
 /**
+ * JavaMail specific converters.
+ *
  * @version $Revision$
  */
 @Converter
 public class MailConverters {
+
     /**
-     * Converts the given JavaMail message to a String body
-     *
-     * @param message the message
-     * @return the String content
-     * @throws MessagingException
-     * @throws IOException
+     * Converts the given JavaMail message to a String body.
+     * Can return null.
      */
     @Converter
     public String toString(Message message) throws MessagingException, IOException {
@@ -55,6 +54,10 @@
         return null;
     }
 
+    /**
+     * Converts the given JavaMail multipart to a String body, where the contenttype of the
multipart
+     * must be text based (ie start with text). Can return null.
+     */
     @Converter
     public static String toString(Multipart multipart) throws MessagingException, IOException
{
         int size = multipart.getCount();

Modified: activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java?rev=652253&r1=652252&r2=652253&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java
(original)
+++ activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java
Tue Apr 29 21:10:12 2008
@@ -35,15 +35,9 @@
 
         sendBody("direct:a", "Message 3");
 
-        // let Camel have time to consume and process the mailbox
-        Thread.sleep(1000);
-
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
-        // TODO: below fails for Mail component, maybe a converter is missing
-        //mock.expectedBodiesReceived("Message 3");
-        String body = mock.assertExchangeReceived(0).getIn().getBody(String.class);
-        assertEquals("Message 3", body);
+        mock.expectedBodiesReceived("Message 3");
         mock.assertIsSatisfied();
     }
 
@@ -68,7 +62,6 @@
         folder.close(true);
     }
 
-
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
@@ -84,5 +77,4 @@
         };
     }
 
-
 }



Mime
View raw message