Methods Summary |
---|
protected java.util.Map | initializedGenericTagTestProperties()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.
Map result = super.initializedGenericTagTestProperties();
new PropertyHolder("maxlength", "10").addToMap(result);
new PropertyHolder("readonly", "true", "readonly=\"readonly\"").addToMap(result);
new PropertyHolder("size", "12").addToMap(result);
return result;
|
public void | testErrors()
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
TextFieldTag tag = new TextFieldTag();
tag.setPageContext(pageContext);
tag.setId("myId");
tag.setLabel("mylabel");
tag.setName("foo");
tag.setValue("bar");
tag.setTitle("mytitle");
testAction.addFieldError("foo", "bar error message");
tag.doStartTag();
tag.doEndTag();
verify(TextFieldTag.class.getResource("Textfield-2.txt"));
|
public void | testGenericAjax()
TextFieldTag tag = new TextFieldTag();
verifyGenericProperties(tag, "ajax", null);
|
public void | testGenericSimple()
TextFieldTag tag = new TextFieldTag();
verifyGenericProperties(tag, "simple", null);
|
public void | testGenericXhtml()
TextFieldTag tag = new TextFieldTag();
verifyGenericProperties(tag, "xhtml", null);
|
public void | testNoLabelFtl()
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
TextFieldModel model = new TextFieldModel(stack, request, response);
HashMap params = new HashMap();
params.put("name", "myname");
params.put("value", "%{foo}");
params.put("size", "10");
params.put("onblur", "blahescape('somevalue');");
TransformControl control = (TransformControl) model.getWriter(writer, params);
control.onStart();
control.afterBody();
verify(TextFieldTag.class.getResource("Textfield-3.txt"));
|
public void | testNoLabelJsp()
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
TextFieldTag tag = new TextFieldTag();
tag.setPageContext(pageContext);
tag.setName("myname");
tag.setValue("%{foo}");
tag.setSize("10");
tag.setOnblur("blahescape('somevalue');");
tag.doStartTag();
tag.doEndTag();
verify(TextFieldTag.class.getResource("Textfield-3.txt"));
|
public void | testSimple()
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
TextFieldTag tag = new TextFieldTag();
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setName("myname");
tag.setValue("%{foo}");
tag.setSize("10");
tag.doStartTag();
tag.doEndTag();
verify(TextFieldTag.class.getResource("Textfield-1.txt"));
|