View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.email.transformers;
8   
9   import org.mule.config.i18n.LocaleMessageHandler;
10  
11  import java.util.Locale;
12  
13  import javax.mail.MessagingException;
14  import javax.mail.internet.InternetAddress;
15  import javax.mail.internet.MimeMessage;
16  
17  public class Rfc822ByteArrayNonAsciiTestCase extends Rfc822ByteArrayTestCase 
18  {
19      @Override
20      protected MimeMessage newMimeMessage() throws MessagingException
21      {
22          MimeMessage message = new MimeMessage(newSession());
23          String text = LocaleMessageHandler.getString("test-data", Locale.JAPAN, 
24              "Rfc822ByteArrayNonAsciiTestCase.newMimeMessage", new Object[] {});
25          message.setText(text, "iso-2022-jp");
26          message.setSubject(text, "iso-2022-jp");
27          message.setFrom(new InternetAddress("bob@example.com"));
28          return message;
29      }
30  }