Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.Diff.overrideDifferenceListener()


                    fail("skippedComparison shouldn't get invoked");
                }
            }, 1e-3);

        d = new Diff(control, test);
        d.overrideDifferenceListener(c);
        assertFalse(d.identical());
    }

}
View Full Code Here


                    return 1;
                }
            };

        Diff d = new Diff(control, test);
        d.overrideDifferenceListener(b);

        assertTrue(d.identical());

        for (int i = 0; i < invocations.length; i++) {
            assertEquals(1, invocations[i]);
View Full Code Here

                    return 1;
                }
            };

        Diff d = new Diff(control, test);
        d.overrideDifferenceListener(b);

        assertTrue(d.identical());
        assertEquals(4, invocations[0]);
    }
View Full Code Here

                        fail("skippedComparison shouldn't get invoked");
                    }
                }) {};

        Diff d = new Diff(control, test);
        d.overrideDifferenceListener(b);

        assertTrue(d.identical());
        assertEquals(4, invocations[0]);
    }
View Full Code Here

               Diff diff = XMLUnit.compareXML(Strings2.toString(a.getPayload()), Strings2
                        .toString(b.getPayload()));

               // Ignoring whitespace in elements that have other children, xsi:schemaLocation and
               // differences in namespace prefixes
               diff.overrideDifferenceListener(new DifferenceListener() {
                  @Override
                  public int differenceFound(Difference diff) {
                     if (diff.getId() == DifferenceConstants.SCHEMA_LOCATION_ID
                              || diff.getId() == DifferenceConstants.NAMESPACE_PREFIX_ID) {
                        return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
View Full Code Here

        final Diff diff = new Diff(expected.trim(), result.trim());
        final Diff myDiff = new DetailedDiff(diff);

        final AtomicInteger differenceNumber = new AtomicInteger(0); // just to get an int wrapper for the test
        myDiff.overrideDifferenceListener(new IgnoreTextAndAttributeValuesDifferenceListener() {
            @Override
            public int differenceFound(final Difference difference) {
                if (!difference.isRecoverable()) {
                    differenceNumber.incrementAndGet();
                    System.err.println(">>> " + difference.toString());
View Full Code Here

        final String result = JaxbOpenejbJar2.marshal(GeronimoEjbJarType.class, root);
        final String expected = readContent(getInputStream("geronimo-openejb-converted.xml"));

        final Diff myDiff = new DetailedDiff(new Diff(expected, result));
        final AtomicInteger differenceNumber = new AtomicInteger(0); // just to get an int wrapper for the test
        myDiff.overrideDifferenceListener(new DifferenceListener() {
            @Override
            public int differenceFound(final Difference difference) {
                if (!difference.isRecoverable()) {
                    differenceNumber.incrementAndGet();
                    System.err.println(">>> " + difference.toString());
View Full Code Here

        XMLUnit.setIgnoreComments(true);
        XMLUnit.setIgnoreWhitespace(true);
        XMLUnit.setIgnoreAttributeOrder(true);

        Diff diff = new Diff(aExpected, aActual);
        diff.overrideDifferenceListener(new DifferenceListener() {

            public void skippedComparison(Node aArg0, Node aArg1) {
            }

            public int differenceFound(Difference aDifference) {
View Full Code Here

        XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
        XMLUnit.setIgnoreWhitespace(true);
        XMLUnit.setIgnoreComments(true);

        Diff xmlDiff = new Diff(new InputStreamReader(expectedPageCode), new StringReader(pageCode));
        xmlDiff.overrideDifferenceListener(getDifferenceListener());

        if (!xmlDiff.similar()) {
            System.out.println("=== ACTUAL PAGE CODE ===");
            System.out.println(pageCode);
            System.out.println("======== ERROR =========");
View Full Code Here

        CompositeModel fragment_composite = _puller.pull(FRAGMENT_XML, getClass());
        CompositeModel merged_composite = Models.merge(fragment_composite, incomplete_composite);
        CompositeModel complete_composite = _puller.pull(COMPLETE_XML, getClass());
        XMLUnit.setIgnoreWhitespace(true);
        Diff diff = XMLUnit.compareXML(complete_composite.toString(), merged_composite.toString());
        diff.overrideDifferenceListener(new SchemaLocationDifferenceListener());
        assertTrue(diff.toString(), diff.identical());
    }

    @Test
    public void testReadCustomViaConfig() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.