Method Summary |
|
protected String | _getCharacterEncoding() |
protected OutputStream | _getOutputStream() |
protected void | _sendRedirect(String location) |
protected void | _setContentLength(int length) |
protected void | _setContentType(String contentType) |
public void | addCookie(Cookie cookie) |
public void | addDateHeader(String name, long date) |
public void | addHeader(String name, String value) |
public void | addIntHeader(String name, int integer) |
public boolean | containsHeader(String name) |
public Response | createEmbeddedResponse(String valueId, String differentiator) |
public String | encodeURL(String url) |
public byte[] | getBytes() Retrieves the an array of all the bytes that have been written to this
reponse. |
public String | getContentType() |
public long | getDateHeader(String name) Returns the value of the specified response header as a long value that
represents a Date object. |
public MockResponse | getEmbeddedResponse(String valueId) Retrieves the embedded response that corresponds to a specific
value in the embedding template. |
public List<MockResponse> | getEmbeddedResponses() Retrieves the embedded responses that were processed. |
public String | getHeader(String name) Returns the value of the specified response header as a
String . |
public Collection | getHeaderNames() Returns the value of the specified response header as a
String . |
public Collection | getHeaders(String name) Returns all the values of the specified response header as an
Collection of String objects.
If the response did not include any headers of the specified name,
this method returns an empty Collection . |
public HttpServletResponse | getHttpServletResponse() |
public int | getIntHeader(String name) Returns the value of the specified response header as an
int . |
public String | getLastElementId() Retrieves the identifier of the element that was last processed with
this response. |
public ElementInfo | getLastElementInfo() Retrieves the
ElementInfo of the element that was last
processed with this response. |
public Locale | getLocale() |
MockConversation | getMockConversation() |
public List<String> | getNewCookieNames() Retrieves the list of cookies that have been added in this reponse. |
public ParsedHtml | getParsedHtml() Retrieves the content of this reponse as parsed HTML. |
public String | getReason() Returns the error reason of this response. |
public int | getStatus() Returns the status code of this response. |
public Template | getTemplate() Retrieves the template instance that was printed to the response. |
public String | getText() Retrieves the content of this reponse as text. |
public PrintWriter | getWriter() |
public void | print(Template template) |
public void | removeHeader(String name) Removes a response header with the given name. |
public void | sendError(int statusCode) |
public void | sendError(int statusCode, String message) |
public void | setDateHeader(String name, long date) |
public void | setHeader(String name, String value) |
public void | setIntHeader(String name, int value) |
public void | setLocale(Locale locale) |
public void | setStatus(int statusCode) |
public void | validateAsXml() Validates the response as an XML document. |
public Boolean | xpathBoolean(String expression) Evaluate an XPath expression in the context of the response text and
return the result as a boolean.
exception: XPathExpressionException - if expression cannot be evaluated. |
public Boolean | xpathBoolean(String expression, Object context) Evaluate an XPath expression in the provided context object and
return the result as a boolean.
exception: XPathExpressionException - if expression cannot be evaluated. |
public Node | xpathNode(String expression) Evaluate an XPath expression in the context of the response text and
return the result as a DOM node.
exception: XPathExpressionException - if expression cannot be evaluated. |
public Node | xpathNode(String expression, Object context) Evaluate an XPath expression in the provided context object and
return the result as a DOM node.
exception: XPathExpressionException - if expression cannot be evaluated. |
public NodeList | xpathNodeSet(String expression) Evaluate an XPath expression in the context of the response text and
return the result as a list of DOM nodes.
More information about XPath can be found in the original specification or in this
tutorial.
exception: XPathExpressionException - if expression cannot be evaluated. |
public NodeList | xpathNodeSet(String expression, Object context) Evaluate an XPath expression in the provided context object and
return the result as a list of DOM nodes.
More information about XPath can be found in the original specification or in this
tutorial.
exception: XPathExpressionException - if expression cannot be evaluated. |
public Double | xpathNumber(String expression) Evaluate an XPath expression in the context of the response text and
return the result as a number.
exception: XPathExpressionException - if expression cannot be evaluated. |
public Double | xpathNumber(String expression, Object context) Evaluate an XPath expression in the provided context object and
return the result as a number.
exception: XPathExpressionException - if expression cannot be evaluated. |
public String | xpathString(String expression) Evaluate an XPath expression in the context of the response text and
return the result as a string.
exception: XPathExpressionException - if expression cannot be evaluated. |
public String | xpathString(String expression, Object context) Evaluate an XPath expression in the provided context object and
return the result as a string.
exception: XPathExpressionException - if expression cannot be evaluated. |