Package br.com.caelum.vraptor.http

Examples of br.com.caelum.vraptor.http.MutableResponse


  @Inject
  private MethodInfo methodInfo;

  @Produces @javax.enterprise.context.RequestScoped
  public MutableResponse getInstance(){
    MutableResponse response = requestFactories.getResponse();
    if(!methodInfo.getControllerMethod().containsAnnotation(Cached.class)){
      return response;
    }
    return new CharArrayWriterResponse(response);
  }
View Full Code Here


      public T call() throws Exception {
        T result = null;
        HttpSessionMock session = new HttpSessionMock(context, "session" + ++counter);
        HttpServletRequestMock httpRequest = new HttpServletRequestMock(session,
            mock(MutableRequest.class, "request" + counter));
        MutableResponse response = mock(MutableResponse.class, "response" + counter);

        RequestInfo request = new RequestInfo(context, null, httpRequest, response);
        VRaptorRequestHolder.setRequestForCurrentThread(request);

        RequestContextListener contextListener = new RequestContextListener();
View Full Code Here

  when(request.getRequestURI()).thenReturn("what.ever.request.uri");
  when(request.getSession()).thenReturn(session);
  when(request.getParameterMap()).thenReturn(new HashMap<String, String[]>());
  when(request.getParameter("view")).thenReturn(null);
 
  MutableResponse response = mock(MutableResponse.class, "response" + counter);
  RequestInfo webRequest = new RequestInfo(context, null, new HttpServletRequestMock(session, request), response);
  return execution.execute(webRequest, counter);
  }
View Full Code Here

  @Override
  protected <T> T executeInsideRequest(WhatToDo<T> execution) {
  final HttpSessionMock session = new HttpSessionMock(context, "session" + ++counter);
  final MutableRequest request = new HttpServletRequestMock(session,
      mock(MutableRequest.class, "request" + counter));
  MutableResponse response = mock(MutableResponse.class, "response" + counter);
  RequestInfo webRequest = new RequestInfo(context, null, request, response);
  return execution.execute(webRequest, counter);
  }
View Full Code Here

    this.interceptorStack = interceptorStack;
    this.invalidInputHandler = invalidInputHandler;
  }

  public void handle(@Observes VRaptorRequestStarted event) {
    MutableResponse response = event.getResponse();
    MutableRequest request = event.getRequest();
    try {
      ControllerMethod method = translator.translate(request);
      controllerFoundEvent.fire(new ControllerFound(method));
      interceptorStack.start();
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.http.MutableResponse

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.