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 ByteArrayOutputStream
protected String
protected List
<javax.ws.rs.core.NewCookie> protected OutputStream
protected CaseInsensitiveMap
protected boolean
protected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNewCookie
(javax.ws.rs.core.NewCookie cookie) List
<javax.ws.rs.core.NewCookie> byte[]
int
boolean
boolean
void
reset()
reset status and headers.void
sendError
(int status) void
void
void
setStatus
(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:
getStatus
in interfaceHttpResponse
-
setStatus
public void setStatus(int status) - Specified by:
setStatus
in interfaceHttpResponse
-
getOutputHeaders
- Specified by:
getOutputHeaders
in interfaceHttpResponse
-
getOutputStream
- Specified by:
getOutputStream
in interfaceHttpResponse
- Throws:
IOException
-
setOutputStream
- Specified by:
setOutputStream
in interfaceHttpResponse
-
getOutput
public byte[] getOutput() -
getContentAsString
-
addNewCookie
public void addNewCookie(javax.ws.rs.core.NewCookie cookie) - Specified by:
addNewCookie
in interfaceHttpResponse
-
sendError
- Specified by:
sendError
in interfaceHttpResponse
- Throws:
IOException
-
sendError
- Specified by:
sendError
in interfaceHttpResponse
- Throws:
IOException
-
getNewCookies
-
getErrorMessage
-
isErrorSent
public boolean isErrorSent() -
isCommitted
public boolean isCommitted()- Specified by:
isCommitted
in interfaceHttpResponse
-
reset
public void reset()Description copied from interface:HttpResponse
reset status and headers. Will fail if response is committed- Specified by:
reset
in interfaceHttpResponse
-