[ 
https://issues.apache.org/struts/browse/WW-2800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nils-Helge Garli resolved WW-2800.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.3

Setters implementer. But in my opinion it's better to implement the *Aware 
interfaces and have the objects set directly on your actions.

> PortletActionContext does not provide setters for PortletRequest, 
> PortletResponse, PortletContext
> -------------------------------------------------------------------------------------------------
>
>                 Key: WW-2800
>                 URL: https://issues.apache.org/struts/browse/WW-2800
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Portlet, Unit Tests
>    Affects Versions: 2.0.11.2, 2.1.2
>         Environment: Linux, Pluto 1.1.6, Tomcat 6.x
>            Reporter: Torsten Krah
>            Priority: Minor
>             Fix For: 2.1.3
>
>
> Hi.
> The ServletActionContect class does provide setters like this:
>     ServletActionContext.setRequest(request);
>     ServletActionContext.setResponse(response);
>     ServletActionContext.setServletContext(servletContext);
> So i am able to use MockObjects (Servlet ones) and write Unit Tests to test 
> my Actions.
> Now i want to use Portlets (it should be possible to do the test like above 
> and it should work, but using "portlet" stuff is more clean).
> But the PortletActionContext class does not provide any setter to plugin 
> mocks for PortletRequest, PortletResponse or the PortletContext (analog to 
> the ones in a servlet environment).
> It would be nice (to make unit tests with portlet mock objects working - like 
> provided with spring-test) to implement these setters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to