|
||||||||||
| 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(java.lang.String... expected)
For each supplied string, fail unless content contains it |
RequestExecutor |
assertContentRegexp(java.lang.String... regexp)
For each supplied regexp, fail unless content contains at least one line that matches. |
RequestExecutor |
assertContentType(java.lang.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,
java.lang.String... metadata)
|
java.lang.String |
getContent()
|
org.apache.http.HttpEntity |
getEntity()
|
org.apache.http.client.methods.HttpUriRequest |
getRequest()
|
org.apache.http.HttpResponse |
getResponse()
|
java.lang.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 java.lang.String toString()
toString in class java.lang.Object
public RequestExecutor execute(Request r)
throws org.apache.http.client.ClientProtocolException,
java.io.IOException
org.apache.http.client.ClientProtocolException
java.io.IOException
protected void consumeEntity()
throws org.apache.http.ParseException,
java.io.IOException
org.apache.http.ParseException
java.io.IOExceptionprotected void clear()
public RequestExecutor assertStatus(int expected)
public RequestExecutor assertContentType(java.lang.String expected)
public RequestExecutor assertContentRegexp(java.lang.String... regexp)
throws java.io.IOException
java.io.IOException
public RequestExecutor assertContentContains(java.lang.String... expected)
throws org.apache.http.ParseException,
java.io.IOException
org.apache.http.ParseException
java.io.IOException
public void generateDocumentation(RequestDocumentor documentor,
java.lang.String... metadata)
throws java.io.IOException
java.io.IOExceptionpublic org.apache.http.client.methods.HttpUriRequest getRequest()
public org.apache.http.HttpResponse getResponse()
public org.apache.http.HttpEntity getEntity()
public java.lang.String getContent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||