Package org.strecks.action.basic.impl

Examples of org.strecks.action.basic.impl.SimpleLookupDispatchAction


    HashMap<String, String> hashMap = new HashMap<String, String>();
    hashMap.put("insert.key", "insert");

    action.setKeyMethodMap(hashMap);

    SimpleLookupDispatchAction actionBean = createMock(SimpleLookupDispatchAction.class);

    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);
    HttpSession session = createMock(HttpSession.class);
    ModuleConfig moduleConfig = createMock(ModuleConfig.class);
    ActionServlet servlet = createMock(ActionServlet.class);
    ServletContext context = createMock(ServletContext.class);
    MessageResources messageResources = createMock(MessageResources.class);
    DelegatingForm form = createStrictMock(DelegatingForm.class);
   
    action.setServlet(servlet);

    actionBean.preBind();
    form.bindInwards(actionBean);
    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(null);
    expect(mapping.getParameter()).andReturn("method");
    expect(request.getParameter("method")).andReturn("Insert Stuff Here");
    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute(Globals.LOCALE_KEY)).andReturn(Locale.getDefault());
    expect(request.getAttribute(Globals.MODULE_KEY)).andReturn(moduleConfig);
    expect(moduleConfig.findMessageResourcesConfigs()).andReturn(new MessageResourcesConfig[]
    {
      new MessageResourcesConfig()
    });
    expect(servlet.getServletContext()).andReturn(context);
    expect(request.getAttribute(Globals.MODULE_KEY)).andReturn(moduleConfig);
    expect(moduleConfig.getPrefix()).andReturn("");
    expect(context.getAttribute(Globals.MESSAGES_KEY)).andReturn(messageResources);
    expect(messageResources.getMessage(Locale.getDefault(), "insert.key")).andReturn("Insert Stuff Here");
    expect(actionBean.insert()).andReturn("inserted");
    expect(mapping.findForward("inserted")).andReturn(actionForward);

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


    HashMap<String, String> hashMap = new HashMap<String, String>();
    // hashMap.put("insert.key", "insert");

    action.setKeyMethodMap(hashMap);

    SimpleLookupDispatchAction actionBean = createMock(SimpleLookupDispatchAction.class);

    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);
    HttpSession session = createMock(HttpSession.class);
    ModuleConfig moduleConfig = createMock(ModuleConfig.class);
View Full Code Here

    HashMap<String, String> hashMap = new HashMap<String, String>();
    hashMap.put("insert.key", "insert");

    action.setKeyMethodMap(hashMap);

    SimpleLookupDispatchAction actionBean = createMock(SimpleLookupDispatchAction.class);

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

    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(Boolean.TRUE);
    expect(actionBean.cancel()).andReturn("cancelled");
    expect(mapping.findForward("cancelled")).andReturn(actionForward);

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

TOP

Related Classes of org.strecks.action.basic.impl.SimpleLookupDispatchAction

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.