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 Norman Maurer <nm...@byteaction.de> on 2006/06/10 13:12:57 UTC

Mail interface

Hi guys,

i just wonder if there is any reason why the mail interface not provide
a method to set the sender of an email. Like "setSender(MailAddress
sender)".. 

I ask this cause i notice it while working on junit tests for SenderIs..

bye
Norman


Re: Mail interface

Posted by Stefano Bagnara <ap...@bago.org>.
Norman Maurer wrote:
> Hi guys,
> 
> i just wonder if there is any reason why the mail interface not provide
> a method to set the sender of an email. Like "setSender(MailAddress
> sender)".. 
> 
> I ask this cause i notice it while working on junit tests for SenderIs..

Can I ask why do you need a setSender method in the Mail interface?

If you're creating a test for SenderIs then you create the Mail object, 
so you can create it using the implementation that you prefer.

Probably you simply have to add a constructor to the "MockMail" object 
with the sender, or add a setSender(MailAddress sender) to the MockMail 
object.

Stefano


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


Re: Mail interface

Posted by Stefano Bagnara <ap...@bago.org>.
Norman Maurer wrote:
>> Probably you simply have to add a constructor to the "MockMail" object 
>> with the sender, or add a setSender(MailAddress sender) to the MockMail 
>> object.
>>
>> Stefano
> 
> This is exactly what i did.. I was just intressted why there is not such
> method..

Maybe because no one needed it and it is always better to not add 
methods to interfaces if there is no real need ;-)

Stefano


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


Re: Mail interface

Posted by Norman Maurer <nm...@byteaction.de>.
Am Samstag, den 10.06.2006, 15:05 +0200 schrieb Stefano Bagnara:
> Norman Maurer wrote:
> > Hi guys,
> > 
> > i just wonder if there is any reason why the mail interface not provide
> > a method to set the sender of an email. Like "setSender(MailAddress
> > sender)".. 
> > 
> > I ask this cause i notice it while working on junit tests for SenderIs..
> 
> Can I ask why do you need a setSender method in the Mail interface?
> 
> If you're creating a test for SenderIs then you create the Mail object, 
> so you can create it using the implementation that you prefer.
> 
> Probably you simply have to add a constructor to the "MockMail" object 
> with the sender, or add a setSender(MailAddress sender) to the MockMail 
> object.
> 
> Stefano

This is exactly what i did.. I was just intressted why there is not such
method..


bye
Norman