Package javax.servlet.http

Examples of javax.servlet.http.HttpServletRequest


    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);
   
    expect(sac.getRequest()).andReturn(request);
    expect(sac.getResponse()).andReturn(response);
View Full Code Here


  {

    View view = createStrictMock(View.class);
    Map model = createStrictMock(Map.class);
    ActionContext context = createStrictMock(ActionContext.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    HttpServletResponse response = createStrictMock(HttpServletResponse.class);

    SpringRenderingViewAdapter va = new SpringRenderingViewAdapter(view, model);

    expect(context.getRequest()).andReturn(request);
View Full Code Here

  {

    View view = createStrictMock(View.class);
    Map model = createStrictMock(Map.class);
    ActionContext context = createStrictMock(ActionContext.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    HttpServletResponse response = createStrictMock(HttpServletResponse.class);

    SpringRenderingViewAdapter va = new SpringRenderingViewAdapter(view, model);

    expect(context.getRequest()).andReturn(request);
View Full Code Here

  public void testNavigationHandler()
  {

    Page pageClass = createStrictMock(Page.class);
    ActionContext actionContext = createStrictMock(TestContextImpl.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    expect(pageClass.getPagePath()).andReturn("page_path");
    expect(actionContext.getResponse()).andReturn(null);
    pageClass.setHttpServletResponse(null);
    expect(actionContext.getRequest()).andReturn(request);
    request.setAttribute(InfrastructureKeys.PAGE_BEAN, pageClass);

    replay(pageClass);
    replay(actionContext);
    replay(request);
View Full Code Here

{

  @Test
  public void testResolveLocale()
  {
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    StrecksLocaleResolver resolver = new StrecksLocaleResolver();
    Locale locale = Locale.getDefault();
   
    expect(request.getAttribute(Globals.LOCALE_KEY)).andReturn(locale);
    replay(request);
    assert locale == resolver.resolveLocale(request);
   
    verify(request);
  }
View Full Code Here

  public void testWithValidBindingFormInputError()
  {

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

  public void testWithValidBindingForm()
  {

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

  public void testWithRegularForm()
  {

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

    ServletActionContext sac = getActionContext();
    FormValidationHandler formValidationHandler = newMock(FormValidationHandler.class);
    ValidateActionForm validateActionForm = getValidateActionForm(formValidationHandler);

    ActionMapping actionConfig = newMock(ActionMapping.class);
    HttpServletRequest request = newMock(HttpServletRequest.class);
   
    expect(sac.getRequest()).andReturn(request);
    expect(sac.getActionConfig()).andReturn(actionConfig);
    expect(sac.getFormValid()).andReturn(true);
   
View Full Code Here

    RequestSessionAction action = new RequestSessionAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createStrictMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createStrictMock(HttpSession.class);

    Map<String, Object> map = new HashMap<String, Object>();
    map.put("redirectParam", new Integer(1));

    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute(InfrastructureKeys.REDIRECT_PARAMETERS)).andReturn(map);

    replay(request);
    replay(session);
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpServletRequest

Copyright © 2015 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.