|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.resteasy.mock.MockHttpRequest
public class MockHttpRequest
| Field Summary | |
|---|---|
protected Map<String,Object> |
attributes
|
protected MultivaluedMap<String,String> |
decodedFormParameters
|
protected static URI |
EMPTY_URI
|
protected MultivaluedMap<String,String> |
formParameters
|
protected HttpHeadersImpl |
httpHeaders
|
protected String |
httpMethod
|
protected InputStream |
inputStream
|
protected String |
preprocessedPath
|
protected UriInfo |
uri
|
| Constructor Summary | |
|---|---|
protected |
MockHttpRequest()
|
| Method Summary | |
|---|---|
MockHttpRequest |
accept(List<MediaType> accepts)
|
MockHttpRequest |
accept(String type)
|
MockHttpRequest |
addFormHeader(String name,
String value)
Set CONTENT-TYPE to ""application/x-www-form-urlencoded" |
void |
complete()
|
MockHttpRequest |
content(byte[] bytes)
|
MockHttpRequest |
content(InputStream stream)
|
MockHttpRequest |
contentType(MediaType type)
|
MockHttpRequest |
contentType(String type)
|
MockHttpRequest |
cookie(String name,
String value)
|
static MockHttpRequest |
create(String httpMethod,
String uri)
|
static MockHttpRequest |
create(String httpMethod,
URI uriObj,
URI baseUri)
|
AsynchronousResponse |
createAsynchronousResponse(long suspendTimeout)
This method will create an asynchronous response and prepare the request to be issued asynchronously |
static MockHttpRequest |
deepCopy(HttpRequest request)
|
static MockHttpRequest |
delete(String uri)
|
static MockHttpRequest |
get(String uri)
|
AsynchronousResponse |
getAsynchronousResponse()
Returns the AsynchronousResponse created by createAsynchronousResponse |
Object |
getAttribute(String attribute)
Map of contextual data. |
MultivaluedMap<String,String> |
getDecodedFormParameters()
|
MultivaluedMap<String,String> |
getFormParameters()
application/x-www-form-urlencoded parameters This is here because @FormParam needs it and for when there are servlet filters that eat up the input stream |
HttpHeaders |
getHttpHeaders()
|
String |
getHttpMethod()
|
InputStream |
getInputStream()
|
String |
getPreprocessedPath()
Encoded preprocessed path with extension mappings and matrix parameters removed |
UriInfo |
getUri()
|
static MockHttpRequest |
head(String uri)
|
MockHttpRequest |
header(String name,
String value)
|
void |
initialRequestThreadFinished()
Callback by the initial calling thread. |
protected static MockHttpRequest |
initWithUri(String uri)
|
boolean |
isInitial()
Asynchronous HTTP support. |
boolean |
isSuspended()
Asynchronous HTTP support. |
boolean |
isTimeout()
|
MockHttpRequest |
language(String language)
|
static MockHttpRequest |
post(String uri)
|
static MockHttpRequest |
put(String uri)
|
void |
removeAttribute(String name)
|
void |
setAttribute(String name,
Object value)
|
void |
setInputStream(InputStream stream)
If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream(). |
void |
setPreprocessedPath(String path)
|
void |
suspend()
|
void |
suspend(long timeout)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HttpHeadersImpl httpHeaders
protected InputStream inputStream
protected UriInfo uri
protected String httpMethod
protected String preprocessedPath
protected MultivaluedMap<String,String> formParameters
protected MultivaluedMap<String,String> decodedFormParameters
protected Map<String,Object> attributes
protected static final URI EMPTY_URI
| Constructor Detail |
|---|
protected MockHttpRequest()
| Method Detail |
|---|
protected static MockHttpRequest initWithUri(String uri)
throws URISyntaxException
URISyntaxException
public static MockHttpRequest create(String httpMethod,
String uri)
throws URISyntaxException
URISyntaxException
public static MockHttpRequest create(String httpMethod,
URI uriObj,
URI baseUri)
public static MockHttpRequest get(String uri)
throws URISyntaxException
URISyntaxException
public static MockHttpRequest post(String uri)
throws URISyntaxException
URISyntaxException
public static MockHttpRequest put(String uri)
throws URISyntaxException
URISyntaxException
public static MockHttpRequest delete(String uri)
throws URISyntaxException
URISyntaxException
public static MockHttpRequest head(String uri)
throws URISyntaxException
URISyntaxException
public static MockHttpRequest deepCopy(HttpRequest request)
throws IOException
IOException
public MockHttpRequest header(String name,
String value)
public MockHttpRequest accept(List<MediaType> accepts)
public MockHttpRequest accept(String type)
public MockHttpRequest language(String language)
public MockHttpRequest cookie(String name,
String value)
public MockHttpRequest contentType(String type)
public MockHttpRequest contentType(MediaType type)
public MockHttpRequest content(byte[] bytes)
public MockHttpRequest content(InputStream stream)
public MockHttpRequest addFormHeader(String name,
String value)
name - value -
public HttpHeaders getHttpHeaders()
getHttpHeaders in interface HttpRequestpublic InputStream getInputStream()
getInputStream in interface HttpRequestpublic void setInputStream(InputStream stream)
HttpRequest
setInputStream in interface HttpRequestpublic UriInfo getUri()
getUri in interface HttpRequestpublic String getHttpMethod()
getHttpMethod in interface HttpRequestpublic MultivaluedMap<String,String> getFormParameters()
HttpRequest
getFormParameters in interface HttpRequestpublic MultivaluedMap<String,String> getDecodedFormParameters()
getDecodedFormParameters in interface HttpRequestpublic String getPreprocessedPath()
HttpRequest
getPreprocessedPath in interface HttpRequestpublic void setPreprocessedPath(String path)
setPreprocessedPath in interface HttpRequestpublic void suspend()
public void suspend(long timeout)
public void complete()
public boolean isInitial()
HttpRequest
isInitial in interface HttpRequestpublic boolean isSuspended()
HttpRequest
isSuspended in interface HttpRequestpublic boolean isTimeout()
public AsynchronousResponse createAsynchronousResponse(long suspendTimeout)
HttpRequest
createAsynchronousResponse in interface HttpRequestpublic AsynchronousResponse getAsynchronousResponse()
HttpRequest
getAsynchronousResponse in interface HttpRequestpublic void initialRequestThreadFinished()
HttpRequest
initialRequestThreadFinished in interface HttpRequestpublic Object getAttribute(String attribute)
HttpRequest
getAttribute in interface HttpRequest
public void setAttribute(String name,
Object value)
setAttribute in interface HttpRequestpublic void removeAttribute(String name)
removeAttribute in interface HttpRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||