You can subscribe to this list here.
2007 |
Jan
|
Feb
(3) |
Mar
(18) |
Apr
(39) |
May
(15) |
Jun
(12) |
Jul
(3) |
Aug
(23) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(21) |
Feb
(23) |
Mar
(33) |
Apr
(8) |
May
(1) |
Jun
(22) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(6) |
Nov
|
Dec
(11) |
2009 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(24) |
May
(36) |
Jun
(18) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(3) |
Nov
(1) |
Dec
|
2010 |
Jan
(5) |
Feb
(3) |
Mar
|
Apr
(15) |
May
(24) |
Jun
(11) |
Jul
(8) |
Aug
(34) |
Sep
(42) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
(13) |
Feb
(32) |
Mar
(35) |
Apr
(31) |
May
(33) |
Jun
(30) |
Jul
(32) |
Aug
(31) |
Sep
(30) |
Oct
(31) |
Nov
(32) |
Dec
(31) |
2012 |
Jan
(35) |
Feb
(31) |
Mar
(31) |
Apr
(30) |
May
(31) |
Jun
(34) |
Jul
(23) |
Aug
(30) |
Sep
(30) |
Oct
(29) |
Nov
(30) |
Dec
(32) |
2013 |
Jan
(25) |
Feb
(39) |
Mar
(1) |
Apr
(18) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(20) |
Sep
(41) |
Oct
(32) |
Nov
(9) |
Dec
(31) |
2014 |
Jan
(31) |
Feb
(30) |
Mar
(34) |
Apr
(60) |
May
(31) |
Jun
(28) |
Jul
(32) |
Aug
(28) |
Sep
(26) |
Oct
(32) |
Nov
(43) |
Dec
(115) |
2015 |
Jan
(106) |
Feb
(101) |
Mar
(51) |
Apr
(32) |
May
(63) |
Jun
(18) |
Jul
|
Aug
(18) |
Sep
|
Oct
(1) |
Nov
(84) |
Dec
(63) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(104) |
Apr
(30) |
May
(6) |
Jun
(30) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(48) |
Dec
(22) |
2017 |
Jan
(15) |
Feb
(29) |
Mar
(43) |
Apr
(29) |
May
(25) |
Jun
(28) |
Jul
(62) |
Aug
(35) |
Sep
(35) |
Oct
(72) |
Nov
(10) |
Dec
(4) |
2018 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(46) |
May
(20) |
Jun
(12) |
Jul
(9) |
Aug
(42) |
Sep
(4) |
Oct
(17) |
Nov
(32) |
Dec
(31) |
2019 |
Jan
(21) |
Feb
(14) |
Mar
|
Apr
(74) |
May
(25) |
Jun
(43) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2020 |
Jan
(1) |
Feb
|
Mar
(26) |
Apr
(8) |
May
(62) |
Jun
(4) |
Jul
(25) |
Aug
|
Sep
(21) |
Oct
(24) |
Nov
(26) |
Dec
(9) |
2021 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(11) |
Nov
(1) |
Dec
(12) |
2022 |
Jan
(47) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(14) |
2023 |
Jan
(3) |
Feb
|
Mar
(60) |
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
(5) |
Feb
|
Mar
|
Apr
(10) |
May
(1) |
Jun
|
Jul
|
Aug
(17) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2025 |
Jan
|
Feb
|
Mar
(88) |
Apr
(64) |
May
(47) |
Jun
(20) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: GitHub <no...@gi...> - 2015-03-08 06:01:14
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: cd8a8249b2574576c3a6521c2ca22725b4aa846f https://github.com/xmlunit/xmlunit/commit/cd8a8249b2574576c3a6521c2ca22725b4aa846f Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-08 (Sun, 08 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java Log Message: ----------- copy-paste error in javadocs |
From: <bo...@us...> - 2015-03-08 06:00:04
|
Revision: 593 http://sourceforge.net/p/xmlunit/code/593 Author: bodewig Date: 2015-03-08 05:59:53 +0000 (Sun, 08 Mar 2015) Log Message: ----------- backport tests and a fix from 2.0 Modified Paths: -------------- trunk/src/java/org/custommonkey/xmlunit/Diff.java trunk/src/java/org/custommonkey/xmlunit/DoctypeInputStream.java trunk/src/java/org/custommonkey/xmlunit/DoctypeReader.java trunk/src/java/org/custommonkey/xmlunit/XMLAssert.java trunk/src/java/org/custommonkey/xmlunit/XMLTestCase.java trunk/src/java/org/custommonkey/xmlunit/XMLUnit.java trunk/src/user-guide/XMLUnit-Java.xml trunk/tests/java/org/custommonkey/xmlunit/AbstractDoctypeTests.java trunk/tests/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java trunk/tests/java/org/custommonkey/xmlunit/test_DetailedDiff.java trunk/tests/java/org/custommonkey/xmlunit/test_Diff.java trunk/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java trunk/tests/java/org/custommonkey/xmlunit/test_TolerantSaxDocumentBuilder.java trunk/tests/java/org/custommonkey/xmlunit/test_Transform.java trunk/tests/java/org/custommonkey/xmlunit/test_XMLTestCase.java trunk/tests/java/org/custommonkey/xmlunit/test_XMLUnit.java Added Paths: ----------- trunk/tests/java/org/custommonkey/xmlunit/test_DoctypeSupport.java trunk/tests/java/org/custommonkey/xmlunit/test_XMLAssert.java Modified: trunk/src/java/org/custommonkey/xmlunit/Diff.java =================================================================== --- trunk/src/java/org/custommonkey/xmlunit/Diff.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/src/java/org/custommonkey/xmlunit/Diff.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2008,2014 Jeff Martin, Tim Bacon +Copyright (c) 2001-2008,2014-2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -132,8 +132,7 @@ * Construct a Diff that compares the XML in two JAXP DOMSources */ public Diff(DOMSource control, DOMSource test) { - this(control.getNode().getOwnerDocument(), - test.getNode().getOwnerDocument()); + this(toDocument(control), toDocument(test)); } /** @@ -425,4 +424,8 @@ : differenceEngine; } + private static Document toDocument(DOMSource d) { + Node n = d.getNode(); + return n instanceof Document ? (Document) n : n.getOwnerDocument(); + } } Modified: trunk/src/java/org/custommonkey/xmlunit/DoctypeInputStream.java =================================================================== --- trunk/src/java/org/custommonkey/xmlunit/DoctypeInputStream.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/src/java/org/custommonkey/xmlunit/DoctypeInputStream.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001, Jeff Martin, Tim Bacon +Copyright (c) 2001,2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -46,7 +46,7 @@ * conforms to a different DTD. * Combines InputStream semantics with the ability to specify a target doctype * for a byte stream containing XML markup. - * Used by Validator class to wrap an InputStrea, when performing validation of a + * Used by Validator class to wrap an InputStream, when performing validation of a * document against a DTD. * <br />Examples and more at <a href="http://xmlunit.sourceforge.net"/>xmlunit.sourceforge.net</a> */ Modified: trunk/src/java/org/custommonkey/xmlunit/DoctypeReader.java =================================================================== --- trunk/src/java/org/custommonkey/xmlunit/DoctypeReader.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/src/java/org/custommonkey/xmlunit/DoctypeReader.java 2015-03-08 05:59:53 UTC (rev 593) @@ -51,7 +51,7 @@ */ public class DoctypeReader extends Reader { - private final Reader originalReader; + private final BufferedReader originalReader; private final StringBuffer sourceBuffer = new StringBuffer(1024); private final DoctypeSupport support; @@ -67,12 +67,12 @@ public DoctypeReader(Reader originalSource, String doctypeName, String systemID) { originalReader = originalSource instanceof BufferedReader - ? originalSource : new BufferedReader(originalSource); + ? (BufferedReader) originalSource : new BufferedReader(originalSource); support = new DoctypeSupport(doctypeName, systemID, new DoctypeSupport.Readable() { public int read() throws IOException { - return originalReader.read(); + return DoctypeReader.this.originalReader.read(); } }, true, null); @@ -92,19 +92,13 @@ * @return the contents of the originalSource within a StringBuffer * @throws IOException if thrown while reading from the original source */ - private StringBuffer getContent(Reader originalSource) + private StringBuffer getContent(BufferedReader originalSource) throws IOException { if (sourceBuffer.length() == 0) { - BufferedReader bufferedReader; - if (originalSource instanceof BufferedReader) { - bufferedReader = (BufferedReader) originalSource; - } else { - bufferedReader = new BufferedReader(originalSource); - } String newline = System.getProperty("line.separator"); String source; boolean atFirstLine = true; - while ((source = bufferedReader.readLine()) != null) { + while ((source = originalSource.readLine()) != null) { if (atFirstLine) { atFirstLine = false; } else { @@ -113,7 +107,7 @@ sourceBuffer.append(source); } - bufferedReader.close(); + originalSource.close(); } return sourceBuffer; Modified: trunk/src/java/org/custommonkey/xmlunit/XMLAssert.java =================================================================== --- trunk/src/java/org/custommonkey/xmlunit/XMLAssert.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/src/java/org/custommonkey/xmlunit/XMLAssert.java 2015-03-08 05:59:53 UTC (rev 593) @@ -809,9 +809,8 @@ fail("Expected test value NOT to be equal to control but both were " + test); } - } else if (test != null) { - fail("control xPath evaluated to empty node set, " - + "but test xPath evaluated to " + test); + } else if (test == null) { + fail("Expected test value NOT to be equal to control but both were empty"); } } Modified: trunk/src/java/org/custommonkey/xmlunit/XMLTestCase.java =================================================================== --- trunk/src/java/org/custommonkey/xmlunit/XMLTestCase.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/src/java/org/custommonkey/xmlunit/XMLTestCase.java 2015-03-08 05:59:53 UTC (rev 593) @@ -41,7 +41,6 @@ import java.io.IOException; import java.io.Reader; -import java.io.StringReader; import junit.framework.TestCase; import org.w3c.dom.Document; @@ -113,7 +112,7 @@ */ public Diff compareXML(String control, Reader test) throws SAXException, IOException { - return XMLUnit.compareXML(new StringReader(control), test); + return XMLUnit.compareXML(control, test); } /** @@ -126,7 +125,7 @@ */ public Diff compareXML(Reader control, String test) throws SAXException, IOException { - return XMLUnit.compareXML(control, new StringReader(test)); + return XMLUnit.compareXML(control, test); } /** Modified: trunk/src/java/org/custommonkey/xmlunit/XMLUnit.java =================================================================== --- trunk/src/java/org/custommonkey/xmlunit/XMLUnit.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/src/java/org/custommonkey/xmlunit/XMLUnit.java 2015-03-08 05:59:53 UTC (rev 593) @@ -178,6 +178,13 @@ return controlEntityResolver; } + /** + * Obtains the EntityResolver to be added to all new test parsers. + */ + public static EntityResolver getTestEntityResolver() { + return testEntityResolver; + } + /** * Get the <code>DocumentBuilderFactory</code> instance used to instantiate * parsers for the control XML in an XMLTestCase. @@ -559,7 +566,8 @@ * @return current version */ public static String getVersion() { - return "1.3alpha"; + // FIXME should read a property + return "1.7alpha"; } /** Modified: trunk/src/user-guide/XMLUnit-Java.xml =================================================================== --- trunk/src/user-guide/XMLUnit-Java.xml 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/src/user-guide/XMLUnit-Java.xml 2015-03-08 05:59:53 UTC (rev 593) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE article PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.1b1//EN" "http://docbook.org/xml/simple/1.1b1/sdocbook.dtd"> <!-- -Copyright (c) 2001-2014, Jeff Martin, Tim Bacon +Copyright (c) 2001-2015, Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3861,6 +3861,40 @@ </section> </section> + <section id="Changes 1.7"> + <title>Changes from XMLUnit 1.6 to 1.7</title> + + <section id="Breaking Changes 1.7"> + <title>Breaking Changes</title> + + <itemizedlist> + <listitem> + </listitem> + </itemizedlist> + </section> + + <section id="New Features 1.7"> + <title>New Features</title> + + <itemizedlist> + <listitem> + </listitem> + </itemizedlist> + </section> + + <section id="Bugfixes 1.7"> + <title>Important Bug Fixes</title> + + <itemizedlist> + <listitem> + The <literal>Diff</literal> constructor using + <literal>DOMSource</literal> didn't work when the source's + <literal>Node</literals> was a <literal>Document</literals>. + </listitem> + </itemizedlist> + </section> + </section> + </appendix> </article> Modified: trunk/tests/java/org/custommonkey/xmlunit/AbstractDoctypeTests.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/AbstractDoctypeTests.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/AbstractDoctypeTests.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 200, Jeff Martin, Tim Bacon +Copyright (c) 2001-2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ private static final String COMMENT = "<!-- comment -->"; protected static final String NO_DTD = "<document><element>one</element></document>"; + private static final String PI = "<?xml-stylesheet type=\"text/xsl\" href=\"style.xsl\"?>"; public abstract void testGetContent() throws IOException; @@ -95,6 +96,30 @@ "ni", "shrubbery"); } + public void testInternalDTDWithTwoComments() throws IOException { + assertEquals(test_Constants.XML_DECLARATION + + "<!DOCTYPE ni SYSTEM \"shrubbery\">" + + COMMENT + + COMMENT, + test_Constants.XML_DECLARATION + + COMMENT + + COMMENT + + test_Constants.CHUCK_JONES_RIP_DTD_DECL, + "ni", "shrubbery"); + } + + public void testInternalDTDWithPIAfterComments() throws IOException { + assertEquals(test_Constants.XML_DECLARATION + + "<!DOCTYPE ni SYSTEM \"shrubbery\">" + + COMMENT + + PI, + test_Constants.XML_DECLARATION + + COMMENT + + PI + + test_Constants.CHUCK_JONES_RIP_DTD_DECL, + "ni", "shrubbery"); + } + public void testExternalDTDWithComment() throws IOException { assertEquals("<!DOCTYPE ni SYSTEM \"shrubbery\">" + COMMENT, @@ -114,6 +139,18 @@ "ni", "shrubbery"); } + public void testLeadingWhitespace() throws IOException { + assertEquals(" <!DOCTYPE ni SYSTEM \"shrubbery\">" + NO_DTD, + " " + NO_DTD, "ni", "shrubbery"); + } + + public void testWhitespaceAfterComment() throws IOException { + assertEquals("<!DOCTYPE ni SYSTEM \"shrubbery\">" + + COMMENT + " " + + NO_DTD, + COMMENT + " " + NO_DTD, "ni", "shrubbery"); + } + public AbstractDoctypeTests(String name) { super(name); } Modified: trunk/tests/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2007, Jeff Martin, Tim Bacon +Copyright (c) 2007,2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -39,8 +39,10 @@ import junit.framework.Assert; import junit.framework.TestCase; +import org.w3c.dom.Attr; import org.w3c.dom.CDATASection; import org.w3c.dom.Comment; +import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.Element; import org.w3c.dom.Entity; @@ -55,6 +57,12 @@ */ public class test_AbstractNodeTester extends TestCase { + private Document doc; + + public void setUp() { + doc = XMLUnit.newControlParser().newDocument(); + } + public void testExactlyOncePerMethod() throws Exception { String testXml = "<!DOCTYPE foo [" + "<!ELEMENT foo (#PCDATA)>" @@ -88,6 +96,99 @@ tester.verify(); } + // seems to never get called in real tests + public void testAttribute() { + AbstractNodeTester t = new AbstractNodeTester() { }; + Attr n = doc.createAttribute("foo"); + try { + t.testNode(n, null); + fail("expected exception"); + } catch (NodeTestException ex) { + assertSame(n, ex.getNode()); + } + } + + public void testCDATASection() { + AbstractNodeTester t = new AbstractNodeTester() { }; + CDATASection n = doc.createCDATASection("foo"); + try { + t.testNode(n, null); + fail("expected exception"); + } catch (NodeTestException ex) { + assertSame(n, ex.getNode()); + } + } + + public void testComment() { + AbstractNodeTester t = new AbstractNodeTester() { }; + Comment n = doc.createComment("foo"); + try { + t.testNode(n, null); + fail("expected exception"); + } catch (NodeTestException ex) { + assertSame(n, ex.getNode()); + } + } + + public void testElement() { + AbstractNodeTester t = new AbstractNodeTester() { }; + Element n = doc.createElement("foo"); + try { + t.testNode(n, null); + fail("expected exception"); + } catch (NodeTestException ex) { + assertSame(n, ex.getNode()); + } + } + + public void testEntityReference() { + AbstractNodeTester t = new AbstractNodeTester() { }; + EntityReference n = doc.createEntityReference("foo"); + try { + t.testNode(n, null); + fail("expected exception"); + } catch (NodeTestException ex) { + assertSame(n, ex.getNode()); + } + } + + public void testProcessingInstruction() { + AbstractNodeTester t = new AbstractNodeTester() { }; + ProcessingInstruction n = doc.createProcessingInstruction("foo", "bar"); + try { + t.testNode(n, null); + fail("expected exception"); + } catch (NodeTestException ex) { + assertSame(n, ex.getNode()); + } + } + + public void testTextNode() { + AbstractNodeTester t = new AbstractNodeTester() { }; + Text n = doc.createTextNode("foo"); + try { + t.testNode(n, null); + fail("expected exception"); + } catch (NodeTestException ex) { + assertSame(n, ex.getNode()); + } + } + + // never called as NodeTest directly jumps to the document element + public void testDocumentType() throws Exception { + AbstractNodeTester t = new AbstractNodeTester() { }; + DocumentType n = XMLUnit + .buildControlDocument("<!DOCTYPE Book PUBLIC \"XMLUNIT/TESTS/PUB1\" \"../test-resources/Book.dtd\">" + + "<Book/>") + .getDoctype(); + try { + t.testNode(n, null); + fail("expected exception"); + } catch (NodeTestException ex) { + assertSame(n, ex.getNode()); + } + } + private class ExactlyOncePerMethod extends AbstractNodeTester { private boolean cdataCalled; Modified: trunk/tests/java/org/custommonkey/xmlunit/test_DetailedDiff.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_DetailedDiff.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/test_DetailedDiff.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2008,2010,2013 Jeff Martin, Tim Bacon +Copyright (c) 2001-2008,2010,2013,2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ import java.io.Reader; import java.util.Iterator; import java.util.List; +import javax.xml.transform.dom.DOMSource; import org.custommonkey.xmlunit.examples.MultiLevelElementNameAndTextQualifier; import org.w3c.dom.Document; @@ -330,6 +331,10 @@ return new DetailedDiff(super.buildDiff(control, test, engine)); } + protected Diff buildDiff(DOMSource control, DOMSource test) { + return new DetailedDiff(super.buildDiff(control, test)); + } + public test_DetailedDiff(String name) { super(name); firstForecast = "<weather><today icon=\"clouds\" temp=\"17\">" Modified: trunk/tests/java/org/custommonkey/xmlunit/test_Diff.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_Diff.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/test_Diff.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2013, Jeff Martin, Tim Bacon +Copyright (c) 2001-2013,2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ import java.io.Reader; import java.util.HashSet; import java.util.Set; +import javax.xml.transform.dom.DOMSource; import junit.framework.TestCase; @@ -475,6 +476,29 @@ assertFalse(diff.toString(), diff.identical()); } + public void testUsingDOMSourceFromDocument() throws Exception { + Document control = + XMLUnit.buildTestDocument("<!DOCTYPE skinconfig []>" + + "<!--abcd--><root></root>"); + Document test = + XMLUnit.buildControlDocument("<!DOCTYPE skinconfig [<!--abcd-->]>" + + "<root></root>"); + Diff diff = buildDiff(new DOMSource(control), new DOMSource(test)); + assertTrue(diff.toString(), diff.identical()); + } + + public void testUsingDOMSourceFromElement() throws Exception { + Document control = + XMLUnit.buildTestDocument("<!DOCTYPE skinconfig []>" + + "<!--abcd--><root></root>"); + Document test = + XMLUnit.buildControlDocument("<!DOCTYPE skinconfig [<!--abcd-->]>" + + "<root></root>"); + Diff diff = buildDiff(new DOMSource(control.getDocumentElement()), + new DOMSource(test.getDocumentElement())); + assertTrue(diff.toString(), diff.identical()); + } + protected Diff buildDiff(Document control, Document test) { return new Diff(control, test); } @@ -493,6 +517,10 @@ XMLUnit.buildTestDocument(test), engine); } + protected Diff buildDiff(DOMSource control, DOMSource test) { + return new Diff(control, test); + } + /** * Construct a test * @param name Test name @@ -906,7 +934,7 @@ "<child amount=\"100\" />" + "</tag>"; - Diff diff = new Diff(control, test); + Diff diff = buildDiff(control, test); diff.overrideElementQualifier(new ElementNameAndAttributeQualifier()); assertTrue(diff.toString(), diff.similar()); @@ -947,7 +975,7 @@ String control = "<ns2:Square xsi:type=\"ns2:Shape\" " + "xmlns:ns2=\"http://example.com/\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; - Diff diff = new Diff(control, test); + Diff diff = buildDiff(control, test); assertTrue(diff.toString(), diff.similar()); } @@ -961,7 +989,7 @@ + "<ns2:Square xsi:type=\"ns2:Shape\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" + "</ns2:Shapes>"; - Diff diff = new Diff(control, test); + Diff diff = buildDiff(control, test); assertTrue(diff.toString(), diff.similar()); } @@ -975,7 +1003,7 @@ + "xmlns:ns1=\"http://example.com/\" " + "xmlns:ns2=\"http://example.com/another-uri/\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; - Diff diff = new Diff(control, test); + Diff diff = buildDiff(control, test); assertFalse(diff.toString(), diff.similar()); } public void testXsiNil() throws Exception { @@ -984,7 +1012,7 @@ String control = "<foo xsi:nil=\"false\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; - Diff diff = new Diff(control, test); + Diff diff = buildDiff(control, test); assertFalse(diff.toString(), diff.similar()); } } Modified: trunk/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2008,2013-2014 Jeff Martin, Tim Bacon +Copyright (c) 2001-2008,2013-2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -631,6 +631,22 @@ assertNull("13th test xpath", listener.testXpath); } + public void testXpathLocation13Reversed() throws Exception { + engine = new DifferenceEngine(PSEUDO_DETAILED_DIFF); + String control = "<stuff><?item data?></stuff>"; + String test = "<stuff><item id=\"1\"/><item id=\"2\"/></stuff>"; + listenToDifferences(control, test); + // mutiple Differences, we only see the last one, missing second element + assertEquals("null", listener.expected); + assertEquals("item", listener.actual); + assertEquals("13 difference type", + DifferenceConstants.CHILD_NODE_NOT_FOUND_ID, + listener.comparingWhat); + assertNull("13th-r control xpath", listener.controlXpath); + assertEquals("13th-r test xpath", "/stuff[1]/item[2]", + listener.testXpath); + } + public void testMissingChildNS() throws Exception { engine = new DifferenceEngine(PSEUDO_DETAILED_DIFF); String control = "<stuff xmlns=\"http://example.org/\">" @@ -1002,6 +1018,40 @@ listener.comparingWhat); } + public void testDoctypeDifferences() throws Exception { + String control = "<?xml version = \"1.0\" encoding = \"UTF-8\"?>" + + "<!DOCTYPE Book PUBLIC \"XMLUNIT/TESTS/PUB1\" \"../test-resources/Book.dtd\">" + + "<Book/>"; + String test = "<?xml version = \"1.0\" encoding = \"UTF-8\"?>" + + "<!DOCTYPE Book PUBLIC \"XMLUNIT/TESTS/PUB2\" \"../test-resources/Book.dtd\">" + + "<Book/>"; + listenToDifferences(control, test); + assertTrue(listener.different); + } + + public void testTextAndCDATA() throws Exception { + String control = "<stuff><![CDATA[foo]]></stuff>"; + String test = "<stuff>foo</stuff>"; + listenToDifferences(control, test); + assertTrue(listener.different); + assertEquals("textAndCdata control xpath", "/stuff[1]/text()[1]", + listener.controlXpath); + assertEquals("textAndCdata test xpath", "/stuff[1]/text()[1]", + listener.testXpath); + } + + public void testIgnoreDiffBetweenTextAndCDATA() throws Exception { + String control = "<stuff><![CDATA[foo]]></stuff>"; + String test = "<stuff>foo</stuff>"; + try { + XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); + listenToDifferences(control, test); + assertFalse(listener.different); + } finally { + XMLUnit.setIgnoreDiffBetweenTextAndCDATA(false); + } + } + private void listenToDifferences(String control, String test) throws SAXException, IOException { Document controlDoc = XMLUnit.buildControlDocument(control); Added: trunk/tests/java/org/custommonkey/xmlunit/test_DoctypeSupport.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_DoctypeSupport.java (rev 0) +++ trunk/tests/java/org/custommonkey/xmlunit/test_DoctypeSupport.java 2015-03-08 05:59:53 UTC (rev 593) @@ -0,0 +1,57 @@ +/* +****************************************************************** +Copyright (c) 2015 Jeff Martin, Tim Bacon +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the XMLUnit nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +****************************************************************** +*/ + +package org.custommonkey.xmlunit; + +import junit.framework.TestCase; + +import org.custommonkey.xmlunit.exceptions.XMLUnitRuntimeException; + +public class test_DoctypeSupport extends TestCase { + + public void testUnsupportedEncoding() { + try { + new DoctypeSupport("foo", "foo", new DoctypeSupport.Readable() { + public int read() { + return 1; + } + }, false, "foo"); + fail("should throw an exception"); + } catch (XMLUnitRuntimeException ex) { + // expected + } + } +} Property changes on: trunk/tests/java/org/custommonkey/xmlunit/test_DoctypeSupport.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/tests/java/org/custommonkey/xmlunit/test_TolerantSaxDocumentBuilder.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_TolerantSaxDocumentBuilder.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/test_TolerantSaxDocumentBuilder.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 200, Jeff Martin, Tim Bacon +Copyright (c) 2001-2015, Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -131,6 +131,11 @@ assertTrue(builder.getTrace(), builder.getTrace().indexOf("WARNING") != -1); } + // silly, but a no-op + public void testCharactersWithNegativeLength() { + builder.characters(null, 0, -1); + } + public void setUp() throws Exception { builder = new TolerantSaxDocumentBuilder(XMLUnit.newTestParser()); parser = SAXParserFactory.newInstance().newSAXParser(); Modified: trunk/tests/java/org/custommonkey/xmlunit/test_Transform.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_Transform.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/test_Transform.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2007, Jeff Martin, Tim Bacon +Copyright (c) 2001-2007,2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -38,8 +38,10 @@ import java.io.File; import java.io.FileReader; +import java.io.StringReader; import org.custommonkey.xmlunit.exceptions.ConfigurationException; +import org.custommonkey.xmlunit.exceptions.XMLUnitRuntimeException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Source; @@ -48,6 +50,7 @@ import junit.framework.TestSuite; import org.w3c.dom.Document; +import org.xml.sax.InputSource; /** * Test a Transform @@ -66,6 +69,17 @@ assertEquals(DOG, stripLineFeeds(transform.getResultString())); } + public void testGetResultStringViaInputSource() throws Exception { + transform = new Transform(new InputSource(new StringReader(FLEABALL)), animal); + assertEquals(DOG, stripLineFeeds(transform.getResultString())); + } + + public void testGetResultStringViaTwoInputSources() throws Exception { + transform = new Transform(new InputSource(new StringReader(FLEABALL)), + new InputSource(new FileReader(animal))); + assertEquals(DOG, stripLineFeeds(transform.getResultString())); + } + public void testGetResultDocument() throws Exception { transform = new Transform(FLEABALL, animal); Diff diff = new Diff(DOG, transform); @@ -144,6 +158,14 @@ } } + public void testParameterHandling() { + transform = new Transform(FLEABALL, animal); + transform.setParameter("foo", "bar"); + assertEquals("bar", transform.getParameter("foo")); + transform.clearParameters(); + assertNull(transform.getParameter("foo")); + } + private void assertNotEquals(Object expected, Object actual) { if (expected.equals(actual)) { fail("Expected " + expected + " different to actual!"); Added: trunk/tests/java/org/custommonkey/xmlunit/test_XMLAssert.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_XMLAssert.java (rev 0) +++ trunk/tests/java/org/custommonkey/xmlunit/test_XMLAssert.java 2015-03-08 05:59:53 UTC (rev 593) @@ -0,0 +1,174 @@ +/* +****************************************************************** +Copyright (c) 2015 Jeff Martin, Tim Bacon +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the XMLUnit nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +****************************************************************** +*/ + +package org.custommonkey.xmlunit; + +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; +import org.xml.sax.InputSource; +import org.w3c.dom.Node; + +import junit.framework.AssertionFailedError; +import junit.framework.TestCase; + +import org.custommonkey.xmlunit.examples.CountingNodeTester; + +public class test_XMLAssert extends TestCase { + public void testAssertXMLEqualStringDiffBooleanWithMatch() throws Exception { + Diff d = XMLUnit.compareXML("<foo/>", "<foo/>"); + XMLAssert.assertXMLEqual("msg", d, true); + try { + XMLAssert.assertXMLEqual("msg", d, false); + } catch (AssertionFailedError f) { + // expected + return; + } + fail("should have thrown an exception"); + } + + public void testAssertXMLEqualStringDiffBooleanWithDiff() throws Exception { + Diff d = XMLUnit.compareXML("<foo/>", "<bar/>"); + XMLAssert.assertXMLEqual("msg", d, false); + try { + XMLAssert.assertXMLEqual("msg", d, true); + } catch (AssertionFailedError f) { + // expected + return; + } + fail("should have thrown an exception"); + } + + public void testAssertXMIdenticalDiffBooleanWithMatch() throws Exception { + Diff d = XMLUnit.compareXML("<foo/>", "<foo/>"); + XMLAssert.assertXMLIdentical(d, true); + try { + XMLAssert.assertXMLIdentical(d, false); + } catch (AssertionFailedError f) { + // expected + return; + } + fail("should have thrown an exception"); + } + + public void testAssertXMIdenticalDiffBooleanWithDiff() throws Exception { + Diff d = XMLUnit.compareXML("<foo/>", "<bar/>"); + XMLAssert.assertXMLIdentical(d, false); + try { + XMLAssert.assertXMLIdentical(d, true); + } catch (AssertionFailedError f) { + // expected + return; + } + fail("should have thrown an exception"); + } + + public void testAssertXpathsNotEqual() throws Exception { + String xpathXML = "<foo><bar/></foo>"; + XMLAssert.assertXpathsNotEqual("/foo", + new InputSource(new StringReader(xpathXML)), + "/foo/bar", + new InputSource(new StringReader(xpathXML))); + } + + public void testAssertXpathValuesNotEqual() throws Exception { + String controlXML = "<foo>bar</foo>"; + try { + XMLAssert.assertXpathValuesNotEqual("/foo", controlXML, + "/foo", controlXML); + } catch (AssertionFailedError f) { + // expected + return; + } + fail("should have thrown an exception"); + } + + public void testAssertXpathValuesNotEqualNoMatch() throws Exception { + String controlXML = "<foo>bar</foo>"; + try { + XMLAssert.assertXpathValuesNotEqual("/baz", controlXML, + "/baz", controlXML); + } catch (AssertionFailedError f) { + // expected + return; + } + fail("should have thrown an exception"); + } + + public void testXpathEvaluatesToQualifiedName() throws Exception { + String faultDocument = "<env:Envelope " + + "xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + + "<env:Body><env:Fault><faultcode>env:Server</faultcode>" + + "<faultstring>marche pas</faultstring><detail/></env:Fault>" + + "</env:Body></env:Envelope>"; + Map namespaces = new HashMap(); + namespaces.put("env11", "http://schemas.xmlsoap.org/soap/envelope/"); + XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); + XMLAssert.assertXpathEvaluatesTo(QualifiedName.valueOf("env11:Server"), + "//env11:Envelope/env11:Body/" + + "env11:Fault/faultcode", + new InputSource(new StringReader(faultDocument))); + } + + public void testAssertNodeTestPassesWithMatch() throws Exception { + NodeTest test = new NodeTest(new StringReader(test_XMLTestCase.xpathValuesTestXML)); + NodeTester tester = new CountingNodeTester(1); + XMLAssert.assertNodeTestPasses(test, tester, new short[] { Node.TEXT_NODE }, true); + try { + XMLAssert.assertNodeTestPasses(test, tester, new short[] { Node.TEXT_NODE }, + false); + } catch (AssertionFailedError e) { + // expected + return; + } + fail("should have thrown an exception"); + } + + public void testAssertNodeTestPassesWithDiff() throws Exception { + NodeTest test = new NodeTest(new StringReader(test_XMLTestCase.xpathValuesTestXML)); + NodeTester tester = new CountingNodeTester(1); + XMLAssert.assertNodeTestPasses(test, tester, new short[] { Node.ELEMENT_NODE }, + false); + try { + XMLAssert.assertNodeTestPasses(test, tester, new short[] { Node.ELEMENT_NODE }, + true); + } catch (AssertionFailedError e) { + // expected + return; + } + fail("should have thrown an exception"); + } +} Property changes on: trunk/tests/java/org/custommonkey/xmlunit/test_XMLAssert.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/tests/java/org/custommonkey/xmlunit/test_XMLTestCase.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_XMLTestCase.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/test_XMLTestCase.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2011,2014 Jeff Martin, Tim Bacon +Copyright (c) 2001-2011,2014-2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Node; +import org.xml.sax.InputSource; /** * Test case used to test the XMLTestCase @@ -99,6 +100,78 @@ } /** + * Test for the compareXML method for readers. + */ + public void testCompareXMLReaders() throws Exception { + for(int i=0;i<control.length;i++){ + assertEquals("compareXML case " + i + " failed", true, + compareXML(new StringReader(control[i]), + new StringReader(control[i])).similar()); + assertEquals("!compareXML case " + i + " failed", false, + compareXML(new StringReader(control[i]), + new StringReader(test[i])).similar()); + } + } + + /** + * Test for the compareXML method for InputSources. + */ + public void testCompareXMLInputSources() throws Exception { + for(int i=0;i<control.length;i++){ + assertEquals("compareXML case " + i + " failed", true, + compareXML(new InputSource(new StringReader(control[i])), + new InputSource(new StringReader(control[i]))) + .similar()); + assertEquals("!compareXML case " + i + " failed", false, + compareXML(new InputSource(new StringReader(control[i])), + new InputSource(new StringReader(test[i]))) + .similar()); + } + } + + /** + * Test for the compareXML method for Reader/String combination. + */ + public void testCompareXMLStringReader() throws Exception { + for(int i=0;i<control.length;i++){ + assertEquals("compareXML case " + i + " failed", true, + compareXML(new StringReader(control[i]), + control[i]).similar()); + assertEquals("!compareXML case " + i + " failed", false, + compareXML(new StringReader(control[i]), + test[i]).similar()); + } + } + + /** + * Test for the compareXML method for String/Reader combination. + */ + public void testCompareXMLReaderString() throws Exception { + for(int i=0;i<control.length;i++){ + assertEquals("compareXML case " + i + " failed", true, + compareXML(control[i], + new StringReader(control[i])).similar()); + assertEquals("!compareXML case " + i + " failed", false, + compareXML(control[i], + new StringReader(test[i])).similar()); + } + } + + /** + * Test for the compareXML method for Documents. + */ + public void testCompareXMLDocumentss() throws Exception { + for(int i=0;i<control.length;i++){ + Document controlDocument = XMLUnit.buildControlDocument(control[i]); + assertEquals("compareXML case " + i + " failed", true, + compareXML(controlDocument, controlDocument).similar()); + Document testDocument = XMLUnit.buildTestDocument(test[i]); + assertEquals("!compareXML case " + i + " failed", false, + compareXML(controlDocument, testDocument).similar()); + } + } + + /** * Test the comparision of two files */ public void testXMLEqualsFiles() throws Exception { @@ -129,36 +202,149 @@ } /** - * Test for the assertXMLEquals method. + * Test for the assertXMLEqual method. */ public void testXMLEqualsStrings() throws Exception { for(int i=0;i<control.length;i++){ - assertXMLEqual("assertXMLEquals test case " + i + " failed", + assertXMLEqual("assertXMLEqual test case " + i + " failed", control[i], control[i]); - assertXMLNotEqual("assertXMLNotEquals test case" + i + " failed", + assertXMLNotEqual("assertXMLNotEqual test case" + i + " failed", control[i], test[i]); } } /** - * Test for the assertXMLEquals method. + * Test for the assertXMLEqual method for String and InputSources. */ - public void testXMLEqualsDocuments() throws Exception { + public void testXMLEqualsStringInputSources() throws Exception { + for(int i=0;i<control.length;i++){ + assertXMLEqual("assertXMLEqual test case " + i + " failed", + new InputSource(new StringReader(control[i])), + new InputSource(new StringReader(control[i]))); + assertXMLNotEqual("assertXMLNotEqual test case" + i + " failed", + new InputSource(new StringReader(control[i])), + new InputSource(new StringReader(test[i]))); + } + } + + /** + * Test for the assertXMLEqual method for InputSources. + */ + public void testXMLEqualsInputSources() throws Exception { + for(int i=0;i<control.length;i++){ + assertXMLEqual(new InputSource(new StringReader(control[i])), + new InputSource(new StringReader(control[i]))); + assertXMLNotEqual(new InputSource(new StringReader(control[i])), + new InputSource(new StringReader(test[i]))); + } + } + + /** + * Test for the assertXMLEqual method. + */ + public void testXMLEqualsStringDocuments() throws Exception { Document controlDocument, testDocument; for(int i=0;i<control.length;i++){ controlDocument = XMLUnit.buildControlDocument(control[i]); - assertXMLEqual("assertXMLEquals test case " + i + " failed", + assertXMLEqual("assertXMLEqual test case " + i + " failed", controlDocument, controlDocument); testDocument = XMLUnit.buildTestDocument(test[i]); - assertXMLNotEqual("assertXMLNotEquals test case" + i + " failed", + assertXMLNotEqual("assertXMLNotEqual test case" + i + " failed", controlDocument, testDocument); } } + /** + * Test for the assertXMLEqual method. + */ + public void testXMLEqualsDocuments() throws Exception { + Document controlDocument, testDocument; + for(int i=0;i<control.length;i++){ + controlDocument = XMLUnit.buildControlDocument(control[i]); + assertXMLEqual(controlDocument, controlDocument); + testDocument = XMLUnit.buildTestDocument(test[i]); + assertXMLNotEqual(controlDocument, testDocument); + } + } + + /** + * Test for the assertXMLEqual method with Diff and boolean. + */ + public void testXMLEqualDiffBoolean() throws Exception { + for(int i=0;i<control.length;i++){ + Diff d = compareXML(control[i], control[i]); + assertXMLEqual(d, true); + d = compareXML(control[i], test[i]); + assertXMLEqual(d, false); + } + } + + /** + * Test for the assertXMLEqual method with String, Diff and boolean. + */ + public void testXMLEqualStringDiffBoolean() throws Exception { + for(int i=0;i<control.length;i++){ + Diff d = compareXML(control[i], control[i]); + assertXMLEqual("assertXMLEqual test case " + i + " failed", + d, true); + d = compareXML(control[i], test[i]); + assertXMLEqual("assertXMLEqual test case " + i + " failed", + d, false); + } + } + + public void testXMLEqualThrows() throws Exception { + Diff d = compareXML(control[0], test[0]); + try { + assertXMLEqual("should throw exception", d, true); + } catch (AssertionFailedError f) { + // expected + return; + } + fail("should have thrown an exception"); + } + + public void testXMLIdenticalThrows() throws Exception { + Diff d = compareXML(control[0], test[0]); + try { + assertXMLIdentical("should throw exception", d, true); + } catch (AssertionFailedError f) { + // expected + return; + } + fail("should have thrown an exception"); + } + + /** + * Test for the assertXMLIdentical method with Diff and boolean. + */ + public void testXMLIdenticalDiffBoolean() throws Exception { + for(int i=0;i<control.length;i++){ + Diff d = compareXML(control[i], control[i]); + assertXMLIdentical(d, true); + d = compareXML(control[i], test[i]); + assertXMLIdentical(d, false); + } + } + + /** + * Test for the assertXMLIdentical method with String, Diff and boolean. + */ + public void testXMLIdenticalStringDiffBoolean() throws Exception { + for(int i=0;i<control.length;i++){ + Diff d = compareXML(control[i], control[i]); + assertXMLIdentical("assertXMLIdentical test case " + i + " failed", + d, true); + d = compareXML(control[i], test[i]); + assertXMLIdentical("assertXMLIdentical test case " + i + " failed", + d, false); + } + } + private static final String xpathValuesControlXML = "<root><outer attr=\"urk\"><inner attr=\"urk\">" + "controlDocument</inner></outer></root>"; - private static final String xpathValuesTestXML = + static final String xpathValuesTestXML = "<root><outer attr=\"urk\"><inner attr=\"ugh\">" + "testDocument</inner></outer></root>"; private static final String xpathValuesControlXMLNS = @@ -231,6 +417,22 @@ "//text()", xpathValuesTestXMLNS); } + public void testXpathValuesEqualUsingInputSource() throws Exception { + assertXpathValuesEqual("//text()", "//inner/text()", + new InputSource(new StringReader(xpathValuesControlXML))); + assertXpathValuesEqual("//inner/@attr", + new InputSource(new StringReader(xpathValuesControlXML)), + "//outer/@attr", + new InputSource(new StringReader(xpathValuesTestXML))); + + assertXpathValuesNotEqual("//inner/text()", "//outer/@attr", + new InputSource(new StringReader(xpathValuesControlXML))); + assertXpathValuesNotEqual("//inner/text()", + new InputSource(new StringReader(xpathValuesControlXML)), + "//text()", + new InputSource(new StringReader(xpathValuesTestXML))); + } + public void testXpathEvaluatesTo() throws Exception { assertXpathEvaluatesTo("urk", "//outer/@attr", xpathValuesControlXML); try { @@ -248,6 +450,15 @@ } catch (AssertionFailedError e) { } + assertXpathEvaluatesTo("ugh", "//inner/@attr", + new InputSource(new StringReader(xpathValuesTestXML))); + try { + assertXpathEvaluatesTo("yeah", "//outer/@attr", + new InputSource(new StringReader(xpathValuesTestXML))); + fail("Expected assertion to fail #3"); + } catch (AssertionFailedError e) { + } + } public void testXpathEvaluatesToNS() throws Exception { @@ -308,8 +519,16 @@ } } - public void testXMLValid() { - // see test_Validator class + public void testNodeTestInputSource() throws Exception { + NodeTester tester = new CountingNodeTester(1); + assertNodeTestPasses(new InputSource(new StringReader(xpathValuesControlXML)), + tester, Node.TEXT_NODE); + try { + assertNodeTestPasses(new InputSource(new StringReader(xpathValuesControlXML)), + tester, Node.ELEMENT_NODE); + fail("Expected node test failure #1!"); + } catch (AssertionFailedError e) { + } } private static final String TREES_OPEN = "<trees>"; @@ -358,6 +577,10 @@ testXpath[i], testDoc); assertXpathsEqual(controlXpath[i], xpathNodesControlXML, testXpath[i], xpathNodesTestXML); + assertXpathsEqual(controlXpath[i], + new InputSource(new StringReader(xpathNodesControlXML)), + testXpath[i], + new InputSource(new StringReader(xpathNodesTestXML))); assertXpathsEqual(controlXpath[i], testXpath[i], controlDoc); assertXpathsEqual(controlXpath[i], testXpath[i], xpathNodesControlXML); } @@ -376,6 +599,14 @@ } catch (AssertionFailedError e) { } try { + assertXpathsNotEqual(controlXpath[i], + new InputSource(new StringReader(xpathNodesControlXML)), + testXpath[i], + new InputSource(new StringReader(xpathNodesTestXML))); + fail("should not be notEqual!"); + } catch (AssertionFailedError e) { + } + try { assertXpathsNotEqual(controlXpath[i], testXpath[i], controlDoc); fail("should not be notEqual!"); } catch (AssertionFailedError e) { @@ -460,6 +691,20 @@ } } + public void testInputSourceAssertXpathExists() throws Exception { + assertXpathExists("/trees/fruit/apples/yum", + new InputSource(new StringReader(xpathNodesControlXML))); + assertXpathExists("//tree[@evergreen='false']", + new InputSource(new StringReader(xpathNodesControlXML))); + try { + assertXpathExists("//tree[@evergreen='idunno']", + new InputSource(new StringReader(xpathNodesControlXML))); + fail("Xpath does not exist"); + } catch (AssertionFailedError e) { + // expected + } + } + public void testDocumentAssertNotXpathExists() throws Exception { Document controlDoc = XMLUnit.buildControlDocument(xpathNodesControlXML); assertXpathNotExists("//tree[@evergreen='idunno']", controlDoc); @@ -493,6 +738,25 @@ } } + public void testInputSourceAssertNotXpathExists() throws Exception { + assertXpathNotExists("//tree[@evergreen='idunno']", + new InputSource(new StringReader(xpathNodesControlXML))); + try { + assertXpathNotExists("/trees/fruit/apples/yum", + new InputSource(new StringReader(xpathNodesControlXML))); + fail("Xpath does exist, once"); + } catch (AssertionFailedError e) { + // expected + } + try { + assertXpathNotExists("//tree[@evergreen='false']", + new InputSource(new StringReader(xpathNodesControlXML))); + fail("Xpath does exist many times"); + } catch (AssertionFailedError e) { + // expected + } + } + // Bug 585555 public void testUnusedNamespacesDontMatter() throws Exception { @@ -583,6 +847,15 @@ "<foo><Bar a=\"1\" b=\"2\"/></foo>"); } + public void testAssertXpathEqualsInputSource() throws Exception { + InputSource control = new InputSource(new StringReader("<foo><Bar a=\"1\" /></foo>")); + assertXpathsNotEqual("/foo/Bar/@a", "/foo/Bar", control); + control = new InputSource(new StringReader("<foo><Bar a=\"1\" b=\"1\"/></foo>")); + assertXpathsNotEqual("/foo/Bar/@a", "/foo/Bar/@b", control); + control = new InputSource(new StringReader("<foo><Bar a=\"1\" b=\"2\"/></foo>")); + assertXpathsEqual("/foo/Bar/@a", "/foo/Bar/@a", control); + } + // https://sourceforge.net/p/xmlunit/feature-requests/25/ public void testXpathEvaluatesToQualifiedName() throws Exception { String faultDocument = "<env:Envelope " @@ -599,10 +872,6 @@ faultDocument); } - public test_XMLTestCase(String name) { - super(name); - } - private static String addNamespaceToDocument(String original) { int pos = original.indexOf(">"); return original.substring(0, pos) + " xmlns='" + TEST_NS + "'" Modified: trunk/tests/java/org/custommonkey/xmlunit/test_XMLUnit.java =================================================================== --- trunk/tests/java/org/custommonkey/xmlunit/test_XMLUnit.java 2015-01-13 19:42:26 UTC (rev 592) +++ trunk/tests/java/org/custommonkey/xmlunit/test_XMLUnit.java 2015-03-08 05:59:53 UTC (rev 593) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2007, Jeff Martin, Tim Bacon +Copyright (c) 2001-2007,2015 Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -135,4 +135,24 @@ XMLUnit.setXSLTVersion("1.0"); } } + + public void testCantSetNullControlDocumentBuilderFactory() throws Exception { + try { + XMLUnit.setControlDocumentBuilderFactory(null); + fail("should have thrown an exception"); + } catch (IllegalArgumentException f) { + // expected + return; + } + } + + public void testCantSetNullTestDocumentBuilderFactory() throws Exception { + try { + XMLUnit.setTestDocumentBuilderFactory(null); + fail("should have thrown an exception"); + } catch (IllegalArgumentException f) { + // expected + return; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: GitHub <no...@gi...> - 2015-03-07 21:14:46
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: a00f794a3af6e8d243fd54d14632d608ea744495 https://github.com/xmlunit/xmlunit/commit/a00f794a3af6e8d243fd54d14632d608ea744495 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameAndAttributeQualifier.java Log Message: ----------- deprecate ElementNameAndAttributeQualifier#areAttributesComparable Commit: 308ba90b4911e9b57f0fd94de69b1ce83919441b https://github.com/xmlunit/xmlunit/commit/308ba90b4911e9b57f0fd94de69b1ce83919441b Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/NewDifferenceEngine.java Log Message: ----------- remove dead code Commit: 51bbeba18d76976aa3e9bb22605f2f597bb0dc92 https://github.com/xmlunit/xmlunit/commit/51bbeba18d76976aa3e9bb22605f2f597bb0dc92 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeInputStream.java Log Message: ----------- typo Commit: 189258cdda9de4165d9a09dd89cbcd1985f0f603 https://github.com/xmlunit/xmlunit/commit/189258cdda9de4165d9a09dd89cbcd1985f0f603 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/AbstractDoctypeTests.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DifferenceEngine.java A xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DoctypeSupport.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_ElementNameAndAttributeQualifier.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_HTMLDocumentBuilder.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_NewDifferenceEngine.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_TolerantSaxDocumentBuilder.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_Transform.java Log Message: ----------- cover worst offenders of legacy module Compare: https://github.com/xmlunit/xmlunit/compare/7fc50c9300f2...189258cdda9d |
From: GitHub <no...@gi...> - 2015-03-07 17:53:41
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 30a983f1ef57ab762fd08b3fd665bc4a1b2f73ad https://github.com/xmlunit/xmlunit/commit/30a983f1ef57ab762fd08b3fd665bc4a1b2f73ad Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java Log Message: ----------- add method that's missing for symmetry Commit: 7fc50c9300f281a3ca56644248b92084a9abfcb7 https://github.com/xmlunit/xmlunit/commit/7fc50c9300f281a3ca56644248b92084a9abfcb7 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/pom.xml M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_XMLUnit.java Log Message: ----------- test DocumentBuilder methods Compare: https://github.com/xmlunit/xmlunit/compare/7a66d629e113...7fc50c9300f2 |
From: GitHub <no...@gi...> - 2015-03-07 17:28:27
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 7a66d629e113f2a6c35e62383973356cc9ee09be https://github.com/xmlunit/xmlunit/commit/7a66d629e113f2a6c35e62383973356cc9ee09be Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLTestCase.java Log Message: ----------- don't duplicate logic already present in XMLUnit |
From: GitHub <no...@gi...> - 2015-03-07 17:20:59
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: ea6397db55dd2812639344fe215dfbe8682bddcb https://github.com/xmlunit/xmlunit/commit/ea6397db55dd2812639344fe215dfbe8682bddcb Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DifferenceEngine.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_NewDifferenceEngine.java Log Message: ----------- cover more of DifferenceEngine Commit: 0f623c3bb9729ffe84d02361b9dfbefb46d8ed40 https://github.com/xmlunit/xmlunit/commit/0f623c3bb9729ffe84d02361b9dfbefb46d8ed40 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: A xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_XMLAssert.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_XMLTestCase.java Log Message: ----------- cover more of XMLAssert Commit: ff730a4625e65847429c0447418ca9799b446965 https://github.com/xmlunit/xmlunit/commit/ff730a4625e65847429c0447418ca9799b446965 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java Log Message: ----------- looks as if the logic was backwards, but XPath never evaluates to null anyway Compare: https://github.com/xmlunit/xmlunit/compare/6b06c04241b3...ff730a4625e6 |
From: GitHub <no...@gi...> - 2015-03-07 16:29:59
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 50d76b96261e5f888156fe567f97c46169f7e925 https://github.com/xmlunit/xmlunit/commit/50d76b96261e5f888156fe567f97c46169f7e925 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeReader.java Log Message: ----------- remove dead code Commit: 6b06c04241b311444fc5ffc7201a4c09e594577f https://github.com/xmlunit/xmlunit/commit/6b06c04241b311444fc5ffc7201a4c09e594577f Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeReader.java Log Message: ----------- constructor already ensures originalReader is buffered Compare: https://github.com/xmlunit/xmlunit/compare/e6438d0804ab...6b06c04241b3 |
From: GitHub <no...@gi...> - 2015-03-07 16:16:46
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: fb68754585feb40d3535dc9952d3cfe1e5507ae8 https://github.com/xmlunit/xmlunit/commit/fb68754585feb40d3535dc9952d3cfe1e5507ae8 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DetailedDiff.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_Diff.java Log Message: ----------- Diff using DOMSource was broken when DOMSource's Node was a Document Commit: ab4e9523de5a9f83f72165e1ad805e9fe660c2c7 https://github.com/xmlunit/xmlunit/commit/ab4e9523de5a9f83f72165e1ad805e9fe660c2c7 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_XMLTestCase.java Log Message: ----------- missed assertXpathsEquals methods Commit: e6438d0804abdcc21858ab3e441060fc0fc2b9f8 https://github.com/xmlunit/xmlunit/commit/e6438d0804abdcc21858ab3e441060fc0fc2b9f8 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: R xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/CountingNodeTester.java M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DifferenceEngine.java M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeReader.java M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Validator.java M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DifferenceEngine.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DoctypeReader.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_XMLTestCase.java Log Message: ----------- remove deprecated code from legacy Compare: https://github.com/xmlunit/xmlunit/compare/d1262aa4fb11...e6438d0804ab |
From: GitHub <no...@gi...> - 2015-03-07 15:35:01
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: e4bf6ff17a19c6631416f5a1e9a8502692d65115 https://github.com/xmlunit/xmlunit/commit/e4bf6ff17a19c6631416f5a1e9a8502692d65115 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_XMLTestCase.java M xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_XMLUnit.java Log Message: ----------- improve test coverage of XMLUnit/XMLAssert/XMLTestCase Commit: e8c44d75d3b12df7f24d5b0d1d372df5888fc1fa https://github.com/xmlunit/xmlunit/commit/e8c44d75d3b12df7f24d5b0d1d372df5888fc1fa Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java Log Message: ----------- fix version Commit: d1262aa4fb1196973902d7130ffa35afa5e27c75 https://github.com/xmlunit/xmlunit/commit/d1262aa4fb1196973902d7130ffa35afa5e27c75 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java Log Message: ----------- 2.x requires Java6, no need for fallback code Compare: https://github.com/xmlunit/xmlunit/compare/3f540f19b2cc...d1262aa4fb11 |
From: GitHub <no...@gi...> - 2015-03-07 11:26:49
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit.net Commit: a71d890d2995661879182e9ef6204fdcd819faad https://github.com/xmlunit/xmlunit.net/commit/a71d890d2995661879182e9ef6204fdcd819faad Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-07 (Sat, 07 Mar 2015) Changed paths: M src/tests/net-core/Builder/TransformTest.cs A src/tests/net-core/Diff/DifferenceTest.cs Log Message: ----------- some additional tests |
From: GitHub <no...@gi...> - 2015-03-06 20:26:45
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit.net Commit: e37dd05fd4b431543590271a0071cbb220f25a8a https://github.com/xmlunit/xmlunit.net/commit/e37dd05fd4b431543590271a0071cbb220f25a8a Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-06 (Fri, 06 Mar 2015) Changed paths: M src/tests/net-core/Builder/InputTest.cs M src/tests/net-core/Diff/AbstractDifferenceEngineTest.cs M src/tests/net-core/Input/CommentLessSourceTest.cs A src/tests/net-core/Util/LinqyTest.cs M src/tests/net-core/Validation/ValidatorTest.cs Log Message: ----------- some additional unit tests |
From: GitHub <no...@gi...> - 2015-03-06 18:15:55
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: af694e4533a61f34b11c757aaf17ccae4c55b0cf https://github.com/xmlunit/xmlunit/commit/af694e4533a61f34b11c757aaf17ccae4c55b0cf Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-06 (Fri, 06 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/diff/AbstractDifferenceEngine.java Log Message: ----------- add some sense to a non-final getter for ComparisonController Commit: 3f540f19b2cc12624df6d80b71154d388a4ed82d https://github.com/xmlunit/xmlunit/commit/3f540f19b2cc12624df6d80b71154d388a4ed82d Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-06 (Fri, 06 Mar 2015) Changed paths: M xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java M xmlunit-core/src/test/java/org/xmlunit/builder/TransformTest.java M xmlunit-core/src/test/java/org/xmlunit/diff/AbstractDifferenceEngineTest.java A xmlunit-core/src/test/java/org/xmlunit/diff/DifferenceTest.java A xmlunit-core/src/test/java/org/xmlunit/validation/ValidationHandlerTest.java A xmlunit-core/src/test/java/org/xmlunit/validation/ValidatorTest.java Log Message: ----------- additional unit tests, not all of them trivial Compare: https://github.com/xmlunit/xmlunit/compare/89ac00d08c3d...3f540f19b2cc |
From: GitHub <no...@gi...> - 2015-03-06 14:52:21
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 89ac00d08c3d7589affb903741047534c1cef617 https://github.com/xmlunit/xmlunit/commit/89ac00d08c3d7589affb903741047534c1cef617 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-06 (Fri, 06 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/validation/ParsingValidator.java M xmlunit-core/src/test/java/org/xmlunit/diff/AbstractDifferenceEngineTest.java M xmlunit-core/src/test/java/org/xmlunit/validation/ParsingValidatorTest.java Log Message: ----------- even more exception stuff |
From: GitHub <no...@gi...> - 2015-03-06 09:25:08
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 2c77e5295b8c6372e811b9212b2c31490ecafbe3 https://github.com/xmlunit/xmlunit/commit/2c77e5295b8c6372e811b9212b2c31490ecafbe3 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-06 (Fri, 06 Mar 2015) Changed paths: A xmlunit-core/src/test/java/org/xmlunit/util/IterableNodeListTest.java Log Message: ----------- test for IterableNodeList Commit: e67ea6a870bd4466d1b9b7f67df22cf8b22f76c7 https://github.com/xmlunit/xmlunit/commit/e67ea6a870bd4466d1b9b7f67df22cf8b22f76c7 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-06 (Fri, 06 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java M xmlunit-core/src/test/java/org/xmlunit/util/LinqyTest.java Log Message: ----------- test and fix Linqy's iterator's remove methods Commit: 29986a320e4c0c58c88108a206c077f1828620c9 https://github.com/xmlunit/xmlunit/commit/29986a320e4c0c58c88108a206c077f1828620c9 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-06 (Fri, 06 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/validation/JAXPValidator.java M xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java M xmlunit-core/src/test/java/org/xmlunit/diff/AbstractDifferenceEngineTest.java M xmlunit-core/src/test/java/org/xmlunit/input/CommentLessSourceTest.java M xmlunit-core/src/test/java/org/xmlunit/util/LinqyTest.java M xmlunit-core/src/test/java/org/xmlunit/validation/JAXPValidatorTest.java M xmlunit-core/src/test/java/org/xmlunit/validation/ParsingValidatorTest.java M xmlunit-core/src/test/java/org/xmlunit/xpath/JAXPXPathEngineTest.java Log Message: ----------- tests for exceptional paths Compare: https://github.com/xmlunit/xmlunit/compare/8e8039c7de05...29986a320e4c |
From: GitHub <no...@gi...> - 2015-03-05 19:00:35
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit.net Commit: b4503dd8bad335a782561644c30b8ab3a595da43 https://github.com/xmlunit/xmlunit.net/commit/b4503dd8bad335a782561644c30b8ab3a595da43 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M src/tests/net-core/Util/ConvertTest.cs Log Message: ----------- test ToNamespaceContext |
From: GitHub <no...@gi...> - 2015-03-05 17:52:01
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: f61feef67a7936668d0768a4fbb601bbc1e5d241 https://github.com/xmlunit/xmlunit/commit/f61feef67a7936668d0768a4fbb601bbc1e5d241 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-core/src/test/java/org/xmlunit/util/ConvertTest.java Log Message: ----------- cover two-arg toNode Commit: 8e8039c7de05c0a23727229a43ae51a43c14099a https://github.com/xmlunit/xmlunit/commit/8e8039c7de05c0a23727229a43ae51a43c14099a Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-core/src/test/java/org/xmlunit/util/ConvertTest.java Log Message: ----------- cover namespacecontext Compare: https://github.com/xmlunit/xmlunit/compare/fd44d9f9255a...8e8039c7de05 |
From: GitHub <no...@gi...> - 2015-03-05 17:32:59
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit.net Commit: 878a9c2ba384c27ec7b57445bce21d397bafb98b https://github.com/xmlunit/xmlunit.net/commit/878a9c2ba384c27ec7b57445bce21d397bafb98b Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M src/main/net-core/Diff/ElementSelectors.cs Log Message: ----------- add and remove a few null-guards Commit: e80142c5c822847c1e8e1604b49b785c2a1fb0a6 https://github.com/xmlunit/xmlunit.net/commit/e80142c5c822847c1e8e1604b49b785c2a1fb0a6 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M src/tests/net-core/Diff/ElementSelectorsTest.cs Log Message: ----------- test exceptional behavior Compare: https://github.com/xmlunit/xmlunit.net/compare/5044a52b0aae...e80142c5c822 |
From: GitHub <no...@gi...> - 2015-03-05 17:04:51
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 65a25daf3848c8e1c626927fb3f6096c0ea30e98 https://github.com/xmlunit/xmlunit/commit/65a25daf3848c8e1c626927fb3f6096c0ea30e98 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/diff/ElementSelectors.java Log Message: ----------- additional null-guards Commit: 621bc339c2e41c5e591ad290796a9fd660b78d1a https://github.com/xmlunit/xmlunit/commit/621bc339c2e41c5e591ad290796a9fd660b78d1a Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/diff/ElementSelectors.java Log Message: ----------- unneeded null-guards Commit: fd44d9f9255a2c25c698dc3caefae69d8118243a https://github.com/xmlunit/xmlunit/commit/fd44d9f9255a2c25c698dc3caefae69d8118243a Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/util/Convert.java M xmlunit-core/src/test/java/org/xmlunit/diff/ElementSelectorsTest.java M xmlunit-core/src/test/java/org/xmlunit/util/ConvertTest.java Log Message: ----------- test exceptional behavior Compare: https://github.com/xmlunit/xmlunit/compare/3134581c8824...fd44d9f9255a |
From: GitHub <no...@gi...> - 2015-03-05 15:38:27
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit.net Commit: f20ed02e7f1bcd64270742012ff1680d7c9cbe00 https://github.com/xmlunit/xmlunit.net/commit/f20ed02e7f1bcd64270742012ff1680d7c9cbe00 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: A src/tests/net-core/Validation/ValidationProblemTest.cs Log Message: ----------- trivial testcase Commit: 6b152b9ca0fb1078a8db7764be50b74973ebadba https://github.com/xmlunit/xmlunit.net/commit/6b152b9ca0fb1078a8db7764be50b74973ebadba Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M src/main/net-core/Transform/Transformation.cs Log Message: ----------- InvalidOperationException is more appropriate for null source in Transform Commit: 5044a52b0aae81571ec2a6799e5a9ed791b027d5 https://github.com/xmlunit/xmlunit.net/commit/5044a52b0aae81571ec2a6799e5a9ed791b027d5 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M src/main/net-core/Transform/Transformation.cs M src/tests/net-core/Transform/TransformationTest.cs Log Message: ----------- expand test coverage for Transformation Compare: https://github.com/xmlunit/xmlunit.net/compare/13e92f2c0161...5044a52b0aae |
From: GitHub <no...@gi...> - 2015-03-05 15:05:40
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 3134581c8824250a87096c913bebf944195091b8 https://github.com/xmlunit/xmlunit/commit/3134581c8824250a87096c913bebf944195091b8 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java M xmlunit-core/src/test/java/org/xmlunit/transform/TransformationTest.java Log Message: ----------- IllegalStateException is the better fit for missing source in transform() |
From: GitHub <no...@gi...> - 2015-03-05 14:24:23
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: f7d2187ff9c7a3f40cab559b76763c02bacb9604 https://github.com/xmlunit/xmlunit/commit/f7d2187ff9c7a3f40cab559b76763c02bacb9604 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-core/src/main/java/org/xmlunit/ConfigurationException.java M xmlunit-core/src/main/java/org/xmlunit/XMLUnitException.java Log Message: ----------- exceptions are serializable, better treat them properly |
From: GitHub <no...@gi...> - 2015-03-05 14:16:03
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 8f1775e6e1449f1acfe715832b6d195529001049 https://github.com/xmlunit/xmlunit/commit/8f1775e6e1449f1acfe715832b6d195529001049 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M pom.xml M xmlunit-core/pom.xml M xmlunit-core/src/test/java/org/xmlunit/transform/TransformationTest.java Log Message: ----------- improve test coverage of Transformation class |
From: GitHub <no...@gi...> - 2015-03-05 12:37:33
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 34e02e3b37875b372bb4b2a6045b121d0eaab004 https://github.com/xmlunit/xmlunit/commit/34e02e3b37875b372bb4b2a6045b121d0eaab004 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: A xmlunit-core/src/test/java/org/xmlunit/util/IsNullPredicateTest.java A xmlunit-core/src/test/java/org/xmlunit/validation/ValidationProblemTest.java Log Message: ----------- add trivial test cases Commit: 186505a5ac4a1d91a18017a85b9142058837effe https://github.com/xmlunit/xmlunit/commit/186505a5ac4a1d91a18017a85b9142058837effe Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-core/src/test/java/org/xmlunit/validation/ValidationProblemTest.java Log Message: ----------- test for translation of unknown locations Compare: https://github.com/xmlunit/xmlunit/compare/016f42ccc6d9...186505a5ac4a |
From: GitHub <no...@gi...> - 2015-03-05 12:18:51
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit.net Commit: 0f86d56ce0d7f587c93538bc193aeab4fca483a4 https://github.com/xmlunit/xmlunit.net/commit/0f86d56ce0d7f587c93538bc193aeab4fca483a4 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M test-resources Log Message: ----------- stop abusing other people's domains Commit: 1295349ea3180f3fbdb513a455725c0239481817 https://github.com/xmlunit/xmlunit.net/commit/1295349ea3180f3fbdb513a455725c0239481817 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M src/main/net-constraints/ValidationConstraints.cs M src/tests/net-constraints/ValidationConstraintsTest.cs Log Message: ----------- add null-guards for ValidationConstraints Commit: 8042f7e399bb556e69a12e052dc773e2a5012a76 https://github.com/xmlunit/xmlunit.net/commit/8042f7e399bb556e69a12e052dc773e2a5012a76 Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M src/main/net-constraints/ValidationConstraints.cs M src/tests/net-constraints/ValidationConstraintsTest.cs Log Message: ----------- properly deal with no schema sources at all - in theory Commit: 13e92f2c0161741e696d47dbdeee2c6282a1ba9f https://github.com/xmlunit/xmlunit.net/commit/13e92f2c0161741e696d47dbdeee2c6282a1ba9f Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M src/tests/net-constraints/ValidationConstraintsTest.cs Log Message: ----------- create AssertionExceptions in order to run through Write* methods Compare: https://github.com/xmlunit/xmlunit.net/compare/bbe43b74b753...13e92f2c0161 |
From: GitHub <no...@gi...> - 2015-03-05 12:00:09
|
Branch: refs/heads/master Home: https://github.com/xmlunit/xmlunit Commit: 016f42ccc6d985260d9abbef001c64d3e37c50fc https://github.com/xmlunit/xmlunit/commit/016f42ccc6d985260d9abbef001c64d3e37c50fc Author: Stefan Bodewig <ste...@fr...> Date: 2015-03-05 (Thu, 05 Mar 2015) Changed paths: M xmlunit-matchers/src/main/java/org/xmlunit/matchers/ValidationMatcher.java Log Message: ----------- fix message |