commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <thomas.neidh...@gmail.com>
Subject Re: [VOTE] Release of Commons Email 1.3.2 based on RC1
Date Wed, 16 Oct 2013 21:47:48 GMT
On 10/16/2013 07:39 PM, Siegfried Goeschl wrote:
> Hi Thomas,
> 
> I have issue when builing on the command line -
> 
>> mvn clean install
> 
> Oct 16, 2013 10:39:02 AM org.subethamail.smtp.server.ServerThread run
> INFO: SMTP server *:2510 stopped
> emailMessage
> ===================================================================
> Received: from 172.22.120.122 (localhost [127.0.0.1])
>         by 172.22.120.122
>         with SMTP (SubEthaSMTP 3.1.7) id HMUB60OT
>         for test_to@apache.org;
>         Wed, 16 Oct 2013 10:39:02 +0200 (CEST)
> Date: Wed, 16 Oct 2013 10:39:02 +0200 (CEST)
> From: test_from@apache.org
> To: test_to@apache.org
> Message-ID: <429777281.42.1381912742908.JavaMail.sgoeschl@district9.local>
> Subject: Test Msg Subject
> MIME-Version: 1.0
> Content-Type: text/plain; charset=utf-8
> Content-Transfer-Encoding: base64
> 
> VGVzdCBNc2cgQm9keSDDo8KCwrAgw6PCgsKxIMOjwoLCsiDDo8KCwrMgw6PCgsK0
>  - 578
> strMessage
> ===================================================================
> strMessage - 33
> Test Msg Body ??? ??? ??? ??? ???
> Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.021
> sec <<< FAILURE! - in org.apache.commons.mail.SimpleEmailTest
> testDefaultMimeCharset(org.apache.commons.mail.SimpleEmailTest) Time
> elapsed: 0.012 sec  <<< FAILURE!
> java.lang.AssertionError: didn't find expected message content in
> message body
>     at org.junit.Assert.fail(Assert.java:88)
>     at org.junit.Assert.assertTrue(Assert.java:41)
>     at
> org.apache.commons.mail.AbstractEmailTest.validateSend(AbstractEmailTest.java:395)
> 
>     at
> org.apache.commons.mail.SimpleEmailTest.testDefaultMimeCharset(SimpleEmailTest.java:155)
> 
> 
> Running org.apache.commons.mail.util.MimeMessageParserTest
> Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.029
> sec - in org.apache.commons.mail.util.MimeMessageParserTest
> 
> Results :
> 
> Failed tests:
> SimpleEmailTest.testDefaultMimeCharset:155->AbstractEmailTest.validateSend:395
> didn't find expected message content in message body
> 
> Tests run: 169, Failures: 1, Errors: 0, Skipped: 0
> 
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 13.110s
> [INFO] Finished at: Wed Oct 16 10:39:02 CEST 2013
> [INFO] Final Memory: 12M/81M
> 
> Some thoughts along the line
> 
> * this problem does  not occur in IntellJ with JDK 1.6 / 1.7
> * I'm running Mac OS X java version "1.6.0_31", Java(TM) SE Runtime
> Environment (build 1.6.0_31-b04-415-12D78), Java HotSpot(TM) 64-Bit
> Server VM (build 20.6-b01-415, mixed mode)
> * I think the email message is the error case still Base64 decoded
> * It would be safer to use Unicode Escape Sequences instead of UTF-8
> message string since you have ASCII code only

Thanks for the output, I was hesitating to include this unit test, but I
did not have a better idea to test the charset setting.

There seems to be some kind of randomness in javamail to select the
encoding based on the charset. In my environment I get either
quoted-printable or 7zip, but in another test-case (which I changed
afterwards), the encoding was also base64 when running in eclipse, and
quoted-printable when running the same test from the command-line.

The test itself tries to do the following:

 * send a message with unicode characters using the utf-8 charset from
the system property "mail.mime.charset"
 * read back the message and compare the text with the one that was send

this obviously does not work when base64 encoding is used, as the
message is not decoded when comparing.

As a conclusion, I will rework the test-case ;-).

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message