mirror of
https://github.com/apache/struts.git
synced 2026-08-31 19:35:40 +00:00
Adding test to ensure label separator for radio tag works WW-2343
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615201 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -121,6 +121,30 @@ public class RadioTest extends AbstractUITagTest {
|
||||
verify(RadioTag.class.getResource("Radio-1.txt"));
|
||||
}
|
||||
|
||||
public void testSimpleWithLabelSeparator() throws Exception {
|
||||
TestAction testAction = (TestAction) action;
|
||||
testAction.setFoo("bar");
|
||||
testAction.setList(new String[][]{
|
||||
{"hello", "world"},
|
||||
{"foo", "bar"}
|
||||
});
|
||||
|
||||
RadioTag tag = new RadioTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setLabel("mylabel");
|
||||
tag.setName("myname");
|
||||
tag.setValue("");
|
||||
tag.setList("list");
|
||||
tag.setListKey("top[0]");
|
||||
tag.setListValue("top[1]");
|
||||
tag.setLabelSeparator("--");
|
||||
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
verify(RadioTag.class.getResource("Radio-5.txt"));
|
||||
}
|
||||
|
||||
public void testGenericSimple() throws Exception {
|
||||
RadioTag tag = new RadioTag();
|
||||
prepareTagGeneric(tag);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<tr>
|
||||
<td class="tdLabel"><label for="myname" class="label">mylabel--</label></td>
|
||||
<td>
|
||||
<input type="radio" name="myname" id="mynamehello" value="hello"/><label for="mynamehello">world</label>
|
||||
<input type="radio" name="myname" id="mynamefoo" value="foo"/><label for="mynamefoo">bar</label>
|
||||
</td>
|
||||
</tr>
|
||||
Reference in New Issue
Block a user