public void request(WebRequest webRequest) { try { invocationContext = client.newInvocation(webRequest); rawRequest = new MyHttpRequest(invocationContext.getRequest(), webRequest.getURL().toExternalForm()); rawResponse = new MyHttpResponse(invocationContext.getResponse()); servletContext = invocationContext.getServlet().getServletConfig().getServletContext(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } if (requestContexts != null) { requestContext = requestContexts.getRequestContext(servletContext, rawRequest, rawResponse); } }
/** * Creates a web response object which represents the response to the specified web request. **/ protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException,IOException { try { InvocationContext invocation = newInvocation( request, targetFrame ); invocation.service(); return invocation.getServletResponse(); } catch (ServletException e) { throw new HttpInternalErrorException( request.getURL(), e ); } }
/** * Updates this client and returns the response which would be displayed by the * user agent. Note that this will typically be the same as that returned by the * servlet invocation unless that invocation results in a redirect request. **/ public WebResponse getResponse( InvocationContext invocation ) throws MalformedURLException,IOException,SAXException { updateMainWindow( invocation.getFrame(), invocation.getServletResponse() ); return getFrameContents( invocation.getFrame() ); }
/** * Returns an {@link teammates.ui.controller.Action} object that matches the parameters given. * * @param parameters Parameters that appear in a HttpServletRequest received by the app. */ public teammates.ui.controller.Action getLegacyActionObject(String uri, String... parameters) { InvocationContext ic = invokeWebRequest(uri, parameters); HttpServletRequest req = ic.getRequest(); teammates.ui.controller.Action action = new teammates.ui.controller.ActionFactory().getAction(req); action.setTaskQueuer(new MockTaskQueuer()); action.setEmailSender(new MockEmailSender()); return action; }
/** * Creates a web response object which represents the response to the specified web request. **/ protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException,IOException { try { InvocationContext invocation = newInvocation( request, targetFrame ); invocation.service(); return invocation.getServletResponse(); } catch (ServletException e) { throw new HttpInternalErrorException( request.getURL(), e ); } }
/** * Updates this client and returns the response which would be displayed by the * user agent. Note that this will typically be the same as that returned by the * servlet invocation unless that invocation results in a redirect request. **/ public WebResponse getResponse( InvocationContext invocation ) throws MalformedURLException,IOException,SAXException { updateMainWindow( invocation.getFrame(), invocation.getServletResponse() ); return getFrameContents( invocation.getFrame() ); }
/** * Creates a web response object which represents the response to the specified web request. **/ protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException,IOException { try { InvocationContext invocation = newInvocation( request, targetFrame ); invocation.service(); return invocation.getServletResponse(); } catch (ServletException e) { throw new HttpInternalErrorException( request.getURL(), e ); } }
/** * Updates this client and returns the response which would be displayed by the * user agent. Note that this will typically be the same as that returned by the * servlet invocation unless that invocation results in a redirect request. **/ public WebResponse getResponse( InvocationContext invocation ) throws MalformedURLException,IOException,SAXException { updateMainWindow( invocation.getFrame(), invocation.getServletResponse() ); return getFrameContents( invocation.getFrame() ); }
public void request(WebRequest webRequest) { try { invocationContext = client.newInvocation(webRequest); rawRequest = new MyHttpRequest(invocationContext.getRequest(), webRequest.getURL().toExternalForm()); rawResponse = new MyHttpResponse(invocationContext.getResponse()); servletContext = invocationContext.getServlet().getServletConfig().getServletContext(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } if (requestContexts != null) { requestContext = requestContexts.getRequestContext(servletContext, rawRequest, rawResponse); } }