FileDocCategorySizeDatePackage
TextareaTest.javaAPI DocExample3468Mon Jul 23 13:26:16 BST 2007org.apache.struts2.views.jsp.ui

TextareaTest

public class TextareaTest extends org.apache.struts2.views.jsp.AbstractUITagTest

Fields Summary
Constructors Summary
Methods Summary
protected java.util.MapinitializedGenericTagTestProperties()
Initialize a map of {@link org.apache.struts2.views.jsp.AbstractUITagTest.PropertyHolder} for generic tag property testing. Will be used when calling {@link #verifyGenericProperties(org.apache.struts2.views.jsp.ui.AbstractUITag, String, String[])} as properties to verify.

This implementation extends testdata from AbstractUITag.

return
A Map of PropertyHolders values bound to {@link org.apache.struts2.views.jsp.AbstractUITagTest.PropertyHolder#getName()} as key.

        Map result = super.initializedGenericTagTestProperties();
        new PropertyHolder("cols", "10").addToMap(result);
        new PropertyHolder("rows", "11").addToMap(result);
        new PropertyHolder("readonly", "true", "readonly=\"readonly\"").addToMap(result);
        new PropertyHolder("wrap", "soft").addToMap(result);
        return result;
    
public voidtestGenericAjax()

        TextareaTag tag = new TextareaTag();
        verifyGenericProperties(tag, "ajax", new String[] {"value"});
    
public voidtestGenericSimple()

        TextareaTag tag = new TextareaTag();
        verifyGenericProperties(tag, "simple", new String[] {"value"});
    
public voidtestGenericXhtml()

        TextareaTag tag = new TextareaTag();
        verifyGenericProperties(tag, "xhtml", new String[] {"value"});
    
public voidtestSimple()

        TestAction testAction = (TestAction) action;
        testAction.setFoo("bar");

        TextareaTag tag = new TextareaTag();
        tag.setPageContext(pageContext);
        tag.setLabel("mylabel");
        tag.setName("myname");
        tag.setValue("%{foo}");
        tag.setRows("30");
        tag.setCols("20");
        tag.setTitle("mytitle");
        tag.setDisabled("true");
        tag.setTabindex("5");
        tag.setOnchange("alert('goodbye');");
        tag.setOnclick("alert('onclick');");
        tag.setId("the_id");
        tag.setOnkeyup("alert('hello');");
        tag.setReadonly("true");

        tag.doStartTag();
        tag.doEndTag();

        verify(TextareaTag.class.getResource("Textarea-1.txt"));