Package org.strecks.action.navigable.impl

Examples of org.strecks.action.navigable.impl.SimpleDispatchAction


  @Test
  public void testGetMethod()
  {
    DispatchControllerHelper helper = new DispatchControllerHelper();
    SimpleDispatchAction action = new SimpleDispatchAction();
    Method method1 = helper.getMethod(action, "insert");
    Method method2 = helper.getMethod(action, "insert");
    assert method1 == method2;
  }
View Full Code Here


    navigationReader.readAnnotations(SimpleDispatchAction.class);
    action.setNavigationHolder(navigationReader.getNavigationHolder());

    ActionForward actionForward = new ActionForward();

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

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

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

  public void testInsertMethod()
  {

    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");
    actionBean.insert();
    expect(actionBean.getSuccessResult()).andReturn("insertResult");
    expect(mapping.findForward("insertResult")).andReturn(actionForward);

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

  public void testUnspecified()
  {

    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);
    actionBean.unspecified();
    expect(actionBean.getSuccessResult()).andReturn("unspecifiedResult");
    expect(mapping.findForward("unspecifiedResult")).andReturn(actionForward);

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

  @Test
  public void testNoParameter()
  {

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

TOP

Related Classes of org.strecks.action.navigable.impl.SimpleDispatchAction

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.