You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2012/05/29 12:02:31 UTC

svn commit: r1343639 - in /struts/struts2/trunk/core/src: main/java/org/apache/struts2/components/Radio.java test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java test/resources/org/apache/struts2/views/freemarker/manual-list.ftl

Author: lukaszlenart
Date: Tue May 29 10:02:31 2012
New Revision: 1343639

URL: http://svn.apache.org/viewvc?rev=1343639&view=rev
Log:
WW-3173 adds additional test case to prove usage of inline map

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Radio.java
    struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java
    struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/manual-list.ftl

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Radio.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Radio.java?rev=1343639&r1=1343638&r2=1343639&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Radio.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Radio.java Tue May 29 10:02:31 2012
@@ -21,12 +21,11 @@
 
 package org.apache.struts2.components;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import com.opensymphony.xwork2.util.ValueStack;
 import org.apache.struts2.views.annotations.StrutsTag;
 
-import com.opensymphony.xwork2.util.ValueStack;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 /**
  * <!-- START SNIPPET: javadoc -->
@@ -47,6 +46,10 @@ import com.opensymphony.xwork2.util.Valu
  * &lt;s:action name="GenderMap" var="genders"/&gt;
  * &lt;s:radio label="Gender" name="male" list="#genders.genders"/&gt;
  * <!-- END SNIPPET: example -->
+ *
+ * <!-- START SNIPPET: example_fmt -->
+ * &lt;@s.radio name="car" list={"ford": "Ford Motor Co", "toyota": "Toyota"} listKey="key" listValue="value" /&gt;
+ * <!-- END SNIPPET: example -->
  * </pre>
  *
  */

Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java?rev=1343639&r1=1343638&r2=1343639&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java Tue May 29 10:02:31 2012
@@ -256,9 +256,11 @@ public class FreeMarkerResultTest extend
         Dispatcher dispatcher = Dispatcher.getInstance();
         ActionMapping mapping = dispatcher.getContainer().getInstance(ActionMapper.class).getMapping(request, dispatcher.getConfigurationManager());
         dispatcher.serviceAction(request, response, servletContext, mapping);
-        String expected =
-                "<input type=\"radio\" name=\"client\" id=\"client_foo\" value=\"foo\"/><label for=\"client_foo\">foo</label>\n" +
-                "<input type=\"radio\" name=\"client\" id=\"client_bar\" value=\"bar\"/><label for=\"client_bar\">bar</label>\n";
+        String expected = "<input type=\"radio\" name=\"client\" id=\"client_foo\" value=\"foo\"/><label for=\"client_foo\">foo</label>\n"
+                + "<input type=\"radio\" name=\"client\" id=\"client_bar\" value=\"bar\"/><label for=\"client_bar\">bar</label>\n"
+                + "\n"
+                + "<input type=\"radio\" name=\"car\" id=\"carford\" value=\"ford\"/><label for=\"carford\">Ford Motor Co</label>\n"
+                + "<input type=\"radio\" name=\"car\" id=\"cartoyota\" value=\"toyota\"/><label for=\"cartoyota\">Toyota</label>\n";
         assertEquals(expected, stringWriter.toString());
     }
 

Modified: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/manual-list.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/manual-list.ftl?rev=1343639&r1=1343638&r2=1343639&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/manual-list.ftl (original)
+++ struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/manual-list.ftl Tue May 29 10:02:31 2012
@@ -20,4 +20,6 @@
  * under the License.
  */
 -->
-<@s.radio name="client" id="client_" list='{"foo", "bar"}' />
\ No newline at end of file
+<@s.radio name="client" id="client_" list='{"foo", "bar"}' />
+
+<@s.radio name="car" list={"ford": "Ford Motor Co", "toyota": "Toyota"} listKey="key" listValue="value" />