Author: tn
Date: Sun Oct 20 16:24:38 2013
New Revision: 1533924

URL: http://svn.apache.org/r1533924
Log:
Fix unit test.

Modified:
    
commons/proper/email/trunk/src/test/java/org/apache/commons/mail/SimpleEmailTest.java

Modified: 
commons/proper/email/trunk/src/test/java/org/apache/commons/mail/SimpleEmailTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/email/trunk/src/test/java/org/apache/commons/mail/SimpleEmailTest.java?rev=1533924&r1=1533923&r2=1533924&view=diff
==============================================================================
--- 
commons/proper/email/trunk/src/test/java/org/apache/commons/mail/SimpleEmailTest.java
 (original)
+++ 
commons/proper/email/trunk/src/test/java/org/apache/commons/mail/SimpleEmailTest.java
 Sun Oct 20 16:24:38 2013
@@ -144,7 +144,7 @@ public class SimpleEmailTest extends Abs
         }
 
         String strSubject = "Test Msg Subject";
-        String strMessage = "Test Msg Body グ ケ ゲ コ ゴ";
+        String strMessage = "Test Msg Body ä"; // add non-ascii character, 
otherwise us-ascii will be used
 
         this.email.setSubject(strSubject);
         this.email.setMsg(strMessage);
@@ -152,15 +152,10 @@ public class SimpleEmailTest extends Abs
         this.email.send();
 
         this.fakeMailServer.stop();
-        validateSend(
-            this.fakeMailServer,
-            strSubject,
-            this.email.getMsg(),
-            this.email.getFromAddress(),
-            this.email.getToAddresses(),
-            this.email.getCcAddresses(),
-            this.email.getBccAddresses(),
-            true);
+
+        String message = getMessageAsString(0);
+        // check that the charset has been correctly set
+        assertTrue(message.contains("Content-Type: text/plain; 
charset=utf-8"));
 
         System.clearProperty(EmailConstants.MAIL_MIME_CHARSET);
     }


Reply via email to