You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Jose Alfonso Martinez <tr...@linuxcenter.com.mx> on 2003/10/18 02:14:13 UTC

Testing JavaMail

Hello,

Do you know if there is a way/software/technology for testing my servlets to see if they sent the correct emails (using javamail)????

Thanks

Jose

Re: Testing JavaMail

Posted by Colin Kilburn <co...@accesstec.ca>.
Hi Jose,

I came across this article a while back and bookmarked it, haven't tried 
it yet.  Please let us know what ends up working for you.

http://www.javaworld.com/javaworld/jw-08-2003/jw-0829-smtp.html

HTH,
Colin

Vincent Massol wrote:

>Hi Jose,
>
>2 solutions:
>
>1/ you use a real mail server during your (integration) test. For
>example, Jakarta James. The best would be an embeddable java mail server
>that you run from within your test. I don't know if there is such a
>beast.
>
>2/ you use Mock Objects to mock the javamail API
>
>Solution 2/ is by far the simplest but you'll still need functional
>tests later on to verify it really works (note that these tests can be
>manual if you don't want to spend the time to automate them).
>
>Hope it helps,
>-Vincent
>
>
>  
>
>>-----Original Message-----
>>From: Jose Alfonso Martinez [mailto:trilock@linuxcenter.com.mx]
>>Sent: 18 October 2003 02:14
>>To: cactus-user@jakarta.apache.org
>>Subject: Testing JavaMail
>>
>>Hello,
>>
>>Do you know if there is a way/software/technology for testing my
>>    
>>
>servlets
>  
>
>>to see if they sent the correct emails (using javamail)????
>>
>>Thanks
>>
>>Jose
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
>
>
>  
>


RE: Testing JavaMail

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Jose,

2 solutions:

1/ you use a real mail server during your (integration) test. For
example, Jakarta James. The best would be an embeddable java mail server
that you run from within your test. I don't know if there is such a
beast.

2/ you use Mock Objects to mock the javamail API

Solution 2/ is by far the simplest but you'll still need functional
tests later on to verify it really works (note that these tests can be
manual if you don't want to spend the time to automate them).

Hope it helps,
-Vincent


> -----Original Message-----
> From: Jose Alfonso Martinez [mailto:trilock@linuxcenter.com.mx]
> Sent: 18 October 2003 02:14
> To: cactus-user@jakarta.apache.org
> Subject: Testing JavaMail
> 
> Hello,
> 
> Do you know if there is a way/software/technology for testing my
servlets
> to see if they sent the correct emails (using javamail)????
> 
> Thanks
> 
> Jose
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org