You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Stefano Bagnara (JIRA)" <se...@james.apache.org> on 2008/09/27 15:53:44 UTC

[jira] Assigned: (JAMES-863) MockMimeMessage bugs

     [ https://issues.apache.org/jira/browse/JAMES-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara reassigned JAMES-863:
-------------------------------------

    Assignee: Stefano Bagnara

> MockMimeMessage bugs
> --------------------
>
>                 Key: JAMES-863
>                 URL: https://issues.apache.org/jira/browse/JAMES-863
>             Project: JAMES Server
>          Issue Type: Bug
>          Components: Matchers/Mailets (bundled)
>    Affects Versions: 2.3.1
>            Reporter: Rafael Munoz
>            Assignee: Stefano Bagnara
>            Priority: Minor
>
> I have found a pair of bugs on the  MockMimeMessage implementation when using it for my own tests. There very easy to fix and I'm including my proposal code for review.
> - MockMimeMessage has a wrong cast on the getFrom method
> ORIGINAL
>     public Address[] getFrom() throws MessagingException {
>     	return (Address[])m_fromAddresses.toArray();
>     }
> FIXED
>     public Address[] getFrom() throws MessagingException {
>     	return (Address[])m_fromAddresses.toArray(new Address[m_fromAddresses.size()]);
>     }
> - MockMimeMessage doesn't set the mimetype on the setContent method
> ORIGINAL
>     public void setContent(Object object, String mimeType) throws MessagingException {
>         m_content = object;  // trivial implementation
>     }
> FIXED
>     public void setContent(Object object, String mimeType) throws MessagingException {
>         m_content = object;  // trivial implementation
>         addHeader(RFC2822Headers.CONTENT_TYPE, mimeType);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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