UIBeanTestpublic class UIBeanTest extends org.apache.struts2.StrutsTestCase
Methods Summary |
---|
public void | testPopulateComponentHtmlId1()
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
Form form = new Form(stack, req, res);
form.getParameters().put("id", "formId");
TextField txtFld = new TextField(stack, req, res);
txtFld.setId("txtFldId");
txtFld.populateComponentHtmlId(form);
assertEquals("txtFldId", txtFld.getParameters().get("id"));
| public void | testPopulateComponentHtmlId2()
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
Form form = new Form(stack, req, res);
form.getParameters().put("id", "formId");
TextField txtFld = new TextField(stack, req, res);
txtFld.setName("txtFldName");
txtFld.populateComponentHtmlId(form);
assertEquals("formId_txtFldName", txtFld.getParameters().get("id"));
| public void | testPopulateComponentHtmlIdWithOgnl()
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
Form form = new Form(stack, req, res);
form.getParameters().put("id", "formId");
TextField txtFld = new TextField(stack, req, res);
txtFld.setName("txtFldName%{'1'}");
txtFld.populateComponentHtmlId(form);
assertEquals("formId_txtFldName1", txtFld.getParameters().get("id"));
|
|