tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Testing session time-out behaviour
Date Thu, 15 Aug 2002 19:07:13 GMT


I have a web app with some specific requirements for session timeout.  I
would like to write automated acceptance tests to verify these
requirements, and am faced with some options:

- set web.xml to time-out in 1 minute, have my tests wait for just over a
minute to force time-out
- talk to my server (tomcat during testing) from the test client code
(junit tests using httpunit) to somehow request it to time out
- execute the shutdown / startup commands from the client code (session
information for tomcat 4.0 goes away when i do this).  I have a small app,
so startup shutdown are both relatively quick (seconds).

Waiting a minute is a pain, because I have to change web.xml and reset it,
also because I have a lot of screens and behaviours to test (hence the
desire to automate), so even setting down to a minute I expect it would
take my automated test suite from what is now about 5 minutes to run to
about 30 minutes.

As far as communicating with tomcat goes, I tried doing a get on the
manager urls to reload the app, also to stop followed by start - but this
does not appear to cause it to lose the session information.

As far as executing startup / shutdown batch files, the rub is waiting on
the shutdown and startup to complete before proceeding with the test.  It
is proving to be extremely tricky to do.

So, from a java test client, is there a supported and relatively easy way
for me to get tomcat to drop a session in the middle of a test?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message