mirror of
https://github.com/apache/struts.git
synced 2026-08-06 23:27:07 +00:00
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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user