|
BrokenEvent nanotests | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brokenevent.nanotests.http.TestHeadRequest
public class TestHeadRequest
HEAD request for http server tests.
Field Summary | |
---|---|
protected HttpClient |
client
|
protected static HttpHost |
host
|
protected static java.lang.String |
hostUrl
|
protected HttpRequest |
request
|
protected HttpResponse |
response
|
Constructor Summary | |
---|---|
TestHeadRequest(java.lang.String resource)
Initializes instance of the GET request for the given resource. |
Method Summary | |
---|---|
void |
execute()
Executes the http request. |
java.lang.String |
getRequestUrl()
Gets the fully qualified request URL. |
HttpResponse |
getResponse()
Gets the http response object. |
java.lang.String |
getStringContent()
Helper method to get content of the response for the http request. |
void |
removeHeader(java.lang.String name)
Remove the header from the http request |
void |
setHeader(java.lang.String name,
java.lang.String value)
Set the header for the http request. |
static void |
setHostUrl(java.lang.String hostUrl)
Sets the server URL for all the requests. |
void |
setUserAgent(java.lang.String value)
Sets the User-Agent http header field to the given value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HttpClient client
protected HttpRequest request
protected HttpResponse response
protected static java.lang.String hostUrl
protected static HttpHost host
Constructor Detail |
---|
public TestHeadRequest(java.lang.String resource)
resource
- resource nameMethod Detail |
---|
public static void setHostUrl(java.lang.String hostUrl)
http://localhost
hostUrl
- server URLpublic void setHeader(java.lang.String name, java.lang.String value)
name
- name of the header to setvalue
- value for the headerpublic void removeHeader(java.lang.String name)
name
- name of the header to removepublic void setUserAgent(java.lang.String value)
value
- User-Agent new valuepublic void execute()
public java.lang.String getRequestUrl()
getRequestUrl
in interface TestRequest
public HttpResponse getResponse()
getResponse
in interface TestRequest
public java.lang.String getStringContent()
|
BrokenEvent nanotests | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |