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.BaseMatcher
Hamcrest Matcher for XML Validation against W3C XML Schema usingJAXPValidator
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ValidationMatcher.HasSystemIdPredicate
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.transform.Source
instance
private ValidationResult
result
private javax.xml.validation.Schema
schema
private javax.xml.transform.Source[]
schemaSource
-
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 void
describeMismatch(java.lang.Object item, org.hamcrest.Description mismatchDescription)
void
describeTo(org.hamcrest.Description description)
boolean
matches(java.lang.Object instance)
static ValidationMatcher
valid(java.lang.Object schemaSource)
static ValidationMatcher
valid(javax.xml.validation.Schema schema)
-
-
-
Field Detail
-
schemaSource
private final javax.xml.transform.Source[] schemaSource
-
schema
private final javax.xml.validation.Schema schema
-
instance
private javax.xml.transform.Source instance
-
result
private ValidationResult result
-
-
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:
describeMismatch
in interfaceorg.hamcrest.Matcher
- Overrides:
describeMismatch
in classorg.hamcrest.BaseMatcher
-
valid
public static ValidationMatcher valid(java.lang.Object schemaSource)
-
valid
public static ValidationMatcher valid(javax.xml.validation.Schema schema)
- Since:
- XMLUnit 2.3.0
-
-