You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gajo Csaba <cs...@cosylab.com> on 2010/07/13 14:48:08 UTC
JUnit test fails with Javamail
Hello,
I wrote a simple JUnit 4 test. It just sends a plain email with
JavaMail. When I run this test class from Eclipse, it passes without
problems. However, when I run it with mvn test, the test will fail.
Here is part of the stack trace:
DEBUG SMTP: trying to connect to host "mail.website.com", port 465,
isSSL false
java.lang.AssertionError
at
com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1578)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
at
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
at javax.mail.Service.connect(Service.java:248)
at javax.mail.Service.connect(Service.java:105)
By following the stack trace, I saw that in SMTPTransport.java:1578
there is the following line:
assert Thread.holdsLock(this);
This is why it fails. Any idea how to run Maven so that this doesn't fail?
Thanks, Csaba
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org