Class DOMDifferenceEngine

    • Constructor Detail

      • DOMDifferenceEngine

        public DOMDifferenceEngine()
        Creates a new DOMDifferenceEngine using the default DocumentBuilderFactory.
      • DOMDifferenceEngine

        public DOMDifferenceEngine​(javax.xml.parsers.DocumentBuilderFactory f)
        Creates a new DOMDifferenceEngine.

        The DocumentBuilderFactory is only used if the Source passed to compare(javax.xml.transform.Source, javax.xml.transform.Source) is not already a DOMSource.

        Parameters:
        f - DocumentBuilderFactory to use when creating a Document from the Sources to compare.
        Since:
        XMLUnit 2.7.0
    • Method Detail

      • setDocumentBuilderFactory

        public void setDocumentBuilderFactory​(javax.xml.parsers.DocumentBuilderFactory f)
        Deprecated.
        use the one-arg constructor instead
        Sets the DocumentBuilderFactory to use when creating a Document from the Sources to compare.

        This is only used if the Source passed to compare(javax.xml.transform.Source, javax.xml.transform.Source) is not already a DOMSource.

        Parameters:
        f - DocumentBuilderFactory to use when creating a Document from the Sources to compare.
        Since:
        XMLUnit 2.2.0
      • compare

        public void compare​(javax.xml.transform.Source control,
                            javax.xml.transform.Source test)
        Description copied from interface: DifferenceEngine
        Compares two pieces of XML and invokes the registered listeners.
        Parameters:
        control - the reference source of "good" XML
        test - the source under test to compare against control