public class RequestExecutor extends Object
Constructor and Description |
---|
RequestExecutor(org.apache.http.impl.client.DefaultHttpClient client) |
Modifier and Type | Method and Description |
---|---|
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() |
public RequestExecutor(org.apache.http.impl.client.DefaultHttpClient client)
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
IOException
protected 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
IOException
public org.apache.http.client.methods.HttpUriRequest getRequest()
public org.apache.http.HttpResponse getResponse()
public org.apache.http.HttpEntity getEntity()
public String getContent()
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.