-
1. Re: Empty session for new test
ssilvert Jul 26, 2010 10:57 AM (in response to devora)Hi Devora,
Good question. The short answer is, "yes, that's the way it should be." Normally, you want to create a new JSFSession, which clears your HttpSession. This simulates a user hitting the application for the first time. Then the user does some things and you can do assertions every step of the way. You can do as many requests as you want against the same session. Using the JSFSession/JSFClient is how you simulate a multi-request user session and isolate your tests from one another.
You can reuse the same JSFSession instance from test to test. That would let you continue with the same HttpSession spanning more than one test. However, this kind of testing can suffer from side effects. You might have trouble controlling the ordering of your tests. Also, there is some dependency on how Cactus calls your tests. If the ServletRedirector is called more than once then all bets are off because doing that can give you a new HttpSession.
Stan
-