You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2013/10/20 18:24:39 UTC
svn commit: r1533924 -
/commons/proper/email/trunk/src/test/java/org/apache/commons/mail/SimpleEmailTest.java
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);
}