I have a component (a class that extends Component) that I use for
my application. In my JUnit tests I start and stop the component
several times. The Component seems not to really be "stopped" after
the stop method returns. As such, the next test may fail because the
Component can't be started due to a port binding conflict.
Now, if I put a wait between the tests, everything works fine.
Is there some wait to wait for the server rundown? Stop must request
a thread to stop but I need to wait for the thread to join the current thread
before continuing with my tests.
FYI, inside my component's initialization I do:
getServers().add(Protocol.HTTP, ipAddress, port);
and then add a virtual host:
getHosts().add(host);
Do I need to do something special to ensure the server is completely stopped?
--Alex Milowski