Return-Path: X-Original-To: apmail-struts-commits-archive@minotaur.apache.org Delivered-To: apmail-struts-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 68CC29656 for ; Wed, 11 Apr 2012 17:49:57 +0000 (UTC) Received: (qmail 37074 invoked by uid 500); 11 Apr 2012 17:49:57 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 37027 invoked by uid 500); 11 Apr 2012 17:49:57 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 37020 invoked by uid 99); 11 Apr 2012 17:49:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2012 17:49:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2012 17:49:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 024A62388C65 for ; Wed, 11 Apr 2012 17:49:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@struts.apache.org From: lukaszlenart@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120411174936.024A62388C65@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 session = actionContext.getSession(); - if (session == null) { + if (actionContext.getSession() == null) { actionContext.setSession(new HashMap()); + request.setSession(new MockHttpSession(servletContext)); } }