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); } }
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); } }
/** * 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; }