org.specs2.matcher

XmlMatcher

case class XmlMatcher(functions: Seq[PathFunction]) extends Matcher[Seq[Node]] with Product with Serializable

The XmlMatcher class matches an xml Node, or a list of Nodes against a list of search functions, which can either search for:

XmlMatchers can be "chained" by using the \ or the \\ methods. In that case, the resulting matcher has a new search function which tries to match the result of the preceding function. For example

 must \\("c").\("d")
will be ok.

Linear Supertypes
Serializable, Serializable, Product, Equals, Matcher[Seq[Node]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. XmlMatcher
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Matcher
  7. AnyRef
  8. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new XmlMatcher(functions: Seq[PathFunction])

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. def \(label: String, attributeValues: (String, String), attributeValues2: (String, String)*): XmlMatcher

  7. def \(label: String, attributeNames: String*): XmlMatcher

    alias for \ using the node label only

  8. def \(node: Node, attributeValues: (String, String), attributeValues2: (String, String)*): XmlMatcher

  9. def \(node: Node, attributeNames: String*): XmlMatcher

  10. def \>(t: String): XmlMatcher

    alias for textIs

  11. def \>~(t: String): XmlMatcher

    alias for textMatches

  12. def \\(label: String, attributeValues: (String, String), attributeValues2: (String, String)*): XmlMatcher

  13. def \\(label: String, attributeNames: String*): XmlMatcher

    alias for \\ using the node label only

  14. def \\(node: Node, attributeValues: (String, String), attributeValues2: (String, String)*): XmlMatcher

  15. def \\(node: Node, attributeNames: String*): XmlMatcher

  16. def ^^[S](f: (S) ⇒ Expectable[Seq[Node]], dummy: Int): Matcher[S]

    Adapt a matcher to another.

    Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage aka "trimmed") can be applied to an exception

    The dummy value is used to help to disambiguate with the overloaded ^^ function

    Definition Classes
    Matcher
  17. def ^^[S](f: (S) ⇒ Seq[Node]): Matcher[S]

    Adapt a matcher to another.

    Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage) can be applied to an exception

    Definition Classes
    Matcher
  18. def and[S <: Seq[Node]](m: ⇒ Matcher[S]): Matcher[S]

    the logical and between 2 matchers

    the logical and between 2 matchers

    Definition Classes
    Matcher
    See also

    MatchResult.and

  19. def apply[S <: Seq[Node]](n: Expectable[S]): MatchResult[S]

    checks that the nodes satisfy the functions

    checks that the nodes satisfy the functions

    returns

    a MatchResult describing the outcome of the match

    Definition Classes
    XmlMatcherMatcher
  20. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  21. def atLeastOnce: Matcher[Traversable[Seq[Node]]]

    returns

    a Matcher matching at least one element of a sequence against the current matcher

    Definition Classes
    Matcher
  22. def canEqual(arg0: Any): Boolean

    Definition Classes
    XmlMatcher → Equals
  23. def checkFunctions(pathFunctions: Seq[PathFunction], nodes: Seq[Node], messages: (Boolean, String, String)): (Boolean, String, String)

    checks that the nodes satisfy the functions

    checks that the nodes satisfy the functions

    returns

    a MatcherResult

  24. def clone(): AnyRef

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

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

    Definition Classes
    XmlMatcher → Equals → AnyRef → Any
  27. def eventually(retries: Int, sleep: Duration): Matcher[Seq[Node]]

    returns

    a matcher that needs to eventually match, after a given number of retries and a sleep time

    Definition Classes
    Matcher
  28. def eventually: Matcher[Seq[Node]]

    returns

    a matcher that needs to eventually match, after 40 retries and a sleep time of 100 milliseconds

    Definition Classes
    Matcher
  29. def exactly: XmlMatcher

    do an exact match on attributes and attributes values

  30. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. def forall: Matcher[Traversable[Seq[Node]]]

    returns

    a Matcher matching all the elements of a sequence against the current matcher, stopping after the first failure

    Definition Classes
    Matcher
  32. def foreach: Matcher[Traversable[Seq[Node]]]

    returns

    a Matcher matching all the elements of a sequence against the current matcher, cumulating all failures

    Definition Classes
    Matcher
  33. val functions: Seq[PathFunction]

  34. final def getClass(): java.lang.Class[_]

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

    Definition Classes
    XmlMatcher → AnyRef → Any
  36. def iff(b: Boolean): Matcher[Seq[Node]]

    when the condition is true the matcher is applied, when it's false, the matcher must fail

    when the condition is true the matcher is applied, when it's false, the matcher must fail

    Definition Classes
    Matcher
  37. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  38. def lazily: Matcher[() ⇒ Seq[Node]]

    The lazily operator returns a Matcher which will match a function returning the expected value

    The lazily operator returns a Matcher which will match a function returning the expected value

    Definition Classes
    Matcher
  39. def mute: Matcher[Seq[Node]]

    returns

    a Matcher with no messages

    Definition Classes
    Matcher
  40. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  41. def not: Matcher[Seq[Node]]

    negate a Matcher

    negate a Matcher

    Definition Classes
    Matcher
    See also

    MatchResult.not

  42. final def notify(): Unit

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

    Definition Classes
    AnyRef
  44. def or[S <: Seq[Node]](m: ⇒ Matcher[S]): Matcher[S]

    the logical or between 2 matchers

    the logical or between 2 matchers

    Definition Classes
    Matcher
    See also

    MatchResult.or

  45. def orPending(message: (String) ⇒ String): Matcher[Seq[Node]]

    returns

    a Pending MatchResult if this matcher fails, modifying the failure message with a pending message.

    Definition Classes
    Matcher
  46. def orPending(m: String): Matcher[Seq[Node]]

    returns

    a Pending MatchResult if this matcher fails, prefixing the failure message with a pending message. If the pending message is empty, only the failure message is printed

    Definition Classes
    Matcher
  47. def orPending: Matcher[Seq[Node]]

    returns

    a Pending MatchResult if this matcher fails

    Definition Classes
    Matcher
  48. def orSkip(message: (String) ⇒ String): Matcher[Seq[Node]]

    returns

    a Skip MatchResult if this matcher fails, modifying the failure message with a skip message.

    Definition Classes
    Matcher
  49. def orSkip(m: String): Matcher[Seq[Node]]

    returns

    a Skip MatchResult if this matcher fails, prefixing the failure message with a skip message. If the skip message is empty, only the failure message is printed

    Definition Classes
    Matcher
  50. def orSkip: Matcher[Seq[Node]]

    returns

    a Skip MatchResult if this matcher fails

    Definition Classes
    Matcher
  51. def productArity: Int

    Definition Classes
    XmlMatcher → Product
  52. def productElement(arg0: Int): Any

    Definition Classes
    XmlMatcher → Product
  53. def productIterator: Iterator[Any]

    Definition Classes
    Product
  54. def productPrefix: String

    Definition Classes
    XmlMatcher → Product
  55. def result[S <: Seq[Node]](other: MatchResultMessage, value: Expectable[S]): MatchResult[S]

    returns

    a MatchResult using the messages embedded in a MatchResultMessage (i.e. an accumulation of messages from other matches)

    Attributes
    protected
    Definition Classes
    Matcher
  56. def result[S <: Seq[Node]](other: org.specs2.matcher.MatchResult[_], value: Expectable[S]): MatchResult[S]

    returns

    a MatchResult copied on another one, but with a different expectable

    Attributes
    protected
    Definition Classes
    Matcher
  57. def result[S <: Seq[Node]](test: ⇒ Boolean, okMessage: ⇒ String, koMessage: ⇒ String, value: Expectable[S], expected: String, actual: String): MatchResult[S]

    This convenience method can be used to evaluate a boolean condition and return an appropriate MatchResult

    This convenience method can be used to evaluate a boolean condition and return an appropriate MatchResult

    returns

    a MatchResult with an okMessage, a koMessage, the expectable value and the expected/actual values as string to display a failure comparison if necessary

    Attributes
    protected
    Definition Classes
    Matcher
  58. def result[S <: Seq[Node]](triplet: ⇒ (Boolean, String, String), value: Expectable[S]): MatchResult[S]

    This convenience method uses a triplet instead of separated arguments

    This convenience method uses a triplet instead of separated arguments

    returns

    a MatchResult with an okMessage, a koMessage and the expectable value

    Attributes
    protected
    Definition Classes
    Matcher
  59. def result[S <: Seq[Node]](test: ⇒ Boolean, okMessage: ⇒ String, koMessage: ⇒ String, value: Expectable[S]): MatchResult[S]

    This convenience method can be used to evaluate a boolean condition and return an appropriate MatchResult

    This convenience method can be used to evaluate a boolean condition and return an appropriate MatchResult

    returns

    a MatchResult with an okMessage, a koMessage and the expectable value

    Attributes
    protected
    Definition Classes
    Matcher
  60. def setMessage(message: String): Matcher[Seq[Node]]

    returns

    set a new failure message of a matcher

    Definition Classes
    Matcher
  61. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  62. def test: (Seq[Node]) ⇒ Boolean

    returns

    a test function corresponding to this matcher

    Definition Classes
    Matcher
  63. def textIs(t: String): XmlMatcher

    specify the value of the node text

  64. def textMatches(regexp: String): XmlMatcher

    specify the value of the node text

  65. def toString(): String

    Definition Classes
    XmlMatcher → AnyRef → Any
  66. def unless(b: Boolean, m: String = ""): Matcher[Seq[Node]]

    only apply this matcher if the condition is false

    only apply this matcher if the condition is false

    Definition Classes
    Matcher
  67. def updateMessage(f: (String) ⇒ String): Matcher[Seq[Node]]

    returns

    update the failure message of a matcher

    Definition Classes
    Matcher
  68. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  71. def when(b: Boolean, m: String = ""): Matcher[Seq[Node]]

    only apply this matcher if the condition is true

    only apply this matcher if the condition is true

    Definition Classes
    Matcher

Deprecated Value Members

  1. def productElements: Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    (Since version 2.8.0) use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Matcher[Seq[Node]]

Inherited from AnyRef

Inherited from Any