commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (EMAIL-115) Need a way to remove emails from an already created, but not sent message.
Date Tue, 28 Feb 2012 15:35:46 GMT

    [ https://issues.apache.org/jira/browse/EMAIL-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13218277#comment-13218277
] 

Thomas Neidhart commented on EMAIL-115:
---------------------------------------

just my2c, but wouldn't it be better to set up a fake mail server in your test environment
and check if the mail was sent through it as a valid unit test?
Take a look at the unit tests for commons-email itself, which actually does exactly this.

ref: BaseEmailTestCase, SendWithAttachmentsTest
                
> Need a way to remove emails from an already created, but not sent message.
> --------------------------------------------------------------------------
>
>                 Key: EMAIL-115
>                 URL: https://issues.apache.org/jira/browse/EMAIL-115
>             Project: Commons Email
>          Issue Type: Improvement
>    Affects Versions: 1.2
>            Reporter: Brian Telintelo
>            Priority: Blocker
>             Fix For: 2.0
>
>
> Ok, so we have one send email method which takes org.apache.commons.mail.Email param.
 It then checks to see if email sending is enabled(configured by server instance), then sends
the mail if it is.  Problem happens for our QA testing.  We need to test email content, but
don't want to send emails to actual users in QA environment.  What we want to do is modify
our "one" send email method and clear out the To,CC,BCC fields and then set the TO field to
be our testing list.  But, there is no way to remove emails already added.  Setting it to
null or empty collection results in an EmailException.  And we can't create a new email instance
and copy because there is no get message accessor available.  We need a way to remove emails....somehow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message