commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dion Gillard <dion.gill...@gmail.com>
Subject Re: svn commit: r201739 - /jakarta/commons/proper/email/trunk/project.xml
Date Tue, 28 Jun 2005 15:50:34 GMT
On 6/29/05, Ramiro Pereira de Magalhaes <rpm_mailbox@yahoo.com.br> wrote:
> Yes, I meant these timeout checks. Since commons-email uses dumbster 1.6
> this change should work fine.
> 
> If a bad port number is given then the ServerSocket class used in
> dumbster's main loop will throw a IOException informing what went wrong.

Yes, but the finally block in run() will call notifyAll() and return
the server object from the SimpleSmtpServer.start(port) method, right?


> ServerSocket is used in SimpleSmtpServer.run() method. You can read it here:
> http://cvs.sourceforge.net/viewcvs.py/dumbster/dumbster/src/com/dumbster/smtp/SimpleSmtpServer.java?diff_format=l&rev=1.8&view=auto

run() isn't called directly from start(port), instead a Thread is
created and started. The started thread calls run(), and hence the
method that calls start(port) will never see the IOException.

True?
> You can read more about the ServerSocket(int) constructor here:
> http://java.sun.com/j2se/1.5.0/docs/api/java/net/ServerSocket.html#ServerSocket(int)
> 
> Ramiro Pereira de Magalhães
> 
> 
> Dion Gillard wrote:
> 
> >What if Dumbster gets given a bad port number by commons email?
> >
> >Did you just mean the timeout checks?
> >
> >If so, can we just replace:
> >            this.fakeMailServer =
> >                SimpleSmtpServer.start(EmailConfiguration.MAIL_SERVER_PORT);
> >
> >            Date dtStartWait = new Date();
> >            while (this.fakeMailServer.isStopped())
> >            {
> >                // test for connected
> >                if (this.fakeMailServer != null
> >                    && !this.fakeMailServer.isStopped())
> >                {
> >                    break;
> >                }
> >
> >                // test for timeout
> >                if ((dtStartWait.getTime() + EmailConfiguration.TIME_OUT)
> >                    <= new Date().getTime())
> >                {
> >                    fail("Mail server failed to start");
> >                }
> >            }
> >
> >with:
> >            this.fakeMailServer =
> >                SimpleSmtpServer.start(EmailConfiguration.MAIL_SERVER_PORT);
> >             if (this.fakeMailServer.isStopped())  fail("Mail server
> >failed to start");
> >
> >?
> >
> >On 6/27/05, Ramiro Pereira de Magalhaes <rpm_mailbox@yahoo.com.br> wrote:
> >
> >
> >>Ramiro Pereira de Magalhaes wrote:
> >>
> >>
> >>
> >>>dion@apache.org wrote:
> >>>
> >>>
> >>>
> >>>>Author: dion
> >>>>Date: Sat Jun 25 04:48:51 2005
> >>>>New Revision: 201739
> >>>>
> >>>>URL: http://svn.apache.org/viewcvs?rev=201739&view=rev
> >>>>Log:
> >>>>Move to dumbster 1.6 for testing:
> >>>>- jdk13 compatible
> >>>>- faster
> >>>>- still works for us
> >>>>
> >>>>Modified:
> >>>>   jakarta/commons/proper/email/trunk/project.xml
> >>>>
> >>>>Modified: jakarta/commons/proper/email/trunk/project.xml
> >>>>URL:
> >>>>http://svn.apache.org/viewcvs/jakarta/commons/proper/email/trunk/project.xml?rev=201739&r1=201738&r2=201739&view=diff
> >>>>
> >>>>==============================================================================
> >>>>
> >>>>--- jakarta/commons/proper/email/trunk/project.xml (original)
> >>>>+++ jakarta/commons/proper/email/trunk/project.xml Sat Jun 25
> >>>>04:48:51 2005
> >>>>@@ -152,7 +152,7 @@
> >>>>        <dependency>
> >>>>            <groupId>dumbster</groupId>
> >>>>            <artifactId>dumbster</artifactId>
> >>>>-            <version>1.5</version>
> >>>>+            <version>1.6</version>
> >>>>            <properties/>
> >>>>        </dependency>
> >>>>    </dependencies>
> >>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>If you're using dumbster version 1.6 then check it out from CVS and
> >>>build it. There is a small but important difference between the code
> >>>on CVS and the code currently released that avoids some locks while
> >>>starting a SimpleSmtpServer. Check the difference here:
> >>>http://cvs.sourceforge.net/viewcvs.py/dumbster/dumbster/src/com/dumbster/smtp/SimpleSmtpServer.java?r1=1.7&r2=1.8
> >>>
> >>>
> >>>Ramiro Pereira de Magalhães
> >>>
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>I forgot to say that the getMailServer() method on BaseEmailTestCase
> >>class performs unnecessary checks in order to be sure that dumbster mail
> >>server's up. Dumbster itself takes care of it.
> >>
> >>Ramiro Pereira de Magalhães
> >>
> >>
> >>
> >>
> >>_______________________________________________________
> >>Yahoo! Acesso Gr�tis - Internet r�pida e gr�tis.
> >>Instale o discador agora! http://br.acesso.yahoo.com/
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> 
> 
> 
> 
> 
> _______________________________________________________
> Yahoo! Acesso Gr�tis - Internet r�pida e gr�tis.
> Instale o discador agora! http://br.acesso.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 


-- 
http://www.multitask.com.au/people/dion/
"You are going to let the fear of poverty govern your life and your
reward will be that you will eat, but you will not live." - George
Bernard Shaw
Mime
View raw message