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:
Donald J. Brown
2008-01-25 12:22:22 +00:00
parent 0497356bc2
commit 876cf91a30
2 changed files with 31 additions and 0 deletions
@@ -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>