struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [48/50] [abbrv] struts git commit: Fixes test to use HttpParameters instead of Map
Date Fri, 15 Jul 2016 13:19:15 GMT
Fixes test to use HttpParameters instead of Map


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/b48082a8
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/b48082a8
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/b48082a8

Branch: refs/heads/master
Commit: b48082a8115dee04f33c6db29aacee64973424c6
Parents: 31826bc
Author: Lukasz Lenart <lukasz.lenart@gmail.com>
Authored: Sat Mar 12 16:14:45 2016 +0100
Committer: Lukasz Lenart <lukasz.lenart@gmail.com>
Committed: Sat Mar 12 16:14:45 2016 +0100

----------------------------------------------------------------------
 .../interceptor/MessageStorePreResultListenerTest.java      | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/b48082a8/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java
b/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java
index 4e46b3a..3737c46 100644
--- a/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java
+++ b/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java
@@ -6,6 +6,7 @@ import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.ActionSupport;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.StrutsInternalTestCase;
+import org.apache.struts2.dispatcher.HttpParameters;
 import org.apache.struts2.result.ServletActionRedirectResult;
 import org.easymock.EasyMock;
 
@@ -96,7 +97,6 @@ public class MessageStorePreResultListenerTest extends StrutsInternalTestCase
{
 
         MessageStorePreResultListener listener = new MessageStorePreResultListener(interceptor);
 
-        Map paramMap = new LinkedHashMap();
         Map sessionMap = new LinkedHashMap();
 
         ActionSupport action = new ActionSupport();
@@ -108,7 +108,7 @@ public class MessageStorePreResultListenerTest extends StrutsInternalTestCase
{
         action.addFieldError("field2", "some field error 2");
 
         ActionContext actionContext = new ActionContext(new HashMap());
-        actionContext.put(ActionContext.PARAMETERS, paramMap);
+        actionContext.setParameters(HttpParameters.createEmpty().build());
         actionContext.put(ActionContext.SESSION, sessionMap);
 
         HttpSession mockedSession = EasyMock.createControl().createMock(HttpSession.class);
@@ -172,7 +172,6 @@ public class MessageStorePreResultListenerTest extends StrutsInternalTestCase
{
 
         MessageStorePreResultListener listener = new MessageStorePreResultListener(interceptor);
 
-        Map paramMap = new LinkedHashMap();
         Map sessionMap = new LinkedHashMap();
 
         ActionSupport action = new ActionSupport();
@@ -184,8 +183,8 @@ public class MessageStorePreResultListenerTest extends StrutsInternalTestCase
{
         action.addFieldError("field2", "some field error 2");
 
         ActionContext actionContext = new ActionContext(new HashMap());
-        actionContext.put(ActionContext.PARAMETERS, paramMap);
-        actionContext.put(ActionContext.SESSION, sessionMap);
+        actionContext.setParameters(HttpParameters.createEmpty().build());
+        actionContext.setSession(sessionMap);
 
         HttpSession mockedSession = EasyMock.createControl().createMock(HttpSession.class);
         HttpServletRequest mockedRequest = EasyMock.createControl().createMock(HttpServletRequest.class);


Mime
View raw message