Thursday, November 11, 2010

unit test servlet with access to session

I have a RemoteServiceServlet that I'd like to test independently from
my client code, however it needs access to an HttpSession object for a
great many of the methods. I've thought of a few methods that seem a
little hackish: I could refactor most of the logic into
@VisibleForTesting methods that take the session attributes as
parameters, or I could re-implement the interface in another class and
delegate to it from the servlet. What are the best practices here?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate