Adds test to guard pre-evaulation of name attribute

This commit is contained in:
Lukasz Lenart
2016-06-22 10:46:09 +02:00
parent 2ea59b31b4
commit c84810ff82
2 changed files with 20 additions and 0 deletions
@@ -281,4 +281,20 @@ public class TextfieldTest extends AbstractUITagTest {
verify(TextFieldTag.class.getResource("Textfield-11.txt"));
}
public void testNameEvaluation() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setArray(new String[]{"test", "bar"});
testAction.setFooInt(1);
TextFieldTag tag = new TextFieldTag();
tag.setPageContext(pageContext);
tag.setName("array[%{fooInt}]");
tag.doStartTag();
tag.doEndTag();
verify(TextFieldTag.class.getResource("Textfield-12.txt"));
}
}
@@ -0,0 +1,4 @@
<tr>
<td class="tdLabel"></td>
<td><input type="text" name="array[1]" value="bar" id="array_1_"/></td>
</tr>