Class ValidationAssert

  • All Implemented Interfaces:
    org.assertj.core.api.Assert<ValidationAssert,​javax.xml.transform.Source>, org.assertj.core.api.Descriptable<ValidationAssert>, org.assertj.core.api.ExtensionPoints<ValidationAssert,​javax.xml.transform.Source>

    public class ValidationAssert
    extends org.assertj.core.api.AbstractAssert<ValidationAssert,​javax.xml.transform.Source>
    Assertion methods for XML validation.

    Simple Example

     import static org.xmlunit.assertj.XmlAssert.assertThat;
    
     final String xml = "<a><b attr=\"abc\"></b></a>";
    
     assertThat(xml).isValid();
     
    Since:
    XMLUnit 2.8.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.xml.validation.Schema schema  
      private javax.xml.transform.Source[] schemaSources  
      • Fields inherited from class org.assertj.core.api.AbstractAssert

        actual, info, myself, objects, throwUnsupportedExceptionOnEquals
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ValidationAssert​(javax.xml.transform.Source actual, javax.xml.transform.Source[] schemaSources, javax.xml.validation.Schema schema)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static ValidationAssert create​(java.lang.Object xmlSource, javax.xml.validation.Schema schema, XmlAssertConfig config)  
      (package private) static ValidationAssert create​(java.lang.Object xmlSource, XmlAssertConfig config)  
      (package private) static ValidationAssert create​(java.lang.Object xmlSource, XmlAssertConfig config, java.lang.Object... schemaSources)  
      void isInvalid()
      Verifies that actual value is not valid against given schema
      ValidationAssert isValid()
      Verifies that actual value is valid against given schema
      private ValidationResult validate()  
      • Methods inherited from class org.assertj.core.api.AbstractAssert

        areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.assertj.core.api.Descriptable

        as, as, as, describedAs
    • Field Detail

      • schemaSources

        private final javax.xml.transform.Source[] schemaSources
      • schema

        private final javax.xml.validation.Schema schema
    • Constructor Detail

      • ValidationAssert

        private ValidationAssert​(javax.xml.transform.Source actual,
                                 javax.xml.transform.Source[] schemaSources,
                                 javax.xml.validation.Schema schema)
    • Method Detail

      • isValid

        public ValidationAssert isValid()
        Verifies that actual value is valid against given schema
        Returns:
        this
        Throws:
        java.lang.AssertionError - if the actual value is not valid against schema
      • isInvalid

        public void isInvalid()
        Verifies that actual value is not valid against given schema
        Throws:
        java.lang.AssertionError - if the actual value is valid against schema