From: <bo...@us...> - 2009-06-19 11:29:41
|
Revision: 350 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=350&view=rev Author: bodewig Date: 2009-06-19 11:29:39 +0000 (Fri, 19 Jun 2009) Log Message: ----------- turn message 4817456 into a unit test Modified Paths: -------------- branches/xmlunit-1.x/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java Modified: branches/xmlunit-1.x/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java =================================================================== --- branches/xmlunit-1.x/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java 2009-06-19 11:20:40 UTC (rev 349) +++ branches/xmlunit-1.x/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java 2009-06-19 11:29:39 UTC (rev 350) @@ -929,6 +929,41 @@ assertFalse(listener.different); } + + /** + * @see https://sourceforge.net/forum/message.php?msg_id=4817456 + */ + public void testForumMessage4817456() throws Exception { + String control = "<doc>" + + "<id>123</id>" + + "<remarks>a</remarks>" + + "<remarks>b</remarks>" + + "<remarks>c</remarks>" + + "<remarks>d</remarks>" + + "<others>1</others>" + + "<others>2</others>" + + "<others>3</others>" + + "</doc>"; + String test = "<doc>" + + "<id>123</id>" + + "<remarks>a</remarks>" + + "<remarks>b</remarks>" + + "<remarks>c</remarks>" + + "<remarks>d</remarks>" + + "<remarks>e</remarks>" + + "<others>2</others>" + + "<others>3</others>" + + "</doc>"; + + Document controlDoc = XMLUnit.buildControlDocument(control); + Document testDoc = XMLUnit.buildTestDocument(test); + engine.compare(controlDoc, testDoc, listener, + new ElementNameAndTextQualifier()); + assertTrue(listener.different); + assertEquals(DifferenceConstants.ELEMENT_TAG_NAME_ID, + listener.comparingWhat); + } + private void listenToDifferences(String control, String test) throws SAXException, IOException { Document controlDoc = XMLUnit.buildControlDocument(control); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |