FormButtonTestpublic class FormButtonTest extends org.apache.struts2.StrutsTestCase
Methods Summary |
---|
public void | testPopulateComponentHtmlId1()
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
Form form = new Form(stack, req, res);
form.getParameters().put("id", "formId");
Submit submit = new Submit(stack, req, res);
submit.setId("submitId");
submit.populateComponentHtmlId(form);
assertEquals("submitId", submit.getParameters().get("id"));
| public void | testPopulateComponentHtmlId2()
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
Form form = new Form(stack, req, res);
form.getParameters().put("id", "formId");
Submit submit = new Submit(stack, req, res);
submit.setName("submitName");
submit.populateComponentHtmlId(form);
assertEquals("formId_submitName", submit.getParameters().get("id"));
| public void | testPopulateComponentHtmlId3()
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
Form form = new Form(stack, req, res);
form.getParameters().put("id", "formId");
Submit submit = new Submit(stack, req, res);
submit.setAction("submitAction");
submit.setMethod("submitMethod");
submit.populateComponentHtmlId(form);
assertEquals("formId_submitAction_submitMethod", submit.getParameters().get("id"));
| public void | testPopulateComponentHtmlId4()
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
Submit submit = new Submit(stack, req, res);
submit.setId("submitId");
submit.populateComponentHtmlId(null);
assertEquals("submitId", submit.getParameters().get("id"));
| public void | testPopulateComponentHtmlId5()
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
Submit submit = new Submit(stack, req, res);
submit.setName("submitName");
submit.populateComponentHtmlId(null);
assertEquals("submitName", submit.getParameters().get("id"));
| public void | testPopulateComponentHtmlId6()
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
ValueStack stack = ValueStackFactory.getFactory().createValueStack();
Submit submit = new Submit(stack, req, res);
submit.setAction("submitAction");
submit.setMethod("submitMethod");
submit.populateComponentHtmlId(null);
assertEquals("submitAction_submitMethod", submit.getParameters().get("id"));
|
|