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

Robert Munteanu commented on SLING-6949:
----------------------------------------

[~olli] - this is about HTTP-based tests, where Sling would run in a different 
process. The tests would run and instantiate a mock SMTP server on localhost.

In scenario A - without containers -  Sling would be running on localhost and 
then would be able to connect to the SMTP server on localhost.
In scenario B - with containers - Sling would be be running inside a container 
and unable to connect to the SMTP server on localhost. I've done some research 
and there isn't an unified way to get this done on Linux and Mac, and even then 
you'd have to ensure that firewall rules don't get in the way.

Which lead to my proposal of deploying the Mock SMTP server on Sling, to make 
sure it's always accessible from both Sling and the unit test.

> Create testing utilities for email-enabled applications
> -------------------------------------------------------
>
>                 Key: SLING-6949
>                 URL: https://issues.apache.org/jira/browse/SLING-6949
>             Project: Sling
>          Issue Type: New Feature
>          Components: Testing
>            Reporter: Robert Munteanu
>            Assignee: Robert Munteanu
>
> When working with email-enabled applications it is sometimes desirable to 
> interact with the emails send by the applications, either by verifying the 
> contents of the emails or just validating that a certain email is sent.
> A good solution for this is 
> [Wiser|https://github.com/voodoodyne/subethasmtp/blob/master/Wiser.md], which 
> works quite well.
> One scenario where this does not apply is when the application under test is 
> running as a container, and it cannot access the host application to deliver 
> emails to the Wiser instance.
> To have an unitary approach I propose that we create an OSGi bundle which 
> wraps Wiser and starts in the Sling application. The messages received by 
> Wiser can then be read using an HTTP API.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to