Package org.jboss.resteasy.mock
Class MockHttpResponse
java.lang.Object
org.jboss.resteasy.mock.MockHttpResponse
- All Implemented Interfaces:
Closeable,AutoCloseable,HttpResponse
Acts as a bridge between asynchronous message and reply
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteArrayOutputStreamprotected Stringprotected List<jakarta.ws.rs.core.NewCookie> protected OutputStreamprotected CaseInsensitiveMap<Object> protected booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNewCookie(jakarta.ws.rs.core.NewCookie cookie) voidList<jakarta.ws.rs.core.NewCookie> byte[]intbooleanbooleanvoidreset()reset status and headers.voidsendError(int status) voidvoidvoidsetStatus(int status) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.resteasy.spi.HttpResponse
close, getAsyncOutputStream, setSuppressExceptionDuringChunkedTransfer, suppressExceptionDuringChunkedTransfer
-
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
- Throws:
UnsupportedEncodingException
-
addNewCookie
public void addNewCookie(jakarta.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
-
flushBuffer
- Specified by:
flushBufferin interfaceHttpResponse- Throws:
IOException
-