|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.testing.tools.http.RequestExecutor
public class RequestExecutor
Executes a Request and provides convenience methods to validate the results.
| Constructor Summary | |
|---|---|
RequestExecutor(org.apache.http.impl.client.DefaultHttpClient client)
|
|
| Method Summary | |
|---|---|
RequestExecutor |
assertContentContains(String... expected)
For each supplied string, fail unless content contains it |
RequestExecutor |
assertContentRegexp(String... regexp)
For each supplied regexp, fail unless content contains at least one line that matches. |
RequestExecutor |
assertContentType(String expected)
Verify that response matches supplied content type |
RequestExecutor |
assertStatus(int expected)
Verify that response matches supplied status |
protected void |
clear()
|
protected void |
consumeEntity()
Can be overridden to consume in a different way, or not at all |
RequestExecutor |
execute(Request r)
|
void |
generateDocumentation(RequestDocumentor documentor,
String... metadata)
|
String |
getContent()
|
org.apache.http.HttpEntity |
getEntity()
|
org.apache.http.client.methods.HttpUriRequest |
getRequest()
|
org.apache.http.HttpResponse |
getResponse()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RequestExecutor(org.apache.http.impl.client.DefaultHttpClient client)
| Method Detail |
|---|
public String toString()
toString in class Object
public RequestExecutor execute(Request r)
throws org.apache.http.client.ClientProtocolException,
IOException
org.apache.http.client.ClientProtocolException
IOException
protected void consumeEntity()
throws org.apache.http.ParseException,
IOException
org.apache.http.ParseException
IOExceptionprotected void clear()
public RequestExecutor assertStatus(int expected)
public RequestExecutor assertContentType(String expected)
public RequestExecutor assertContentRegexp(String... regexp)
throws IOException
IOException
public RequestExecutor assertContentContains(String... expected)
throws org.apache.http.ParseException,
IOException
org.apache.http.ParseException
IOException
public void generateDocumentation(RequestDocumentor documentor,
String... metadata)
throws IOException
IOExceptionpublic org.apache.http.client.methods.HttpUriRequest getRequest()
public org.apache.http.HttpResponse getResponse()
public org.apache.http.HttpEntity getEntity()
public String getContent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||