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

FileTest

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

Fields Summary
Constructors Summary
public FileTest()

    
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("accept", "someAccepted").addToMap(result);
        new PropertyHolder("size", "101").addToMap(result);
        return result;
    
public voidtestGenericAjax()

        FileTag tag = new FileTag();
        verifyGenericProperties(tag, "ajax", null);
    
public voidtestGenericSimple()

        FileTag tag = new FileTag();
        verifyGenericProperties(tag, "simple", null);
    
public voidtestGenericXhtml()

        FileTag tag = new FileTag();
        verifyGenericProperties(tag, "xhtml", null);
    
public voidtestSimple()

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

        FileTag tag = new FileTag();
        tag.setPageContext(pageContext);
        tag.setLabel("mylabel");
        tag.setName("myname");
        tag.setAccept("*.txt");
        tag.setValue("%{foo}");
        tag.setSize("10");
        tag.setTitle("mytitle");

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

        verify(TextFieldTag.class.getResource("File-1.txt"));