struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1324893 - /struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java
Date Wed, 11 Apr 2012 17:49:35 GMT
Author: lukaszlenart
Date: Wed Apr 11 17:49:35 2012
New Revision: 1324893

URL: http://svn.apache.org/viewvc?rev=1324893&view=rev
Log:
WW-3442 adds additional initialisation of HttpSession

Modified:
    struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java

Modified: struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java?rev=1324893&r1=1324892&r2=1324893&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java
(original)
+++ struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java
Wed Apr 11 17:49:35 2012
@@ -36,6 +36,7 @@ import org.apache.struts2.util.StrutsTes
 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 ext
     }
 
     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));
         }
     }
 



Mime
View raw message