Package org.xmlunit.matchers
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.BaseMatcherHamcrest Matcher for XML Validation against W3C XML Schema usingJAXPValidator.
-
-
Constructor Summary
Constructors Constructor Description ValidationMatcher(java.lang.Object... schemaSource)ValidationMatcher(javax.xml.validation.Schema schema)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddescribeMismatch(java.lang.Object item, org.hamcrest.Description mismatchDescription)voiddescribeTo(org.hamcrest.Description description)booleanmatches(java.lang.Object instance)static ValidationMatchervalid(java.lang.Object schemaSource)Creates a matcher that validates the XML under test.static ValidationMatchervalid(javax.xml.validation.Schema schema)Creates a matcher that validates the XML under test.
-
-
-
Method Detail
-
matches
public boolean matches(java.lang.Object instance)
-
describeTo
public void describeTo(org.hamcrest.Description description)
-
describeMismatch
public void describeMismatch(java.lang.Object item, org.hamcrest.Description mismatchDescription)- Specified by:
describeMismatchin interfaceorg.hamcrest.Matcher- Overrides:
describeMismatchin classorg.hamcrest.BaseMatcher
-
valid
public static ValidationMatcher valid(java.lang.Object schemaSource)
Creates a matcher that validates the XML under test.- Parameters:
schemaSource- schema source document- Returns:
- matcher
-
valid
public static ValidationMatcher valid(javax.xml.validation.Schema schema)
Creates a matcher that validates the XML under test.- Parameters:
schema- schema source document- Returns:
- matcher
- Since:
- XMLUnit 2.3.0
-
-