Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.DifferenceListener


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

        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(Difference difference) {
                if (!difference.isRecoverable()) {
                    differenceNumber.incrementAndGet();
                    System.err.println(">>> " + difference.toString());
View Full Code Here


      serializer.output(expectedXml, sw);
      String expectedStr = sw.toString();
     
      //get the file name in case of a failure
      FitsMetadataElement item = fitsOut.getMetadataElement("filename");
        DifferenceListener myDifferenceListener = new IgnoreAttributeValuesDifferenceListener();
        Diff diff = new Diff(expectedStr,actualStr);
        diff.overrideDifferenceListener(myDifferenceListener);

        if(diff.similar()) {
          System.out.println("PASS: "+item.getValue());
View Full Code Here

            XMLUnit.setNormalizeWhitespace( true );
           
            Diff diff = XMLUnit.compareXML( expected, actual );
           
            diff.overrideDifferenceListener( new DifferenceListener()
            {
               
                public void skippedComparison( Node arg0, Node arg1 )
                {
                    //do nothing
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

  }

  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

                             CMMT.toUpperCase(Locale.US),
                             TEXT.toUpperCase(Locale.US));
        Diff d = new Diff(control, test);

        CaseInsensitiveDifferenceListener c =
            new CaseInsensitiveDifferenceListener(new DifferenceListener() {
                    public int differenceFound(Difference d) {
                        fail("differenceFound shouldn't get invoked, but"
                             + " was with type " + d.getId());
                        return -42;
                    }
View Full Code Here

        String control = "<foo value=\"2.718281828\"/>";
        String test = "<foo value=\"2.71\"/>";
        Diff d = new Diff(control, test);

        FloatingPointTolerantDifferenceListener c =
            new FloatingPointTolerantDifferenceListener(new DifferenceListener() {
                    public int differenceFound(Difference d) {
                        fail("differenceFound shouldn't get invoked, but"
                             + " was with type " + d.getId());
                        return -42;
                    }
                    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"
                         + " was with type " + d.getId());
                    return -42;
                }
View Full Code Here

        String control = getDoc(C_ATTR, C_CDATA, C_CMMT, C_TEXT);
        String test = getDoc(T_ATTR, T_CDATA, T_CMMT, T_TEXT);

        TextDifferenceListenerBase b =
            new TextDifferenceListenerBase(new DifferenceListener() {
                    public int differenceFound(Difference d) {
                        invocations[0]++;
                        return 1;
                    }
                    public void skippedComparison(Node c, Node t) {
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 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

TOP

Related Classes of org.custommonkey.xmlunit.DifferenceListener

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.