You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/04/01 18:25:37 UTC

svn commit: r760950 - in /camel/trunk/components/camel-mail/src: main/java/org/apache/camel/component/mail/MailConfiguration.java test/java/org/apache/camel/component/mail/MimeMultipartAlternativeTest.java

Author: ningjiang
Date: Wed Apr  1 16:25:36 2009
New Revision: 760950

URL: http://svn.apache.org/viewvc?rev=760950&view=rev
Log:
CAMEL-1507 Moved the header constant to MailConstants as Claus suggested

Modified:
    camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.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=760950&r1=760949&r2=760950&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 Wed Apr  1 16:25:36 2009
@@ -33,12 +33,7 @@
  *
  * @version $Revision$
  */
-public class MailConfiguration implements Cloneable {
-
-    public static final String DEFAULT_FOLDER_NAME = "INBOX";
-    public static final String DEFAULT_FROM = "camel@localhost";
-    public static final String DEFAULT_ALTERNATE_BODY_HEADER = "mail_alternateBody";
-    public static final long DEFAULT_CONNECTION_TIMEOUT = 30000L;
+public class MailConfiguration implements Cloneable {   
 
     private Properties javaMailProperties;
     private Properties additionalJavaMailProperties;
@@ -49,18 +44,18 @@
     private String password;
     private Session session;
     private String defaultEncoding;
-    private String from = DEFAULT_FROM;
-    private String folderName = DEFAULT_FOLDER_NAME;
+    private String from = MailConstants.DEFAULT_FROM;
+    private String folderName = MailConstants.DEFAULT_FOLDER_NAME;
     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 = DEFAULT_CONNECTION_TIMEOUT;
+    private long connectionTimeout = MailConstants.DEFAULT_CONNECTION_TIMEOUT;
     private boolean dummyTrustManager;
     private String contentType = "text/plain";
-    private String alternateBodyHeader = DEFAULT_ALTERNATE_BODY_HEADER;
+    private String alternateBodyHeader = MailConstants.DEFAULT_ALTERNATE_BODY_HEADER;
     private boolean useInlineAttachments;
 
     public MailConfiguration() {

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=760950&r1=760949&r2=760950&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 Wed Apr  1 16:25:36 2009
@@ -39,13 +39,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(MailConfiguration.DEFAULT_ALTERNATE_BODY_HEADER);
+        endpoint.getConfiguration().setAlternateBodyHeader(MailConstants.DEFAULT_ALTERNATE_BODY_HEADER);
 
         // 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("mail_alternateBody", alternativeBody);
+        in.setHeader("mailAlternateBody", 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)