|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.resteasy.mock.MockHttpRequest
public class MockHttpRequest
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
attributes
|
protected MultivaluedMap<java.lang.String,java.lang.String> |
decodedFormParameters
|
protected MultivaluedMap<java.lang.String,java.lang.String> |
formParameters
|
protected HttpHeadersImpl |
httpHeaders
|
protected java.lang.String |
httpMethod
|
protected java.io.InputStream |
inputStream
|
protected java.lang.String |
preprocessedPath
|
protected UriInfo |
uri
|
Constructor Summary | |
---|---|
protected |
MockHttpRequest()
|
Method Summary | |
---|---|
MockHttpRequest |
accept(java.util.List<MediaType> accepts)
|
MockHttpRequest |
accept(java.lang.String type)
|
MockHttpRequest |
addFormHeader(java.lang.String name,
java.lang.String value)
Set CONTENT-TYPE to ""application/x-www-form-urlencoded" |
void |
complete()
|
MockHttpRequest |
content(byte[] bytes)
|
MockHttpRequest |
content(java.io.InputStream stream)
|
MockHttpRequest |
contentType(MediaType type)
|
MockHttpRequest |
contentType(java.lang.String type)
|
MockHttpRequest |
cookie(java.lang.String name,
java.lang.String value)
|
static MockHttpRequest |
create(java.lang.String httpMethod,
java.lang.String uri)
|
static MockHttpRequest |
create(java.lang.String httpMethod,
java.net.URI uriObj,
java.net.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(java.lang.String uri)
|
static MockHttpRequest |
get(java.lang.String uri)
|
AsynchronousResponse |
getAsynchronousResponse()
Returns the AsynchronousResponse created by createAsynchronousResponse |
java.lang.Object |
getAttribute(java.lang.String attribute)
Map of contextual data. |
MultivaluedMap<java.lang.String,java.lang.String> |
getDecodedFormParameters()
|
MultivaluedMap<java.lang.String,java.lang.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()
|
java.lang.String |
getHttpMethod()
|
java.io.InputStream |
getInputStream()
|
java.lang.String |
getPreprocessedPath()
Encoded preprocessed path with extension mappings and matrix parameters removed |
UriInfo |
getUri()
|
static MockHttpRequest |
head(java.lang.String uri)
|
MockHttpRequest |
header(java.lang.String name,
java.lang.String value)
|
void |
initialRequestThreadFinished()
Callback by the initial calling thread. |
protected static MockHttpRequest |
initWithUri(java.lang.String uri)
|
boolean |
isInitial()
Asynchronous HTTP support. |
boolean |
isSuspended()
Asynchronous HTTP support. |
boolean |
isTimeout()
|
MockHttpRequest |
language(java.lang.String language)
|
static MockHttpRequest |
post(java.lang.String uri)
|
static MockHttpRequest |
put(java.lang.String uri)
|
void |
removeAttribute(java.lang.String name)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setInputStream(java.io.InputStream stream)
If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream(). |
void |
setPreprocessedPath(java.lang.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 java.io.InputStream inputStream
protected UriInfo uri
protected java.lang.String httpMethod
protected java.lang.String preprocessedPath
protected MultivaluedMap<java.lang.String,java.lang.String> formParameters
protected MultivaluedMap<java.lang.String,java.lang.String> decodedFormParameters
protected java.util.Map<java.lang.String,java.lang.Object> attributes
Constructor Detail |
---|
protected MockHttpRequest()
Method Detail |
---|
protected static MockHttpRequest initWithUri(java.lang.String uri) throws java.net.URISyntaxException
java.net.URISyntaxException
public static MockHttpRequest create(java.lang.String httpMethod, java.lang.String uri) throws java.net.URISyntaxException
java.net.URISyntaxException
public static MockHttpRequest create(java.lang.String httpMethod, java.net.URI uriObj, java.net.URI baseUri)
public static MockHttpRequest get(java.lang.String uri) throws java.net.URISyntaxException
java.net.URISyntaxException
public static MockHttpRequest post(java.lang.String uri) throws java.net.URISyntaxException
java.net.URISyntaxException
public static MockHttpRequest put(java.lang.String uri) throws java.net.URISyntaxException
java.net.URISyntaxException
public static MockHttpRequest delete(java.lang.String uri) throws java.net.URISyntaxException
java.net.URISyntaxException
public static MockHttpRequest head(java.lang.String uri) throws java.net.URISyntaxException
java.net.URISyntaxException
public static MockHttpRequest deepCopy(HttpRequest request) throws java.io.IOException
java.io.IOException
public MockHttpRequest header(java.lang.String name, java.lang.String value)
public MockHttpRequest accept(java.util.List<MediaType> accepts)
public MockHttpRequest accept(java.lang.String type)
public MockHttpRequest language(java.lang.String language)
public MockHttpRequest cookie(java.lang.String name, java.lang.String value)
public MockHttpRequest contentType(java.lang.String type)
public MockHttpRequest contentType(MediaType type)
public MockHttpRequest content(byte[] bytes)
public MockHttpRequest content(java.io.InputStream stream)
public MockHttpRequest addFormHeader(java.lang.String name, java.lang.String value)
name
- value
-
public HttpHeaders getHttpHeaders()
getHttpHeaders
in interface HttpRequest
public java.io.InputStream getInputStream()
getInputStream
in interface HttpRequest
public void setInputStream(java.io.InputStream stream)
HttpRequest
setInputStream
in interface HttpRequest
public UriInfo getUri()
getUri
in interface HttpRequest
public java.lang.String getHttpMethod()
getHttpMethod
in interface HttpRequest
public MultivaluedMap<java.lang.String,java.lang.String> getFormParameters()
HttpRequest
getFormParameters
in interface HttpRequest
public MultivaluedMap<java.lang.String,java.lang.String> getDecodedFormParameters()
getDecodedFormParameters
in interface HttpRequest
public java.lang.String getPreprocessedPath()
HttpRequest
getPreprocessedPath
in interface HttpRequest
public void setPreprocessedPath(java.lang.String path)
setPreprocessedPath
in interface HttpRequest
public void suspend()
public void suspend(long timeout)
public void complete()
public boolean isInitial()
HttpRequest
isInitial
in interface HttpRequest
public boolean isSuspended()
HttpRequest
isSuspended
in interface HttpRequest
public boolean isTimeout()
public AsynchronousResponse createAsynchronousResponse(long suspendTimeout)
HttpRequest
createAsynchronousResponse
in interface HttpRequest
public AsynchronousResponse getAsynchronousResponse()
HttpRequest
getAsynchronousResponse
in interface HttpRequest
public void initialRequestThreadFinished()
HttpRequest
initialRequestThreadFinished
in interface HttpRequest
public java.lang.Object getAttribute(java.lang.String attribute)
HttpRequest
getAttribute
in interface HttpRequest
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface HttpRequest
public void removeAttribute(java.lang.String name)
removeAttribute
in interface HttpRequest
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |