Package org.custommonkey.xmlunit

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


        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


        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

     
      //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());
          passed++;
        }
View Full Code Here

        if (expectedPageCode == null) {
            return;
        }

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

        if (!xmlDiff.similar()) {
            System.out.println("=== EXPECTED PAGE CODE ===");
            System.out.println(IOUtils.toString(getExpectedPageCode(xmlunitPageName)));
            System.out.println("==== ACTUAL PAGE CODE ====");
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, 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

  }

  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

                    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

                    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

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.