Class

net.liftweb.http.testing

BaseResponse

Related Doc: package testing

Permalink

abstract class BaseResponse extends Response with BaseGetPoster with GetPosterHelper

The response to an HTTP request, as long as the server responds with *SOMETHING*

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BaseResponse
  2. GetPosterHelper
  3. BaseGetPoster
  4. Response
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BaseResponse(baseUrl: String, code: Int, msg: String, headers: Map[String, List[String]], body: Box[Array[Byte]], theHttpClient: HttpClient)

    Permalink

Type Members

  1. abstract type FuncType

    Permalink
    Definition Classes
    Response
  2. abstract type ResponseType

    Permalink
    Definition Classes
    BaseGetPoster
  3. abstract type SelfType

    Permalink
    Definition Classes
    Response

Value Members

  1. def !(code: Int, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server gave a particular response code.

    Test that the server gave a particular response code. If the response is not a 200, call the errorFunc with the msg

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  2. def !(msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server gave a response.

    Test that the server gave a response. If the server failed to respond, call the errorFunc with the msg

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  3. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def !@(msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test the response as a 200.

    Test the response as a 200. If the response is not a 200, call the errorFunc with the msg

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  5. def !\(label: String, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server response does not contain a node with a particular label as a direct child.

    Test that the server response does not contain a node with a particular label as a direct child. If the response does contain valid xml and does contain the node, call the errorFunc with the msg

    label

    the label for the XML node to search for in the response

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  6. def !\(node: Node, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server response does not contain a particular node as a direct child with the exact attributes and children.

    Test that the server response does not contain a particular node as a direct child with the exact attributes and children. If the response does contain valid xml and does contain the exact node, call the errorFunc with the msg.

    node

    the XML node to search for in the response

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  7. def !\\(label: String, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server response does not contain a node with a particular label anywhere in the xml.

    Test that the server response does not contain a node with a particular label anywhere in the xml. If the response does contain valid xml and does contain the node, call the errorFunc with the msg

    label

    the label for the XML node to search for in the response

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  8. def !\\(node: Node, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server response does not contain a particular node anywhere in the xml with the exact attributes and children.

    Test that the server response does not contain a particular node anywhere in the xml with the exact attributes and children. If the response does contain valid xml and does contain the exact node, call the errorFunc with the msg.

    node

    the XML node to search for in the response

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  9. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  10. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def \(label: String, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server response contains a node with a particular label as a direct child.

    Test that the server response contains a node with a particular label as a direct child. If the response does not contain valid xml or does not contain the node, call the errorFunc with the msg

    label

    the label for the XML node to search for in the response

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  12. def \(node: Node, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server response contains a particular node as a direct child with the exact attributes and children.

    Test that the server response contains a particular node as a direct child with the exact attributes and children. If the response does not contain valid xml or does not contain the exact node, call the errorFunc with the msg.

    node

    the XML node to search for in the response

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  13. def \\(label: String, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server response contains a node with a particular label anywhere in the xml.

    Test that the server response contains a node with a particular label anywhere in the xml. If the response does not contain valid xml or does not contain the node, call the errorFunc with the msg

    label

    the label for the XML node to search for in the response

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  14. def \\(node: Node, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    Permalink

    Test that the server response contains a particular node anywhere in the xml with the exact attributes and children.

    Test that the server response contains a particular node anywhere in the xml with the exact attributes and children. If the response does not contain valid xml or does not contain the exact node, call the errorFunc with the msg.

    node

    the XML node to search for in the response

    msg

    the String to report as an error

    errorFunc

    the error reporting thing.

    Definition Classes
    BaseResponseResponse
  15. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  16. val baseUrl: String

    Permalink

    The base URL for all requests

    The base URL for all requests

    Definition Classes
    BaseResponseBaseGetPoster
  17. val body: Box[Array[Byte]]

    Permalink
  18. lazy val bodyAsString: Box[String]

    Permalink

    The response body as a UTF-8 encoded String

  19. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. val code: Int

    Permalink
  21. lazy val contentType: String

    Permalink

    The content type header of the response

  22. def delete(url: String, params: (String, Any)*)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP DELETE with a newly minted httpClient

    Perform an HTTP DELETE with a newly minted httpClient

    url

    the URL to make the request on

    params

    the parameters to pass

    Definition Classes
    GetPosterHelper
  23. def delete(url: String, httpClient: HttpClient, headers: List[(String, String)], faux_params: (String, Any)*)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP DELETE

    Perform an HTTP DELETE

    url

    - the URL to append to the baseUrl

    headers

    - any additional headers to include with the request

    faux_params

    - the request parameters to include with the request

    Definition Classes
    BaseGetPoster
  24. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  26. def filter(f: (FuncType) ⇒ Unit): FuncType

    Permalink

    the Response has a filter method for chaining in a for comprehension.

    the Response has a filter method for chaining in a for comprehension. Note that the filter method does *NOT* have to return a Boolean, any expression (e.g., an assertion)

    Definition Classes
    BaseResponseResponse
  27. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. def foreach(f: (FuncType) ⇒ Unit): Unit

    Permalink

    the Response has a foreach method for chaining in a for comprehension

    the Response has a foreach method for chaining in a for comprehension

    Definition Classes
    BaseResponseResponse
  29. def get(url: String, params: (String, Any)*)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP GET with a newly minted httpClient

    Perform an HTTP GET with a newly minted httpClient

    url

    the URL to make the request on

    params

    the parameters to pass

    Definition Classes
    GetPosterHelper
  30. def get(url: String, httpClient: HttpClient, headers: List[(String, String)], faux_params: (String, Any)*)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP GET

    Perform an HTTP GET

    url

    - the URL to append to the baseUrl

    headers

    - any additional headers to include with the request

    faux_params

    - the request parameters to include with the request

    Definition Classes
    BaseGetPoster
  31. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  32. def getOrFail(success: Boolean, msg: String, errorFunc: ReportFailure): SelfType

    Permalink
  33. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  34. val headers: Map[String, List[String]]

    Permalink

    The response headers

    The response headers

    Definition Classes
    BaseResponseResponse
  35. lazy val html5AsXml: Box[Elem]

    Permalink
  36. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  37. implicit def jsonToRequestEntity(body: JValue): RequestEntity

    Permalink
    Definition Classes
    BaseGetPoster
  38. val msg: String

    Permalink
  39. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. def post(url: String, body: Array[Byte], contentType: String)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP POST with a newly minted httpClient

    Perform an HTTP POST with a newly minted httpClient

    url

    the URL to make the request on

    body

    the bytes to POST to the server

    contentType

    the content type of the message

    Definition Classes
    GetPosterHelper
  43. def post[RT](url: String, xml: RT)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType, bodyToRequestEntity: (RT) ⇒ RequestEntity): ResponseType

    Permalink

    Perform an HTTP POST with a newly minted httpClient

    Perform an HTTP POST with a newly minted httpClient

    url

    the URL to make the request on

    xml

    the XML to POST to the server

    Definition Classes
    GetPosterHelper
  44. def post(url: String, params: (String, Any)*)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP POST with a newly minted httpClient

    Perform an HTTP POST with a newly minted httpClient

    url

    the URL to make the request on

    params

    the parameters to pass

    Definition Classes
    GetPosterHelper
  45. def post(url: String, httpClient: HttpClient, headers: List[(String, String)], body: Array[Byte], contentType: String)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP POST with a pile of bytes in the body

    Perform an HTTP POST with a pile of bytes in the body

    url

    - the URL to append to the baseUrl

    headers

    - any additional headers to include with the request

    body

    - the pile of bytes to POST to the target server

    contentType

    - the content type of the pile of bytes

    Definition Classes
    BaseGetPoster
  46. def post[RT](url: String, httpClient: HttpClient, headers: List[(String, String)], body: RT)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType, bodyToRequestEntity: (RT) ⇒ RequestEntity): ResponseType

    Permalink

    Perform an HTTP POST with an XML body

    Perform an HTTP POST with an XML body

    url

    - the URL to append to the baseUrl

    headers

    - any additional headers to include with the request

    body

    - the xml to post

    Definition Classes
    BaseGetPoster
  47. def post(url: String, httpClient: HttpClient, headers: List[(String, String)], faux_params: (String, Any)*)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP POST

    Perform an HTTP POST

    url

    - the URL to append to the baseUrl

    headers

    - any additional headers to include with the request

    faux_params

    - the request parameters to include with the request

    Definition Classes
    BaseGetPoster
  48. def put(url: String, body: Array[Byte], contentType: String)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP POST with a newly minted httpClient

    Perform an HTTP POST with a newly minted httpClient

    url

    the URL to make the request on

    body

    the bytes to POST to the server

    contentType

    the content type of the message

    Definition Classes
    GetPosterHelper
  49. def put[RT](url: String, xml: RT)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType, bodyToRequestEntity: (RT) ⇒ RequestEntity): ResponseType

    Permalink

    Perform an HTTP PUT with a newly minted httpClient

    Perform an HTTP PUT with a newly minted httpClient

    url

    the URL to make the request on

    xml

    the XML to PUT to the server

    Definition Classes
    GetPosterHelper
  50. def put(url: String, httpClient: HttpClient, headers: List[(String, String)], body: Array[Byte], contentType: String)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP PUT with a pile of bytes in the body

    Perform an HTTP PUT with a pile of bytes in the body

    url

    - the URL to append to the baseUrl

    headers

    - any additional headers to include with the request

    body

    - the pile of bytes to POST to the target server

    contentType

    - the content type of the pile of bytes

    Definition Classes
    BaseGetPoster
  51. def put[RT](url: String, httpClient: HttpClient, headers: List[(String, String)], body: RT)(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType, bodyToRequestEntity: (RT) ⇒ RequestEntity): ResponseType

    Permalink

    Perform an HTTP PUT with an XML body

    Perform an HTTP PUT with an XML body

    url

    - the URL to append to the baseUrl

    headers

    - any additional headers to include with the request

    body

    - the xml to post

    Definition Classes
    BaseGetPoster
  52. def put(url: String, httpClient: HttpClient, headers: List[(String, String)])(implicit capture: (String, HttpClient, HttpMethodBase) ⇒ ResponseType): ResponseType

    Permalink

    Perform an HTTP PUT

    Perform an HTTP PUT

    url

    - the URL to append to the baseUrl

    headers

    - any additional headers to include with the request

    Definition Classes
    BaseGetPoster
  53. def slurpApacheHeaders(in: Array[Header]): Map[String, List[String]]

    Permalink
    Attributes
    protected
    Definition Classes
    BaseGetPoster
  54. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  55. val theHttpClient: HttpClient

    Permalink

    Create the HTTP client for a new get/post request

    Create the HTTP client for a new get/post request

    Definition Classes
    BaseResponseGetPosterHelper
  56. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  57. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. def withFilter(f: (FuncType) ⇒ Unit): FuncType

    Permalink
  61. lazy val xml: Box[Elem]

    Permalink

    Get the body of the response as XML

    Get the body of the response as XML

    Definition Classes
    BaseResponseResponse
  62. def xmlMatch(findFunc: (Elem) ⇒ NodeSeq, filterFunc: (Node) ⇒ Boolean): Boolean

    Permalink
  63. implicit def xmlToRequestEntity(body: NodeSeq): RequestEntity

    Permalink
    Definition Classes
    BaseGetPoster

Inherited from GetPosterHelper

Inherited from BaseGetPoster

Inherited from Response

Inherited from AnyRef

Inherited from Any

Ungrouped