Package org.strecks.form.handler

Examples of org.strecks.form.handler.FormWrapper


   * Tests null action form
   */
  @Test
  public void testPostProcessActionForm1() throws Exception
  {
    FormWrapper delegate = createMock(FormWrapper.class);

    replay(delegate);

    ControllerRequestProcessor processor = new ControllerRequestProcessor();
    processor.setFormHandler(delegate);
View Full Code Here


   * Tests standard Struts action form
   */
  @Test
  public void testPostProcessActionForm2() throws Exception
  {
    FormWrapper delegate = createMock(FormWrapper.class);
    ActionForm form = new ActionForm()
    {

      private static final long serialVersionUID = 1L;
    };

    expect(delegate.wrapForm(form, null)).andReturn(form);
    replay(delegate);

    ControllerRequestProcessor processor = new ControllerRequestProcessor();
    processor.setFormHandler(delegate);

View Full Code Here

   */
  @Test
  public void testValidBindingForm2() throws Exception
  {

    FormWrapper delegate = createMock(FormWrapper.class);
    DelegatingForm form = createMock(DelegatingForm.class);

    expect(delegate.wrapForm(form, null)).andReturn(form);
    delegate.handleBindingForm(form, null);
    delegate.handleValidForm(form, null);

    replay(delegate);

    ControllerRequestProcessor processor = new ControllerRequestProcessor();
    processor.setFormHandler(delegate);
View Full Code Here

  @Test
  public void testValidBindingForm3() throws Exception
  {
    HttpServletRequest request = createMock(HttpServletRequest.class);

    FormWrapper delegate = new ValidateBindFormWrapper();
    SimpleBindableForm simpleBindableForm = new SimpleBindableForm();

    ControllerRequestProcessor processor = new ControllerRequestProcessor();
    processor.setFormHandler(delegate);
View Full Code Here

  @Test
  public void testValidBindingForm4() throws Exception
  {
    HttpServletRequest request = createMock(HttpServletRequest.class);

    FormWrapper delegate = new ValidateBindFormWrapper();
    ActionForm actionForm = new SimpleStrutsForm();

    ControllerRequestProcessor processor = new ControllerRequestProcessor();
    processor.setFormHandler(delegate);
View Full Code Here

 
  @Test
  public void testDelegatingActionForm() throws Exception
  {
    ServletActionContext sac = getActionContext();
    FormWrapper wrapper = newMock(FormWrapper.class);
    ProcessActionForm processActionForm = getProcessActionForm(wrapper);
    HttpServletRequest request = newMock(HttpServletRequest.class);
    ActionForm actionForm = newMock(ActionForm.class);
    DelegatingForm delegatingForm = new DelegatingForm(actionForm);

    expect(sac.getActionForm()).andReturn(actionForm);
    expect(sac.getRequest()).andReturn(request);
   
    expect(wrapper.wrapForm(actionForm, request)).andReturn(delegatingForm);

    wrapper.handleBindingForm(isA(BindingForm.class), eq(request));
    wrapper.handleValidForm(isA(ValidForm.class), eq(request));
    sac.setActionForm(isA(ActionForm.class));
   
    replayMocks();
    processActionForm.execute(sac);
    verifyMocks();
View Full Code Here

 
  @Test
  public void testRegularActionForm() throws Exception
  {
    ServletActionContext sac = getActionContext();
    FormWrapper wrapper = newMock(FormWrapper.class);
    ProcessActionForm processActionForm = getProcessActionForm(wrapper);
    HttpServletRequest request = newMock(HttpServletRequest.class);
    ActionForm actionForm = newMock(ActionForm.class);

    expect(sac.getActionForm()).andReturn(actionForm);
    expect(sac.getRequest()).andReturn(request);
    expect(wrapper.wrapForm(actionForm, request)).andReturn(actionForm);
    sac.setActionForm(actionForm);

    replayMocks();
    processActionForm.execute(sac);
    verifyMocks();
View Full Code Here

TOP

Related Classes of org.strecks.form.handler.FormWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.