In another thread I read that the HTTP session is simulated by PageTester. In
the other thread someone showed that you can get the ApplicationStateManager
and use @SessionState objects.

I'm writing a test that needs to set an attribute to the session so that
security code can access that attribute. The security code looks like this:

AuthenticationToken token = (AuthenticationToken)
requestGlobals.getRequest().getSession(true).getAttribute(AUTHENTICATION_TOKEN)

and is inside a service that gets the RequestGlobals injected via its
constructor.

Can I get access to the session and set an attribute when using PageTester?

I've tried:

RequestGlobals requestGlobals = tester.getService(RequestGlobals.class) ;

but requestGlobals.getRequest() and requestGlobals.getHTTPServletRequest()
both return null.

Thanks for helping out.

Stephan

-----
--
http://www.caimito.net - Caimito One Team - Agile Collaboration and Planning
tool
http://www.stephan-schwab.com - Personal blog
http://code.google.com/p/tapestry-sesame - Authentication extension for
Tapestry 5

-- 
View this message in context: 
http://old.nabble.com/Access-to-session-when-testing-with-PageTester--tp26962385p26962385.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to