Hi Steven,
The fact that we do nothing if the server is already started is on purpose
... :-) The ideas are :
* it takes time to start and stop servers,
* unit tests are meant to be run as soon as possible (whenever a change is
made preferably)
So you would manually start the server _once_. Then you would run the tests
as often as needed, benefitting from automatic reloading features of
application servers (WEB-INF/lib and WEB-INF/classes are reloadable
locations). Then you would manually stop the application server when you're
done. This scenario would be used all the time when in development mode.
However, when you're doing deployment (i.e. either manually or through
automated continuous integration) you would prefer to start the server every
time and stop it at the end of the tests. But the machine on which you would
run the tests would usually be a different machine from the one you use for
development, so that won't be a problem.
Thanks
-Vincent
----- Original Message -----
From: "Steven Shand" <[EMAIL PROTECTED]>
To: "Vincent Massol" <[EMAIL PROTECTED]>
Sent: Friday, September 07, 2001 11:36 AM
Subject: Re: starting tomcat to run servlet tests
> Vincent, while looking at this code it also occurred to me that when we
> do a pre-check to see if the server is already running, we do nothing if
> it is. Surely it would be better to stop and start the server if it is
> currently running. This would ensure that all new classes were loaded
> and any initialisation was done at the correct time.
>
> Let me know what you think.
>
> Steven.
>
>
>
> On Thursday, September 6, 2001, at 11:57 AM, Vincent Massol wrote:
>
> > Steven,
> >
> > This seems to be a bug in Cactus and your solution is an excellent idea
> > (we
> > should check for a 200 HTTP status code). Please come along and help
> > improve
> > Cactus. I'm waiting for your patch.
> >
> > Thanks
> > -Vincent
> >
> > ----- Original Message -----
> > From: <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, September 06, 2001 12:41 PM
> > Subject: starting tomcat to run servlet tests
> >
> >
> >> Hi, I'm new to this list and have spent a while looking through the
> >> archives for some info on this so forgive me if it's come up before.
> >>
> >> I want to use the optional task to start tomcat, run my servlet tests
> >> then stop tomcat but I've come across a problem. The code takes a url
> >> and polls that until it get's a response so it knows that tomcat is
> >> running before running tests. My problem is that I have quite a
> >> complicated initialisation servlet which takes a short while to
> >> complete
> >> but before it does, tomcat returns a 404(file not found code). This
> >> however is interpreted as a sign that tomcat is ready so ant starts to
> >> run the tests. They fail. My solution is to put a further check in the
> >> code to make sure that a 404 is not returned before continuing. I'm
> >> quite happy to do this and submit the code back in but I wanted to
> >> check
> >> that no-one else has done this or that there's not a better solution
> >> out
> >> there already.
> >>
> >> Many thanks.
> >>
> >>
> >> Steven Shand.
> >>
> >
>