Package org.jboss.resteasy.mock
Class MockHttpResponse
java.lang.Object
org.jboss.resteasy.mock.MockHttpResponse
- All Implemented Interfaces:
HttpResponse
Acts as a bridge between asynchronous message and reply
- Version:
- $Revision: 1 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteArrayOutputStreamprotected Stringprotected List<javax.ws.rs.core.NewCookie> protected OutputStreamprotected CaseInsensitiveMapprotected booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNewCookie(javax.ws.rs.core.NewCookie cookie) List<javax.ws.rs.core.NewCookie> byte[]intbooleanbooleanvoidreset()reset status and headers.voidsendError(int status) voidvoidvoidsetStatus(int status)
-
Field Details
-
status
protected int status -
baos
-
os
-
outputHeaders
-
newCookies
-
errorMessage
-
sentError
protected boolean sentError
-
-
Constructor Details
-
MockHttpResponse
public MockHttpResponse()
-
-
Method Details
-
getStatus
public int getStatus()- Specified by:
getStatusin interfaceHttpResponse
-
setStatus
public void setStatus(int status) - Specified by:
setStatusin interfaceHttpResponse
-
getOutputHeaders
- Specified by:
getOutputHeadersin interfaceHttpResponse
-
getOutputStream
- Specified by:
getOutputStreamin interfaceHttpResponse- Throws:
IOException
-
setOutputStream
- Specified by:
setOutputStreamin interfaceHttpResponse
-
getOutput
public byte[] getOutput() -
getContentAsString
-
addNewCookie
public void addNewCookie(javax.ws.rs.core.NewCookie cookie) - Specified by:
addNewCookiein interfaceHttpResponse
-
sendError
- Specified by:
sendErrorin interfaceHttpResponse- Throws:
IOException
-
sendError
- Specified by:
sendErrorin interfaceHttpResponse- Throws:
IOException
-
getNewCookies
-
getErrorMessage
-
isErrorSent
public boolean isErrorSent() -
isCommitted
public boolean isCommitted()- Specified by:
isCommittedin interfaceHttpResponse
-
reset
public void reset()Description copied from interface:HttpResponsereset status and headers. Will fail if response is committed- Specified by:
resetin interfaceHttpResponse
-