jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicholas Lesiecki" <n...@eblox.com>
Subject RE: Error accessing same http session across test methods
Date Fri, 22 Nov 2002 16:42:54 GMT
No, it's as designed. Each test method gets a new session. Not only that,
but test methods are not guaranteed to operate in any sequence, so relying
on state from one method to the next is generally a bad idea.

See:
http://jakarta.apache.org/cactus/faq.html#faq4


Cheers,
Nicholas Lesiecki
Principal Software Engineer
eBlox, Inc.
(520) 615-9345 x104
Check out my book!:
Java Tools for Extreme Programming:

http://www.amazon.com/exec/obidos/ASIN/047120708X/

Check out my articles on AspectJ:
Test flexibly with AspectJ and mock objects:
http://www-106.ibm.com/developerworks/java/library/j-aspectj2/?loc=j

Introduction to AspectJ
http://www-106.ibm.com/developerworks/library/j-aspectj/index.html
> -----Original Message-----
> From: Avinash Chugh [mailto:avi_chugh@hotmail.com]
> Sent: Thursday, November 21, 2002 5:57 AM
> To: cactus-user@jakarta.apache.org
> Subject: Error accessing same http session across test methods
>
>
> Environment: Weblogic 7, Win2k, Cactus 1.4.1
>
> I have a ServletTestCase with two test methods - testLogin(),
> testLogout().
>
> testlogin calls a doPost() on a servlet which logs in user using HTTP
> request parameters, and places an object in session. When I test
> assertNotNull for that session attribute, the test succeeds.
>
> testlogout() calls another doPost() which logs out the earlier user and
> invalidate the session. But when I do assertNotNull() for the same
> session attribute (before the actual call to servlet), the test fails..
>
> I am using the same servlet...and session.isNew() always returns true
>
> This leads me to believe..
> The HTTPSession created by testLogin() can nolonger be accessed by
> subsequent test method(s) ??
>
> This is a bug..right ??
>
> Regards,
>
>
> --
> 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>


Mime
View raw message