Package org.custommonkey.xmlunit.examples

Examples of org.custommonkey.xmlunit.examples.MultiLevelElementNameAndTextQualifier


            + "  </book>"
            + "</books>";
        XMLUnit.setIgnoreWhitespace(true);
        try {
            Diff diff = new Diff(control, test);
            diff.overrideElementQualifier(new MultiLevelElementNameAndTextQualifier(2));
            DetailedDiff dd = new DetailedDiff(diff);
            List l = dd.getAllDifferences();
            assertEquals(3, l.size());
            // (0) number of children, (1) node not found, (2) order different
            Difference d = (Difference) l.get(1);
            assertEquals(DifferenceConstants.CHILD_NODE_NOT_FOUND_ID,
                         d.getId());
            assertEquals("/books[1]/book[1]",
                         d.getControlNodeDetail().getXpathLocation());
            assertNull("should be null but is "
                       + d.getTestNodeDetail().getXpathLocation(),
                       d.getTestNodeDetail().getXpathLocation());

            // and reverse
            diff = new Diff(test, control);
            diff.overrideElementQualifier(new MultiLevelElementNameAndTextQualifier(2));
            dd = new DetailedDiff(diff);
            l = dd.getAllDifferences();
            assertEquals(3, l.size());
            // (0) number of children, (1) order different, (2) node not found
            d = (Difference) l.get(2);
View Full Code Here


     * @param controlDocument XML document that contains expected results
     * @param testedDocument XML document which is being tested
     */
    public DiffWithMultiLevelQualifier(Document controlDocument, Document testedDocument) {
        super(controlDocument, testedDocument);
        this.overrideElementQualifier(new MultiLevelElementNameAndTextQualifier(2));
        this.overrideDifferenceListener(new DifferenceListenerIgnoreWhitespace());
    }
View Full Code Here

TOP

Related Classes of org.custommonkey.xmlunit.examples.MultiLevelElementNameAndTextQualifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.