Examples of overrideDifferenceListener()


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

  private void compareValues( String expandedContent, String expandedValue, XmlObject object ) throws Exception
  {
    Diff diff = new Diff( expandedContent, expandedValue );
    InternalDifferenceListener internalDifferenceListener = new InternalDifferenceListener();
    diff.overrideDifferenceListener( internalDifferenceListener );

    if( !diff.identical() )
      throw new Exception( diff.toString() );

    StringList nodesToRemove = internalDifferenceListener.getNodesToRemove();
View Full Code Here

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

  }

  private void compareValues( String expandedContent, String expandedValue ) throws Exception
  {
    Diff diff = new Diff( expandedContent, expandedValue );
    diff.overrideDifferenceListener( new DifferenceListener()
    {

      public int differenceFound( Difference diff )
      {
        if( allowWildcards
View Full Code Here

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

                    public void skippedComparison(Node c, Node t) {
                        fail("skippedComparison shouldn't get invoked");
                    }
                });

        d.overrideDifferenceListener(c);
        assertTrue(d.identical());
    }

    private static String getDoc(String attr, String cdata, String comment,
                                 String text) {
View Full Code Here

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

                    public void skippedComparison(Node c, Node t) {
                        fail("skippedComparison shouldn't get invoked");
                    }
                }, 1e-2);

        d.overrideDifferenceListener(c);
        assertTrue(d.identical());

        c = new FloatingPointTolerantDifferenceListener(new DifferenceListener() {
                public int differenceFound(Difference d) {
                    fail("differenceFound shouldn't get invoked, but"
View Full Code Here

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

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

                    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

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

                    return 1;
                }
            };

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

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

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

                        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

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

               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

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

        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
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.