Hi Himasha,

I tested above scenario with the current implementation and it worked.

1) Started green mail server
2) Created user to receive mail
3) Created proxy service to send out mails
4) Once request is  sent to proxy it send a mail to greenmail server
5) you can retrieve it

EmailServerUtil emailServerUtil;
emailServerUtil = new EmailServerUtil();
emailServerUtil.startMailServer();

emailServerUtil.createUser("to@localhost", "to", "to123");


int count = emailServerUtil.getReceivedMessages().length;



Please try this with your test case and let us know.


Thanks,


On Mon, Apr 20, 2015 at 1:31 PM, Himasha Guruge <[email protected]> wrote:

>
>
> Thanks for  the quick reply Waruna.
>
> On Mon, Apr 20, 2015 at 1:18 PM, Himasha Guruge <[email protected]> wrote:
>
>> [Looping Nandika]
>>
>> On Mon, Apr 20, 2015 at 1:15 PM, Waruna Perera <[email protected]> wrote:
>>
>>> Hi Himasha,
>>>
>>> You can not achieve the functionality that you are looking for with
>>> GreanMail utility. If you want to receive mails you have to send mail
>>> first. Will further look through API if there is any possibility to provide
>>> what you have requested.
>>>
>>> Thanks,
>>>
>>> On Mon, Apr 20, 2015 at 1:04 PM, Himasha Guruge <[email protected]>
>>> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I'm in the process of writing an integration test which will test the
>>>> email notification feature implementation of BPS. Therefore I have set up
>>>> the GreenMail server with a user registered, to receive the emails, but the
>>>> email count is always 0.
>>>>
>>>> When looking into methods provided by GreenMailUtil, it is noticed that
>>>> to send an email ,GreenMailUtil.sendTextEmail() method is used. For this
>>>> scenario, the email sending process will occur within the implementation.
>>>> Therefore is it possible for the mail messages to be sent through feature
>>>> implementation (without using above method) and just to receive the sent
>>>> emails through GreenMail ? Following are the steps I have followed so far.
>>>>
>>>> 1. Start GreenMail server
>>>> 2. Set a new user to created server
>>>> 3. Add axis2-client mailto configuration (same port as GreenMail server)
>>>> 4. Use  method server.getReceivedMessages() to retrieve the emails.
>>>>
>>>> If this approach is not valid, any other suggestions on this will be
>>>> appreciated.
>>>>
>>>> Thanks & Regards,
>>>>
>>>> Himasha Guruge
>>>> *Software Engineer*
>>>> WS*O2* *Inc.*
>>>> Mobile: +94 777459299
>>>> [email protected]
>>>>
>>>
>>>
>>>
>>> --
>>> Waruna Perera
>>> Senior Software Engineer - Test Automation
>>> Mobile: +94 77 3867037
>>> WSO2, Inc.; http://wso2.com/
>>> lean . enterprise . middlewear.
>>>
>>
>>
>>
>> --
>> Himasha Guruge
>> *Software Engineer*
>> WS*O2* *Inc.*
>> Mobile: +94 777459299
>> [email protected]
>>
>
>
>
> --
> Himasha Guruge
> *Software Engineer*
> WS*O2* *Inc.*
> Mobile: +94 777459299
> [email protected]
>



-- 
Waruna Perera
Senior Software Engineer - Test Automation
Mobile: +94 77 3867037
WSO2, Inc.; http://wso2.com/
lean . enterprise . middlewear.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to