Class ValidationMatcher

java.lang.Object
org.hamcrest.BaseMatcher
org.xmlunit.matchers.ValidationMatcher
All Implemented Interfaces:
org.hamcrest.Matcher, org.hamcrest.SelfDescribing

public class ValidationMatcher extends org.hamcrest.BaseMatcher
Hamcrest Matcher for XML Validation against W3C XML Schema using JAXPValidator.
  • Constructor Details

    • ValidationMatcher

      public ValidationMatcher(Object... schemaSource)
      Parameters:
      schemaSource - schema source document(s)
    • ValidationMatcher

      public ValidationMatcher(Schema schema)
      Parameters:
      schema - schema source document
      Since:
      XMLUnit 2.3.0
  • Method Details

    • matches

      public boolean matches(Object instance)
    • describeTo

      public void describeTo(org.hamcrest.Description description)
    • describeMismatch

      public void describeMismatch(Object item, org.hamcrest.Description mismatchDescription)
      Specified by:
      describeMismatch in interface org.hamcrest.Matcher
      Overrides:
      describeMismatch in class org.hamcrest.BaseMatcher
    • valid

      public static ValidationMatcher valid(Object schemaSource)
      Creates a matcher that validates the XML under test.
      Parameters:
      schemaSource - schema source document
      Returns:
      matcher
    • valid

      public static ValidationMatcher valid(Schema schema)
      Creates a matcher that validates the XML under test.
      Parameters:
      schema - schema source document
      Returns:
      matcher
      Since:
      XMLUnit 2.3.0