camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r761182 - in /camel/trunk/components/camel-mail/src: main/java/org/apache/camel/component/mail/ test/java/org/apache/camel/component/mail/
Date Thu, 02 Apr 2009 06:50:58 GMT
Author: davsclaus
Date: Thu Apr  2 06:50:57 2009
New Revision: 761182

URL: http://svn.apache.org/viewvc?rev=761182&view=rev
Log:
CAMEL-1507: Header key using the CamelXXX syntax.

Modified:
    camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
    camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java
    camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MimeMultipartAlternativeTest.java

Modified: camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java?rev=761182&r1=761181&r2=761182&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
(original)
+++ camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
Thu Apr  2 06:50:57 2009
@@ -44,18 +44,18 @@
     private String password;
     private Session session;
     private String defaultEncoding;
-    private String from = MailConstants.DEFAULT_FROM;
-    private String folderName = MailConstants.DEFAULT_FOLDER_NAME;
+    private String from = MailConstants.MAIL_DEFAULT_FROM;
+    private String folderName = MailConstants.MAIL_DEFAULT_FOLDER;
     private boolean delete;
     private boolean unseen = true;
     private boolean ignoreUriScheme;
     private Map<Message.RecipientType, String> recipients = new HashMap<Message.RecipientType,
String>();
     private int fetchSize = -1;
     private boolean debugMode;
-    private long connectionTimeout = MailConstants.DEFAULT_CONNECTION_TIMEOUT;
+    private long connectionTimeout = MailConstants.MAIL_DEFAULT_CONNECTION_TIMEOUT;
     private boolean dummyTrustManager;
     private String contentType = "text/plain";
-    private String alternateBodyHeader = MailConstants.DEFAULT_ALTERNATE_BODY_HEADER;
+    private String alternateBodyHeader = MailConstants.MAIL_ALTERNATIVE_BODY;
     private boolean useInlineAttachments;
 
     public MailConfiguration() {

Modified: camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java?rev=761182&r1=761181&r2=761182&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java
(original)
+++ camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConstants.java
Thu Apr  2 06:50:57 2009
@@ -18,11 +18,12 @@
 package org.apache.camel.component.mail;
 
 public final class MailConstants {
-    public static final String DEFAULT_ALTERNATE_BODY_HEADER = "mailAlternateBody";
-    public static final String DEFAULT_FOLDER_NAME = "INBOX";
-    public static final String DEFAULT_FROM = "camel@localhost";    
-    public static final long DEFAULT_CONNECTION_TIMEOUT = 30000L;
-    
+
+    public static final String MAIL_ALTERNATIVE_BODY = "CamelMailAlternativeBody";
+    public static final String MAIL_DEFAULT_FOLDER = "INBOX";
+    public static final String MAIL_DEFAULT_FROM = "camel@localhost";
+    public static final long MAIL_DEFAULT_CONNECTION_TIMEOUT = 30000L;
+
     private MailConstants() {
         // utility class
     }

Modified: camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MimeMultipartAlternativeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MimeMultipartAlternativeTest.java?rev=761182&r1=761181&r2=761182&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MimeMultipartAlternativeTest.java
(original)
+++ camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MimeMultipartAlternativeTest.java
Thu Apr  2 06:50:57 2009
@@ -29,6 +29,7 @@
 import org.apache.camel.Producer;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import static org.apache.camel.component.mail.MailConstants.MAIL_ALTERNATIVE_BODY;
 
 
 public class MimeMultipartAlternativeTest extends ContextTestSupport {
@@ -39,13 +40,13 @@
      // create an exchange with a normal body and attachment to be produced as email
         MailEndpoint endpoint = context.getEndpoint("smtp://ryan@mymailserver.com?password=secret",
MailEndpoint.class);
         endpoint.getConfiguration().setUseInlineAttachments(useInlineattachments);
-        endpoint.getConfiguration().setAlternateBodyHeader(MailConstants.DEFAULT_ALTERNATE_BODY_HEADER);
+        endpoint.getConfiguration().setAlternateBodyHeader(MailConstants.MAIL_ALTERNATIVE_BODY);
 
         // create the exchange with the mail message that is multipart with a file and a
Hello World text/plain message.
         Exchange exchange = endpoint.createExchange();
         Message in = exchange.getIn();
         in.setBody(htmlBody);
-        in.setHeader("mailAlternateBody", alternativeBody);
+        in.setHeader(MAIL_ALTERNATIVE_BODY, alternativeBody);
         in.addAttachment("cid:0001", new DataHandler(new FileDataSource("src/test/data/logo.jpeg")));
 
         // create a producer that can produce the exchange (= send the mail)



Mime
View raw message