net.liftweb.http.testing

Response

trait Response extends AnyRef

A response returned from an HTTP request. Responses can be chained and tested in a for comprehension:


implicit val

for  {
   login <- post("/api/login", "user" -> "me", "pwd" -> "me") !@ "Failed to log in"
   info <- login.get("/api/info") if info.bodyAsString must_== "My Info"
   moreInfo <- info.post("/api/moreInfo", <info>Some Info</info>)
} moreInfoheaders("X-MyInfo") must_== List("hello", "goodbye")

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Response
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract type FuncType

  2. abstract type SelfType

Abstract Value Members

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

    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.

  2. abstract def !(msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  3. abstract def !@(msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  4. abstract def !\(label: String, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  5. abstract def !\(node: Node, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  6. abstract def !\\(label: String, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  7. abstract def !\\(node: Node, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  8. abstract def \(label: String, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  9. abstract def \(node: Node, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  10. abstract def \\(label: String, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  11. abstract def \\(node: Node, msg: ⇒ String)(implicit errorFunc: ReportFailure): SelfType

    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.

  12. abstract def filter(f: (FuncType) ⇒ Unit): FuncType

    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)

  13. abstract def foreach(f: (FuncType) ⇒ Unit): Unit

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

  14. abstract def headers: Map[String, List[String]]

    The response headers

  15. abstract def xml: Box[Elem]

    The XML for the body

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  18. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped