There's a bug inside the SimpleSmtpServer.run() method.
Dumbster works fine if the ServerSocket doesn't throw
an exception but if it does, the isStopped() method
will still return false while it should return true.
I'll try to explain the bug.
SimpleSmtpServer implements the Runnable interface and
in its start(int) method a new instance of himself is
passed to the Thread's constructor. This means that
when the Thread starts it will call
SimpleSmtpServer.run() that will try to instantiate a
new ServerSocket wich may throw an IOException. The
notifyAll() is then called allowing concurrent threads
(in this case the commons-email TestCases) to run. If
any exception is thrown then it will be captured inside
the run() method, we'll see a stack trace of the
problem and the run() method is over.
The problem is: if a socket cannot be opened the the
server is not running. There is no code setting the
stopped variable to true inside any catch block.
I suggest moving the first line of
SimpleSmtpServer.run() ("stopped = false") to somewhere
after the instantiation of the ServerSocket (inside the
same method).
Ramiro Pereira de Magalhães
Nobody/Anonymous ( nobody ) - 2005-06-28 19:12
5
Open
None
Jason Kitchen
None
None
Public
|
Date: 2006-04-25 18:11 Logged In: YES |
|
Date: 2006-04-25 17:44 Logged In: YES |
|
Date: 2005-07-13 03:05 Logged In: YES |
| Field | Old Value | Date | By |
|---|---|---|---|
| assigned_to | nobody | 2005-07-13 03:05 | jasonkitchen |