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); } }
/** * Constructs a web request using a base request and a relative URL string. **/ protected WebRequest( WebRequest baseRequest, String urlString, String target ) throws MalformedURLException { this( baseRequest.getURL(), urlString, target ); }
/** * Constructs a web request using a base request and a relative URL string. **/ protected WebRequest( WebRequest baseRequest, String urlString, String target ) throws MalformedURLException { this( baseRequest.getURL(), urlString, target ); }
/** * Constructs a web request using a base request and a relative URL string. **/ protected WebRequest( WebRequest baseRequest, String urlString, String target ) throws MalformedURLException { this( baseRequest.getURL(), urlString, target ); }
private String getRequestUri() { try { return null == _request ? null : _request.getURL().getFile(); } catch (MalformedURLException e) { return null; } }
private String getRequestUri() { try { return null == _request ? null : _request.getURL().getFile(); } catch (MalformedURLException e) { return null; } }
private String getRequestUri() { try { return null == _request ? null : _request.getURL().getFile(); } catch (MalformedURLException e) { return null; } }
HttpWebResponse( WebConversation client, FrameSelector frame, WebRequest request, URLConnection connection, boolean throwExceptionOnError ) throws IOException { this( client, frame, request.getURL(), connection, throwExceptionOnError ); _referer = request.getReferer(); }
protected WebResponse submitRequest( String event, WebRequest request ) throws IOException, SAXException { try { return super.submitRequest( event, request ); } catch (UnknownServiceException e) { throw new UnsupportedActionException( "HttpUnit does not support " + request.getURL().getProtocol() + " URLs in form submissions" ); } }
protected WebResponse submitRequest( String event, WebRequest request ) throws IOException, SAXException { try { return super.submitRequest( event, request ); } catch (UnknownServiceException e) { throw new UnsupportedActionException( "HttpUnit does not support " + request.getURL().getProtocol() + " URLs in form submissions" ); } }
protected WebResponse submitRequest( String event, WebRequest request ) throws IOException, SAXException { try { return super.submitRequest( event, request ); } catch (UnknownServiceException e) { throw new UnsupportedActionException( "HttpUnit does not support " + request.getURL().getProtocol() + " URLs in form submissions" ); } }
private URL getReference() { try { return getRequest().getURL(); } catch (MalformedURLException e) { return WebLink.this.getBaseURL(); } } }
private URL getReference() { try { return getRequest().getURL(); } catch (MalformedURLException e) { return WebLink.this.getBaseURL(); } } }
private URL getReference() { try { return getRequest().getURL(); } catch (MalformedURLException e) { return WebLink.this.getBaseURL(); } } }
InvocationContext newInvocation( WebRequest request, FrameSelector frame ) throws IOException, MalformedURLException { ByteArrayOutputStream baos = getMessageBody( request ); return _invocationContextFactory.newInvocation( this, frame, request, getHeaderFields( request.getURL() ), baos.toByteArray() ); }
protected WebResponse execute(WebConversation conversation, final WebRequest request) throws IOException, SAXException { // execute the operation WebResponse response = conversation.getResponse(request); assertNotNull("POST response to " + request.getURL().toString() + " is null", response); log.debug(Util.getResponseHeaders(response)); log.debug("Response code: " + response.getResponseCode()); // handle potential redirects response = getRedirectResponse(conversation, request, response); return response; }
/** * 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 ); } }
/** * 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 ); } }
/** * 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 ); } }