struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r572220 - in /struts/struts2/branches/STRUTS_2_0_X/core/src: main/resources/template/simple/radiomap.ftl test/java/org/apache/struts2/views/jsp/ui/RadioTest.java test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt
Date Mon, 03 Sep 2007 02:46:44 GMT
Author: mrdon
Date: Sun Sep  2 19:46:43 2007
New Revision: 572220

URL: http://svn.apache.org/viewvc?rev=572220&view=rev
Log:
Fixing j5-j6 bug in test WW-2045

Added:
    struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt
      - copied, changed from r572216, struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt
Modified:
    struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/radiomap.ftl
    struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java

Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/radiomap.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/radiomap.ftl?rev=572220&r1=572219&r2=572220&view=diff
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/radiomap.ftl
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/radiomap.ftl
Sun Sep  2 19:46:43 2007
@@ -37,7 +37,7 @@
  name="${parameters.name?html}"<#rt/>
 </#if>
  id="${parameters.id?html}${itemKeyStr?html}"<#rt/>
-<#if tag.contains(parameters.nameValue, itemKeyStr)>
+<#if tag.contains(parameters.nameValue?default(''), itemKeyStr)>
  checked="checked"<#rt/>
 </#if>
 <#if itemKey?exists>

Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java?rev=572220&r1=572219&r2=572220&view=diff
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
Sun Sep  2 19:46:43 2007
@@ -75,6 +75,28 @@
 
         verify(RadioTag.class.getResource("Radio-2.txt"));
     }
+    
+    public void testMapCheckedNull() throws Exception {
+        TestAction testAction = (TestAction) action;
+        testAction.setFoo("bar");
+
+        HashMap map = new HashMap();
+        map.put("1", "One");
+        map.put("2", "Two");
+        testAction.setMap(map);
+
+        RadioTag tag = new RadioTag();
+        tag.setPageContext(pageContext);
+        tag.setLabel("mylabel");
+        tag.setName("myname");
+        tag.setValue("%{map['3']}");
+        tag.setList("#@java.util.TreeMap@{\"1\":\"One\", \"2\":\"Two\", \"\":\"N/A\"}");
+
+        tag.doStartTag();
+        tag.doEndTag();
+
+        verify(RadioTag.class.getResource("Radio-4.txt"));
+    }
 
     public void testSimple() throws Exception {
         TestAction testAction = (TestAction) action;

Copied: struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt
(from r572216, struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt)
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt?p2=struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt&p1=struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt&r1=572216&r2=572220&rev=572220&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/Radio-4.txt
Sun Sep  2 19:46:43 2007
@@ -1,8 +1,8 @@
 <tr>
     <td class="tdLabel"><label for="myname" class="label">mylabel:</label></td>
     <td>
-<input type="radio" name="myname" id="myname2" value="2"/><label for="myname2">Two</label>
-<input type="radio" name="myname" id="myname1" value="1"/><label for="myname1">One</label>
 <input type="radio" name="myname" id="myname" checked="checked" value=""/><label
for="myname">N/A</label>
+<input type="radio" name="myname" id="myname1" value="1"/><label for="myname1">One</label>
+<input type="radio" name="myname" id="myname2" value="2"/><label for="myname2">Two</label>
     </td>
 </tr>



Mime
View raw message