类 XmlExpectationsHelper

java.lang.Object
cn.taketoday.test.util.XmlExpectationsHelper

public class XmlExpectationsHelper extends Object
A helper class for assertions on XML content.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 构造器详细资料

    • XmlExpectationsHelper

      public XmlExpectationsHelper()
  • 方法详细资料

    • assertNode

      public void assertNode(String content, org.hamcrest.Matcher<? super Node> matcher) throws Exception
      Parse the content as Node and apply a Matcher.
      抛出:
      Exception
    • parseXmlString

      private Document parseXmlString(String xml) throws Exception
      抛出:
      Exception
    • assertSource

      public void assertSource(String content, org.hamcrest.Matcher<? super Source> matcher) throws Exception
      Parse the content as DOMSource and apply a Matcher.
      抛出:
      Exception
      另请参阅:
    • assertXmlEqual

      public void assertXmlEqual(String expected, String actual) throws Exception
      Parse the expected and actual content strings as XML and assert that the two are "similar" -- i.e. they contain the same elements and attributes regardless of order.

      Use of this method assumes the XMLUnit library is available.

      参数:
      expected - the expected XML content
      actual - the actual XML content
      抛出:
      Exception