Class XmlAssertions


  • public class XmlAssertions
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertXmlEqual​(java.lang.String expectedXml, java.lang.String actualXml)
      Asserts that two XML snippets are equal.
      static void assertXmlEqual​(java.lang.String message, java.lang.String expectedXml, java.lang.String actualXml)
      Asserts that two XML snippets are equal.
      static void assertXmlEqual​(java.lang.String message, java.lang.String expectedXml, java.lang.String actualXml, java.lang.String transformation)
      Asserts that two XML snippets are equal.
      static void assertXPathEvaluatesTo​(java.lang.String message, java.lang.String targetXml, java.lang.String xPathExpression, java.lang.String expectedValue)
      Asserts that the given XPath expression evaluates to the expected value when applied to the target XML.
      static void assertXPathEvaluatesTo​(java.lang.String message, java.lang.String targetXml, java.lang.String xPathExpression, java.lang.String expectedValue, java.lang.String transformation)
      Asserts that the given XPath expression evaluates to the expected value when applied to the target XML.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • assertXPathEvaluatesTo

        public static void assertXPathEvaluatesTo​(java.lang.String message,
                                                  java.lang.String targetXml,
                                                  java.lang.String xPathExpression,
                                                  java.lang.String expectedValue)
        Asserts that the given XPath expression evaluates to the expected value when applied to the target XML.
        Parameters:
        message - failure message
        targetXml - the target XML to apply the XPath expression to
        xPathExpression - the XPath expression to apply
        expectedValue - the expected value
      • assertXPathEvaluatesTo

        public static void assertXPathEvaluatesTo​(java.lang.String message,
                                                  java.lang.String targetXml,
                                                  java.lang.String xPathExpression,
                                                  java.lang.String expectedValue,
                                                  java.lang.String transformation)
        Asserts that the given XPath expression evaluates to the expected value when applied to the target XML. Before comparing the given XSL transformation is applied to the expected value as well as the targetXml.
        Parameters:
        message - failure message
        targetXml - the target XML to apply the XPath expression to
        xPathExpression - the XPath expression to apply
        expectedValue - the expected value
        transformation - resource path to an XML transformation to be applied to both expected value and target XML
      • assertXmlEqual

        public static void assertXmlEqual​(java.lang.String message,
                                          java.lang.String expectedXml,
                                          java.lang.String actualXml)
        Asserts that two XML snippets are equal.
        Parameters:
        message - failure message
        expectedXml - the expected XML (snippet)
        actualXml - the actual XML (snippet)
      • assertXmlEqual

        public static void assertXmlEqual​(java.lang.String message,
                                          java.lang.String expectedXml,
                                          java.lang.String actualXml,
                                          java.lang.String transformation)
        Asserts that two XML snippets are equal. Before comparing the given XSL transformation is applied to the expected as well as the actual XML.
        Parameters:
        message - failure message
        expectedXml - the expected XML (snippet)
        actualXml - the actual XML (snippet)
        transformation - resource path to an XML transformation to be applied to both expected and actual XML
      • assertXmlEqual

        public static void assertXmlEqual​(java.lang.String expectedXml,
                                          java.lang.String actualXml)
        Asserts that two XML snippets are equal.
        Parameters:
        expectedXml - the expected XML
        actualXml - the actual XML