Thanks Haroon for the handy advice. That seems to do the trick as far
as the session object is concerned. The test passes now. Would it be
easy for someone to extend your code to include actions that implement
the -aware interfaces? If I wanted to take a shot at that, is there a
particular point you would suggest I start with?

Also, many thanks to Wes, for pointing out a good starting point for
understanding Struts2 at a deeper level by examining the code!

Regards to all.

On Mon, Jul 20, 2009 at 9:26 AM, Haroon
Rafique<haroon.rafi...@utoronto.ca> wrote:
> On Yesterday at 9:16pm, DC=>Dimitrios Christodoulakis <dimi....@gmail.com>...:
>
> DC> [..snip..]
> DC>
> DC> When testing (junit 4) an action implementing the Sessionaware
> DC> interface (my login and register classes) I noticed that the session
> DC> object is set to null by BaseStrutsTestCase. This was mentioned before
> DC> in the author's blog, but not sure if ever addressed. I added a new
> DC> comment over there but the discussion could be inactive.
> DC>
>
> Hi Dimitrios,
>
> Don't think arsenalist is watching that blog dilligently any more.
>
> DC>
> DC> I was wondering if anyone who is using the BaseStrutsTestCase, or used
> DC> it in the past, came across this issue and if by any chance managed to
> DC> resolve it. Perhaps Haroon might have a comment on this?
> DC>
>
> Not a whole lot at the moment as none of our Action classes implement
> those interfaces. How about something like:
>
> protected static HashMap sessionMap = new HashMap();
>
> //.... and further on later in the code
>
> proxy.getInvocation().getInvocationContext().setSession(sessionMap);
>
>
> DC>
> DC> Also, a couple of more general questions:
> DC>
> DC> 1) Is there a recommended way to check during testing which
> DC>    interceptors are firing and when?
> DC>
>
> Careful there. Haven't you now delved into the territory of testing the
> framework itself (rather than your own code)? IMHO, I would assume that
> it's the framework's responsibility to make sure that when a certain set
> of interceptors is configured, they better fire properly.
>
> DC>
> DC> [..snip..]
> DC>
> DC> Kind regards and I appreciate all the input.
> DC>
>
> Cheers,
> --
> Haroon Rafique
> <haroon.rafi...@utoronto.ca>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to