|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.request.Response
org.apache.wicket.request.http.WebResponse
org.apache.wicket.mock.MockWebResponse
public class MockWebResponse
Mocked WebResponse.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.wicket.request.http.WebResponse |
|---|
WebResponse.CacheScope |
| Field Summary |
|---|
| Fields inherited from class org.apache.wicket.request.http.WebResponse |
|---|
MAX_CACHE_DURATION |
| Constructor Summary | |
|---|---|
MockWebResponse()
Construct. |
|
| Method Summary | |
|---|---|
void |
addCookie(javax.servlet.http.Cookie cookie)
Add a cookie to the web response |
void |
addHeader(String name,
String value)
Add a value to the servlet response stream. |
void |
clearCookie(javax.servlet.http.Cookie cookie)
Convenience method for clearing a cookie. |
String |
encodeRedirectURL(CharSequence url)
Encodes urls used to redirect. |
String |
encodeURL(CharSequence url)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. |
void |
flush()
Flushes the response. |
byte[] |
getBinaryResponse()
|
Object |
getContainerResponse()
Provides access to the low-level container response object that implementaion of this Response delegate to. |
Long |
getContentLength()
|
String |
getContentType()
|
List<javax.servlet.http.Cookie> |
getCookies()
|
Time |
getDateHeader(String name)
|
String |
getErrorMessage()
|
String |
getHeader(String name)
|
Set<String> |
getHeaderNames()
|
String |
getRedirectUrl()
|
Integer |
getStatus()
|
CharSequence |
getTextResponse()
|
boolean |
hasHeader(String name)
|
boolean |
isRedirect()
|
void |
reset()
Called when the Response needs to reset itself. |
void |
sendError(int sc,
String msg)
Send error status code with optional message. |
void |
sendRedirect(String url)
Redirects the response to specified URL. |
void |
setContentLength(long length)
Set the content length on the response, if appropriate in the subclass. |
void |
setContentType(String mimeType)
Set the content type on the response, if appropriate in the subclass. |
void |
setDateHeader(String name,
Time date)
Set a header to the date value in the servlet response stream. |
void |
setHeader(String name,
String value)
Set a header to the string value in the servlet response stream. |
void |
setStatus(int sc)
Sets the status code for this response. |
void |
write(byte[] array)
Writes the buffer to output. |
void |
write(byte[] array,
int offset,
int length)
Writes the buffer to output. |
void |
write(CharSequence sequence)
Writes the CharSequence to output. |
| Methods inherited from class org.apache.wicket.request.http.WebResponse |
|---|
disableCaching, enableCaching, setAttachmentHeader, setInlineHeader, setLastModifiedTime |
| Methods inherited from class org.apache.wicket.request.Response |
|---|
close, getOutputStream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockWebResponse()
| Method Detail |
|---|
public void addCookie(javax.servlet.http.Cookie cookie)
WebResponse
addCookie in class WebResponsepublic void clearCookie(javax.servlet.http.Cookie cookie)
WebResponse
clearCookie in class WebResponsecookie - The cookie to setWebResponse.addCookie(Cookie)public List<javax.servlet.http.Cookie> getCookies()
public void sendRedirect(String url)
WebResponseurl parameters
throu the #encodeRedirectURL(String) method.
sendRedirect in class WebResponsepublic String getRedirectUrl()
null if sendRedirect(String) was not called.public boolean isRedirect()
isRedirect in class WebResponsetrue if redirect URL was set, false otherwise.public void setContentLength(long length)
WebResponse
setContentLength in class WebResponselength - The length of the contentpublic Long getContentLength()
setContentLength(long))public void setContentType(String mimeType)
WebResponse
setContentType in class WebResponsemimeType - The mime typepublic String getContentType()
public void setDateHeader(String name,
Time date)
WebResponse
setDateHeader in class WebResponsepublic Time getDateHeader(String name)
name -
public void setHeader(String name,
String value)
WebResponse
setHeader in class WebResponse
public void addHeader(String name,
String value)
WebResponse
addHeader in class WebResponsepublic String getHeader(String name)
name -
public boolean hasHeader(String name)
name -
true if the header was set, false otherwisepublic Set<String> getHeaderNames()
public void setStatus(int sc)
WebResponse
setStatus in class WebResponsesc - status codepublic Integer getStatus()
null if status was not setpublic String encodeURL(CharSequence url)
Response
encodeURL in class Responsepublic String encodeRedirectURL(CharSequence url)
WebResponseResponse.encodeURL(CharSequence).
encodeRedirectURL in class WebResponsepublic void write(CharSequence sequence)
ResponseCharSequence to output.
write in class Responsepublic CharSequence getTextResponse()
public void write(byte[] array)
Response
write in class Responsearray - the data.
public void write(byte[] array,
int offset,
int length)
Response
write in class Responsearray - the data.offset - the start offset in the data.length - the number of bytes to write.public byte[] getBinaryResponse()
public void sendError(int sc,
String msg)
WebResponse
sendError in class WebResponsepublic String getErrorMessage()
public void flush()
WebResponse
flush in class WebResponsepublic void reset()
Response
reset in class Responsepublic Object getContainerResponse()
ResponseResponse delegate to. This allows users to access features provided by the container
response but not by generalized Wicket Response objects.
getContainerResponse in class Responsenull if none
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||