Class XmlTestSupport

Object
XmlTestSupport

public abstract class XmlTestSupport extends Object
  • Constructor Details

    • XmlTestSupport

      public XmlTestSupport()
  • Method Details

    • getNamespaces

      protected Map<String,String> getNamespaces()
      Get the namespaces needed for this test class.
      Returns:
      the namespaces needed for this test class.
    • Namespace

      public static XmlTestSupport.Namespace Namespace(String prefix, String uri)
      Construct a Namespace. Just a shortcut for new Namespace(String, String).
      Parameters:
      prefix - the namespace prefix.
      uri - the namespace URI.
      Returns:
      the Namespace.
    • namespaces

      public static Map<String,String> namespaces(XmlTestSupport.Namespace... namespaces)
      Construct a Map of Namespace(s).
      Parameters:
      namespaces - the namespaces.
      Returns:
      a namespaces map.
    • hasXPath

      protected EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> valueMatcher)
      Simply a wrapper around EvaluateXPathMatcher.hasXPath(String, Matcher) that sets the namespaces here, so that by omitting them from the assertions used in the tests, those assertions are more compact and hopefully more readable.
      Parameters:
      xPath - the xpath to evaluate
      valueMatcher - the result of the xpath evaluation to match
      Returns:
      an XPath Matcher
    • diffSimilar

      protected Diff diffSimilar(Object expected, Object actual)