How to start stop embedding Tomcat correctly?

2011-07-01 Thread Rehtron
Dear all, I use org.apache.catalina.startup.Tomcat to do unit test, but the instance of which cannot be started or stopped correctly. I start and stop embedding tomcat for each test case, but first test can be passed, the second one will be failed by 503 Service, unavailable, the

Re: How to start stop embedding Tomcat correctly?

2011-07-01 Thread Mark Thomas
On 01/07/2011 10:07, Rehtron wrote: Dear all, I use org.apache.catalina.startup.Tomcat to do unit test, but the instance of which cannot be started or stopped correctly. I start and stop embedding tomcat for each test case, but first test can be passed, the second one will be failed by

Re: How to start stop embedding Tomcat correctly?

2011-07-01 Thread Rehtron
Yes, I use same port for all test, but I think the port should be release after tomcat stopped. thanks. 2011/7/1 Mark Thomas ma...@apache.org On 01/07/2011 10:07, Rehtron wrote: Dear all, I use org.apache.catalina.startup.Tomcat to do unit test, but the instance of which cannot be

Re: How to start stop embedding Tomcat correctly?

2011-07-01 Thread Mark Thomas
On 01/07/2011 10:29, Rehtron wrote: Yes, I use same port for all test, but I think the port should be release after tomcat stopped. What OS are you using? Mark thanks. 2011/7/1 Mark Thomas ma...@apache.org On 01/07/2011 10:07, Rehtron wrote: Dear all, I use

Re: How to start stop embedding Tomcat correctly?

2011-07-01 Thread Rehtron
Windows XP, did you mean I should use different port for every test? Thanks. 2011/7/1 Mark Thomas ma...@apache.org On 01/07/2011 10:29, Rehtron wrote: Yes, I use same port for all test, but I think the port should be release after tomcat stopped. What OS are you using? Mark

Re: How to start stop embedding Tomcat correctly?

2011-07-01 Thread Mark Thomas
On 01/07/2011 10:56, Rehtron wrote: Windows XP, did you mean I should use different port for every test? I have seen all OSes hold on to ports after Tomcat has shutdown. Windows isn't as bad as Linux but it does happen sometimes. Yes, you need to use a new port for each test. Again, take a look

Re: How to start stop embedding Tomcat correctly?

2011-07-01 Thread Rehtron
OK, thank you very much for your help! 2011/7/1 Mark Thomas ma...@apache.org On 01/07/2011 10:56, Rehtron wrote: Windows XP, did you mean I should use different port for every test? I have seen all OSes hold on to ports after Tomcat has shutdown. Windows isn't as bad as Linux but it does