You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by sg...@apache.org on 2010/10/25 23:50:21 UTC
svn commit: r1027281 -
/commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailLiveTest.java
Author: sgoeschl
Date: Mon Oct 25 21:50:21 2010
New Revision: 1027281
URL: http://svn.apache.org/viewvc?rev=1027281&view=rev
Log:
Avoid fetching remote HTML content if this is not a live test
Modified:
commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailLiveTest.java
Modified: commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailLiveTest.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailLiveTest.java?rev=1027281&r1=1027280&r2=1027281&view=diff
==============================================================================
--- commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailLiveTest.java (original)
+++ commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailLiveTest.java Mon Oct 25 21:50:21 2010
@@ -222,8 +222,8 @@ public class EmailLiveTest extends BaseE
*
* @throws Exception the test failed
*/
- public void testImageHtmlEmailLocal() throws Exception {
-
+ public void testImageHtmlEmailLocal() throws Exception
+ {
// use a simple HTML page with one image - please note that the Apache logo
// is defined in CSS and not in HTML.
@@ -242,15 +242,18 @@ public class EmailLiveTest extends BaseE
*
* @throws Exception the test failed
*/
- public void testImageHtmlEmailRemote() throws Exception {
-
- URL url = new URL("http://www.theserverside.com");
- String htmlMsg = getFromUrl(url);
-
- ImageHtmlEmail email = (ImageHtmlEmail) create(ImageHtmlEmail.class);
- email.setSubject("[testImageHtmlEmail] 2.Test: complex html content");
- email.setHtmlMsg(htmlMsg, url, true);
+ public void testImageHtmlEmailRemote() throws Exception
+ {
+ if(EmailConfiguration.MAIL_FORCE_SEND)
+ {
+ URL url = new URL("http://www.theserverside.com");
+ String htmlMsg = getFromUrl(url);
+
+ ImageHtmlEmail email = (ImageHtmlEmail) create(ImageHtmlEmail.class);
+ email.setSubject("[testImageHtmlEmail] 2.Test: complex html content");
+ email.setHtmlMsg(htmlMsg, url, true);
- EmailUtils.writeMimeMessage( new File("./target/test-emails/testImageHtmlEmailRemote.eml"), send(email).getMimeMessage());
+ EmailUtils.writeMimeMessage( new File("./target/test-emails/testImageHtmlEmailRemote.eml"), send(email).getMimeMessage());
+ }
}
}
\ No newline at end of file