WW-3442 adds additional initialisation of HttpSession

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1324893 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lukasz Lenart
2012-04-11 17:49:35 +00:00
parent 78ee4b8ba2
commit abd628ea09
@@ -36,6 +36,7 @@ import org.apache.struts2.util.StrutsTestCaseHelper;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.mock.web.MockPageContext;
import org.springframework.mock.web.MockServletContext;
@@ -159,9 +160,9 @@ public abstract class StrutsTestCase extends XWorkTestCase {
}
protected void initSession(ActionContext actionContext) {
Map<String, Object> session = actionContext.getSession();
if (session == null) {
if (actionContext.getSession() == null) {
actionContext.setSession(new HashMap<String, Object>());
request.setSession(new MockHttpSession(servletContext));
}
}