You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "James Holmes (JIRA)" <ji...@apache.org> on 2007/09/18 17:54:36 UTC
[jira] Resolved: (WW-2181) SessionAware documentation is misleading
about unit testing
[ https://issues.apache.org/struts/browse/WW-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Holmes resolved WW-2181.
------------------------------
Resolution: Fixed
Fix Version/s: 2.0.11
Many thanks for the patch Wes. Keep 'em coming!
Fixed on Struts 2_0_X branch in SVN revision 576956.
Fixed on the trunk (Struts 2.1) in SVN revision 576957.
> SessionAware documentation is misleading about unit testing
> -----------------------------------------------------------
>
> Key: WW-2181
> URL: https://issues.apache.org/struts/browse/WW-2181
> Project: Struts 2
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 2.0.9
> Reporter: Jim Cushing
> Assignee: James Holmes
> Fix For: 2.0.11
>
> Attachments: SessionAware.java.patch
>
>
> The SessionAware JavaDocs state:
> "Note that using this interface makes the Action tied to a servlet environment, so it should be avoided if possible since things like unit testing will become more difficult."
> Unit testing with SessionAware is actually quite simple, compared to accessing the session through ActionContext, and SessionAware makes the Action less bound to a servlet environment than ServletRequestAware, another possible means of accessing the session.
> It could be argued that using sessions at all makes ties an Action to a servlet environment, but this statement instead implies that users should find a different means of getting at the session to improve unit testability. I believe that's misleading.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.