struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r628270 - /struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/ServletActionRedirectResultTest.java
Date Sat, 16 Feb 2008 11:50:50 GMT
Author: mrdon
Date: Sat Feb 16 03:50:48 2008
New Revision: 628270

URL: http://svn.apache.org/viewvc?rev=628270&view=rev
Log:
Adding test to ensure custom parameters are handled correctly
WW-2170

Modified:
    struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/ServletActionRedirectResultTest.java

Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/ServletActionRedirectResultTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/ServletActionRedirectResultTest.java?rev=628270&r1=628269&r2=628270&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/ServletActionRedirectResultTest.java
(original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/ServletActionRedirectResultTest.java
Sat Feb 16 03:50:48 2008
@@ -34,6 +34,7 @@
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.ActionProxy;
+import com.opensymphony.xwork2.ObjectFactory;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
 import com.opensymphony.xwork2.config.entities.ResultConfig;
 import com.opensymphony.xwork2.util.ValueStack;
@@ -161,5 +162,25 @@
         assertEquals("/myNamespace/myAction.action?param1=value+1&param2=value+2&param3=value+3",
res.getRedirectedUrl());
 
         control.verify();
+    }
+
+    public void testBuildResultWithParameter() throws Exception {
+
+        ResultConfig resultConfig = new ResultConfig.Builder("", ServletActionRedirectResult.class.getName())
+            .addParam("actionName", "someActionName")
+            .addParam("namespace", "someNamespace")
+            .addParam("encode", "true")
+            .addParam("parse", "true")
+            .addParam("location", "someLocation")
+            .addParam("prependServletContext", "true")
+            .addParam("method", "someMethod")
+            .addParam("param1", "value 1")
+            .addParam("param2", "value 2")
+            .addParam("param3", "value 3")
+            .build();
+
+        ObjectFactory factory = container.getInstance(ObjectFactory.class);
+        ServletActionRedirectResult result = (ServletActionRedirectResult) factory.buildResult(resultConfig,
new HashMap());
+        assertNotNull(result);
     }
 }



Mime
View raw message