Package org.apache.struts.action

Examples of org.apache.struts.action.ActionForm


    InjectionAnnotationReader c = new InjectionAnnotationReader();
    ActionWithActionForm action = new ActionWithActionForm();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> injectionHandlers = c.getInjectionMap();
    ActionForm actionForm = new SimpleForm();

    InjectionWrapper inputWrapper = injectionHandlers.get("actionForm");

    ActionContext injectionContext = new TestContextImpl(actionForm, null);
    inputWrapper.inject(action, injectionContext);
View Full Code Here


    InjectionAnnotationReader c = new InjectionAnnotationReader();
    ActionWithActionForm action = new ActionWithActionForm();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> injectionHandlers = c.getInjectionMap();
    ActionForm actionForm = new SimpleForm();
    DelegatingForm delegator = new DelegatingForm(actionForm);

    InjectionWrapper inputWrapper = injectionHandlers.get("actionForm");

    ActionContext injectionContext = new TestContextImpl(delegator, null);
View Full Code Here

  {
    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);
   
View Full Code Here

  {
    ServletActionContext sac = getActionContext();
    FormPopulateSource formPopulateSource = newMock(FormPopulateSource.class);
    PopulateActionForm populateActionForm = getPopulateActionForm(formPopulateSource);
    ActionMapping actionConfig = newMock(ActionMapping.class);
    ActionForm actionForm = newMock(ActionForm.class);
    HttpServletRequest request = newMock(HttpServletRequest.class);

    expect(sac.getActionForm()).andReturn(actionForm);
    expect(sac.getRequest()).andReturn(request);
    expect(formPopulateSource.prePopulate(actionForm, request)).andReturn(actionForm);
View Full Code Here

  {
    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);
View Full Code Here

    ControllerProcessorDelegate delegate = newMock(ControllerProcessorDelegate.class);
    ActionContextFactory factory = newMock(ActionContextFactory.class);
    ExecuteAction executeAction = getExecuteAction(delegate, factory);
    Action action = newMock(Action.class);
    ActionMapping actionConfig = newMock(ActionMapping.class);
    ActionForm actionForm = newMock(ActionForm.class);
    ActionContext actionContext = newMock(ActionContext.class);
    ActionForward forwardConfig = newMock(ActionForward.class);
    HttpServletRequest request = newMock(HttpServletRequest.class);
    HttpServletResponse response = newMock(HttpServletResponse.class);
    ServletContext servletContext = newMock(ServletContext.class);
View Full Code Here

    SimpleStrutsForm form = new SimpleStrutsForm();
    DelegatingForm delegator = new DelegatingForm(form);

    FormPopulateSourceImpl delegate = new FormPopulateSourceImpl();
   
    ActionForm form1 = delegate.prePopulate(form, null);
    ActionForm form2 = delegate.prePopulate(delegator, null);

    assert form1 instanceof SimpleStrutsForm;
    assert form2 == form1;
   
  }
View Full Code Here

public class ActionFormInjectionHandler implements InjectionHandler
{

  public Object getValue(ActionContext injectionContext)
  {
    ActionForm form = injectionContext.getForm();

    if (form instanceof WrappingForm)
    {
      WrappingForm wrapper = (WrappingForm) form;
      return wrapper.getWrappedForm();
View Full Code Here

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

      private static final long serialVersionUID = 1L;
    };

View Full Code Here

  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);

    assert (processor.postProcessActionForm(request, null, actionForm) == actionForm);
View Full Code Here

TOP

Related Classes of org.apache.struts.action.ActionForm

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.