| |
|
| java.lang.Object org.mortbay.jetty.testing.HttpTester
HttpTester | public class HttpTester (Code) | | Test support class.
Assist with parsing and generating HTTP requests and responses.
HttpTester tester = new HttpTester();
tester.parse(
"GET /uri HTTP/1.1\r\n"+
"Host: fakehost\r\n"+
"Content-Length: 10\r\n" +
"\r\n");
System.err.println(tester.getMethod());
System.err.println(tester.getURI());
System.err.println(tester.getVersion());
System.err.println(tester.getHeader("Host"));
System.err.println(tester.getContent());
author: gregw See Also: org.mortbay.jetty.testing.ServletTester |
_fields | protected HttpFields _fields(Code) | | |
_genContent | protected byte[] _genContent(Code) | | |
_parsedContent | protected ByteArrayOutputStream2 _parsedContent(Code) | | |
_status | protected int _status(Code) | | |
HttpTester | public HttpTester()(Code) | | |
addDateHeader | public void addDateHeader(String name, long date)(Code) | | Parameters: name - Parameters: date - See Also: org.mortbay.jetty.HttpFields.addDateField(java.lang.Stringlong) |
addLongHeader | public void addLongHeader(String name, long value)(Code) | | Parameters: name - Parameters: value - See Also: org.mortbay.jetty.HttpFields.addLongField(java.lang.Stringlong) |
addSetCookie | public void addSetCookie(Cookie cookie)(Code) | | Parameters: cookie - See Also: org.mortbay.jetty.HttpFields.addSetCookie(javax.servlet.http.Cookie) |
getDateHeader | public long getDateHeader(String name)(Code) | | Parameters: name - See Also: org.mortbay.jetty.HttpFields.getDateField(java.lang.String) |
getHeader | public String getHeader(String name)(Code) | | Parameters: name - See Also: org.mortbay.jetty.HttpFields.getStringField(java.lang.String) |
getHeaderNames | public Enumeration getHeaderNames()(Code) | | See Also: org.mortbay.jetty.HttpFields.getFieldNames |
getHeaderValues | public Enumeration getHeaderValues(String name)(Code) | | Parameters: name - See Also: org.mortbay.jetty.HttpFields.getValues(java.lang.String) |
getStatus | public int getStatus()(Code) | | the status |
parse | public String parse(String rawHTTP) throws IOException(Code) | | Parse one HTTP request or response
Parameters: rawHTTP - Raw HTTP to parse Any unparsed data in the rawHTTP (eg pipelined requests) throws: IOException - |
removeHeader | public void removeHeader(String name)(Code) | | Parameters: name - See Also: org.mortbay.jetty.HttpFields.remove(java.lang.String) |
reset | public void reset()(Code) | | |
setDateHeader | public void setDateHeader(String name, long date)(Code) | | Parameters: name - Parameters: date - See Also: org.mortbay.jetty.HttpFields.putDateField(java.lang.Stringlong) |
setHeader | public void setHeader(String name, String value)(Code) | | Parameters: name - Parameters: value - See Also: org.mortbay.jetty.HttpFields.put(java.lang.Stringjava.lang.String) |
setLongHeader | public void setLongHeader(String name, long value)(Code) | | Parameters: name - Parameters: value - See Also: org.mortbay.jetty.HttpFields.putLongField(java.lang.Stringlong) |
setMethod | public void setMethod(String method)(Code) | | Parameters: method - the method to set |
setReason | public void setReason(String reason)(Code) | | Parameters: reason - the reason to set |
setStatus | public void setStatus(int status)(Code) | | Parameters: status - the status to set |
setURI | public void setURI(String uri)(Code) | | Parameters: uri - the uri to set |
setVersion | public void setVersion(String version)(Code) | | Parameters: version - the version to set |
|
|
|