WW-3174 additional test case for Dynamic Attributes support

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1310417 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lukasz Lenart
2012-04-06 15:56:45 +00:00
parent 3cd48592dd
commit aef1c6aaf6
3 changed files with 7 additions and 4 deletions
@@ -1203,7 +1203,7 @@ public abstract class UIBean extends Component {
public void setDynamicAttributes(Map<String, Object> dynamicAttributes) {
this.dynamicAttributes.putAll(dynamicAttributes);
}
}
@Override
/**
@@ -1221,7 +1221,7 @@ public abstract class UIBean extends Component {
}
}
}
protected Set<String> getStandardAttributes() {
Class clz = getClass();
Set<String> standardAttributes = standardAttributesMap.get(clz);
@@ -214,7 +214,9 @@ public class FreeMarkerResultTest extends StrutsTestCase {
Dispatcher dispatcher = Dispatcher.getInstance();
ActionMapping mapping = dispatcher.getContainer().getInstance(ActionMapper.class).getMapping(request, dispatcher.getConfigurationManager());
dispatcher.serviceAction(request, response, servletContext, mapping);
assertEquals("<input type=\"text\" name=\"test\" value=\"\" id=\"test\" placeholder=\"input\" foo=\"bar\"/>", stringWriter.toString());
String expected = "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" placeholder=\"input\" foo=\"bar\"/>"
+ "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" placeholder=\"input\" foo=\"bar\"/>";
assertEquals(expected, stringWriter.toString());
}
protected void setUp() throws Exception {
@@ -20,4 +20,5 @@
* under the License.
*/
-->
<@s.textfield name="test" dynamicAttributes={"placeholder":"input","foo":"bar"}/>
<@s.textfield name="test" dynamicAttributes={"placeholder":"input","foo":"bar"}/>
<@s.textfield name="test" placeholder="input" foo="bar"/>