Author: lukaszlenart Date: Fri Apr 6 15:56:45 2012 New Revision: 1310417 URL: http://svn.apache.org/viewvc?rev=1310417&view=rev Log: WW-3174 additional test case for Dynamic Attributes support
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/dynaAttributes.ftl Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java?rev=1310417&r1=1310416&r2=1310417&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java Fri Apr 6 15:56:45 2012 @@ -1203,7 +1203,7 @@ public abstract class UIBean extends Com public void setDynamicAttributes(Map<String, Object> dynamicAttributes) { this.dynamicAttributes.putAll(dynamicAttributes); -} + } @Override /** @@ -1221,7 +1221,7 @@ public abstract class UIBean extends Com } } } - + protected Set<String> getStandardAttributes() { Class clz = getClass(); Set<String> standardAttributes = standardAttributesMap.get(clz); Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java?rev=1310417&r1=1310416&r2=1310417&view=diff ============================================================================== --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java Fri Apr 6 15:56:45 2012 @@ -214,7 +214,9 @@ public class FreeMarkerResultTest extend 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 { Modified: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/dynaAttributes.ftl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/dynaAttributes.ftl?rev=1310417&r1=1310416&r2=1310417&view=diff ============================================================================== --- struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/dynaAttributes.ftl (original) +++ struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/freemarker/dynaAttributes.ftl Fri Apr 6 15:56:45 2012 @@ -20,4 +20,5 @@ * under the License. */ --> -<@s.textfield name="test" dynamicAttributes={"placeholder":"input","foo":"bar"}/> \ No newline at end of file +<@s.textfield name="test" dynamicAttributes={"placeholder":"input","foo":"bar"}/> +<@s.textfield name="test" placeholder="input" foo="bar"/> \ No newline at end of file