jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: Keeping the same session
Date Sun, 15 Dec 2002 10:42:25 GMT
Hi Roger,

Have a look at http://jakarta.apache.org//cactus/faq.html#faq4

In short, Cactus is a unit testing tool and a best practice is to keep
each test independent of the others. Thus the real nice way of doing
what you want is to write a setUp() method that logs your user in by
setting whatever is needed in the HTTP session for example. setUp() will
be executed on the server side before each test.

Of course, if you also want to write a test for unit testing your login
use case, you should write it in a different test case class (ideally
you should have one test case per fixture).

Now, that said, there is an option in Cactus 1.5 to keep the HTTP
session between different tests but I would not recommend it in your
case. If you really want to do that, you can check the Cactus unit test
suite in CVS which shows how to use it.


> -----Original Message-----
> From: Ball, Roger F [mailto:rfball@qwest.com]
> Sent: 10 December 2002 19:56
> To: 'cactus-user@jakarta.apache.org'
> Subject: Keeping the same session
> Howdy
> 	I am trying to run several tests on the same servlet and use the
> same session for each test. The first test performs a custom login and
> creates a session for the user. I would like to keep the same session
> the other tests that are performed. How do I keep the same session for
> tests in a suite without changing the target servlet?
> Thanks
> Roger Ball
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>

To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>

View raw message