mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
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:
@@ -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"/>
|
||||
Reference in New Issue
Block a user