Package org.apache.struts.action

Examples of org.apache.struts.action.ActionMapping


    BasicDispatchController action = new BasicDispatchController();
    ActionForward actionForward = new ActionForward();

    SimpleDispatchAction actionBean = createMock(SimpleDispatchAction.class);
    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);

    expect(mapping.getParameter()).andReturn("method");
    expect(request.getParameter("method")).andReturn("insert");
    expect(actionBean.insert()).andReturn("insertResult");
    expect(mapping.findForward("insertResult")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);
    replay(request);
View Full Code Here


    BasicDispatchController action = new BasicDispatchController();
    ActionForward actionForward = new ActionForward();

    SimpleDispatchAction actionBean = createMock(SimpleDispatchAction.class);
    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);

    expect(mapping.getParameter()).andReturn("method");
    expect(request.getParameter("method")).andReturn(null);
    expect(actionBean.unspecified()).andReturn("unspecifiedResult");
    expect(mapping.findForward("unspecifiedResult")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);
    replay(request);
View Full Code Here

  {

    BasicDispatchController action = new BasicDispatchController();

    SimpleDispatchAction actionBean = createMock(SimpleDispatchAction.class);
    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);

    expect(mapping.getParameter()).andReturn(null);
    expect(mapping.getPath()).andReturn("path");

    replay(actionBean);
    replay(mapping);
    replay(request);
View Full Code Here

  @Test
  public void testCheckParamter()
  {

    ActionMapping actionMapping = createStrictMock(ActionMapping.class);
    expect(actionMapping.getPath()).andReturn("/path");

    replay(actionMapping);

    DispatchControllerHelper helper = new DispatchControllerHelper();
    try
View Full Code Here

  public void testPopulateActionForm() throws Exception
  {
    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);
View Full Code Here

    ServletActionContext sac = getActionContext();
    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);
View Full Code Here

  @Test
  public void testNavigationHandler()
  {

    ActionMapping mapping = createStrictMock(ActionMapping.class);

    ActionForward actionForward = new ActionForward();
    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(mapping);

    MappingNavigationHandler handler = new MappingNavigationHandler();
    ActionForwardViewAdapter viewAdapter = handler.getActionForward(new TestContextImpl(null, mapping), "success");
View Full Code Here

    ActionForward actionForward = new ActionForward();

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    NavigableFormRenderBean actionBean = createStrictMock(NavigableFormRenderBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    DelegatingForm form = createStrictMock(DelegatingForm.class);

    ActionErrors errors = new ActionErrors();
    errors.add("prop", new ActionMessage("key"));
    expect(request.getAttribute(Globals.ERROR_KEY)).andReturn(errors);
    actionBean.setInputError(true);
    actionBean.execute();
    expect(form.getBindOutwards()).andReturn(false);
    expect(actionBean.getSuccessResult()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);
    replay(form);
    replay(request);
View Full Code Here

    ActionForward actionForward = new ActionForward();

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    NavigableFormRenderBean actionBean = createStrictMock(NavigableFormRenderBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    DelegatingForm form = createStrictMock(DelegatingForm.class);

    expect(request.getAttribute(Globals.ERROR_KEY)).andReturn(null);
    actionBean.setInputError(false);
    form.setBindOutwards(true);
    actionBean.execute();
    expect(form.getBindOutwards()).andReturn(true);
    form.bindOutwards(actionBean);
    expect(actionBean.getSuccessResult()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);
    replay(form);
    replay(request);
View Full Code Here

    ActionForward actionForward = new ActionForward();

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    NavigableFormRenderBean actionBean = createStrictMock(NavigableFormRenderBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    BasicActionForm form = createStrictMock(BasicActionForm.class);

    expect(request.getAttribute(Globals.ERROR_KEY)).andReturn(null);
    actionBean.setInputError(false);
    actionBean.execute();
    expect(actionBean.getSuccessResult()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(actionBean);
    replay(mapping);
    replay(form);
    replay(request);
View Full Code Here

TOP

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

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.