Package org.custommonkey.xmlunit

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


        // by DOM, as expected, but not generated by the method under test,
        // otherwise the comparison would fail.
        actual.getDocumentElement().setAttribute(Constants.INSTANCE_PREFIX,
                Constants.INSTANCE_NS);
        Diff diff =  new Diff(expected, actual);
        assertTrue(message + ", " + diff.toString(), diff.similar());
    }

    /**
     * Print a document to a writer for debugging purposes.
     * @param document The document to print.
View Full Code Here


        actual.getDocumentElement().setAttribute(Constants.INSTANCE_PREFIX,
                Constants.INSTANCE_NS);
        actual.getDocumentElement().setAttribute("i18n",
                I18nTransformer.I18N_NAMESPACE_URI);
        Diff diff =  new Diff(expected, actual);
        assertTrue(message + ", " + diff.toString(), diff.similar());
    }

    /**
     * Print a document to a writer for debugging purposes.
     * @param document The document to print.
View Full Code Here

        // by DOM, as expected, but not generated by the method under test,
        // otherwise the comparison would fail.
        actual.getDocumentElement().setAttribute(Constants.INSTANCE_PREFIX,
                Constants.INSTANCE_NS);
        Diff diff =  new Diff(expected, actual);
        assertTrue(message + ", " + diff.toString(), diff.similar());
    }

    /**
     * Print a document to a writer for debugging purposes.
     * @param document The document to print.
View Full Code Here

        XMLStreamReader reader = new BeanXMLStreamReaderImpl(null, bean);
        XMLStreamReader2String t3 = new XMLStreamReader2String();
        String xml = t3.transform(reader, null);
        Diff diff = new Diff(XML_RESULT, xml);
        Diff diff1 = new Diff(XML_RESULT1, xml);
        assertTrue(diff.similar() || diff1.similar());
    }

    private static class MyBean {
        private long arr[];
        private String str;
View Full Code Here

//        System.out.println("expected = " + expected);
//        System.out.println("actual = " + actual);
       
        Diff myDiff = new Diff(expected, actual);
        assertTrue("Files are similar " + myDiff, myDiff.similar());
    }

    private String read(String name) throws IOException {
        InputStream in = getClass().getClassLoader().getResource(name).openStream();
        StringBuffer sb = new StringBuffer();
View Full Code Here

    XMLUnit.setIgnoreComments(true);
    XMLUnit.setIgnoreAttributeOrder(true);
    Diff diff = new Diff(expectedXml, writer.toString());
    diff.overrideElementQualifier(new RecursiveElementNameAndTextQualifier());
    assertTrue("The output XML was different to the expected XML: "
      + diff.toString(), diff.similar());
  }
}
View Full Code Here

    {
        String expectedXml = prettyXmlPrint( expected );
        String testXml = prettyXmlPrint( test );
        Diff diff = new Diff( expectedXml, testXml );
        StringBuffer diffMessage = new StringBuffer();
        assertTrue( " xml diff not similar " + diff.appendMessage( diffMessage ).toString(), diff.similar() );
    }

    public String prettyXmlPrint( String xml )
        throws Exception
    {
View Full Code Here

    }
    catch (Exception se)
    {
      fail("Could not parse XmlWriter output: " + se);
    }
    assertTrue("Got " + output.toString(), myDiff.similar());
  } // end testAllTypes()

  /**
   * Test serializing a simple object made of of primative attributes.
   */
 
View Full Code Here

    }
    catch (Exception se)
    {
      fail("Could not parse XmlWriter output.");
    }
    assertTrue("Got " + output.toString(), myDiff.similar());
  } // end testSimpleXml()
 
  /**
   * Test serializing an object which has a collection of objects of a type the
   * same as it's own type.
View Full Code Here

    }
    catch (Exception se)
    {
      fail("Could not parse XmlWriter output.");
    }
    assertTrue("Got " + output.toString(), myDiff.similar());
  } // end testSimpleParentChild()

  /**
   * Test serializing an object which has a collection of objects of a type the
   * same as it's own type.
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.