I'm trying to write a XMLUnitTest that compares to XMLDocuments that basically
have to layers of elements, that can be out of order.
<root>
<table>
<id>1</id>
<row>
<c>a</c >
<c>b</c >
</row>
</table>
<table>
<id>2</id>
<row>
<c>b</c >
<c>a</c >
</row>
</table>
</root>
So table can be out of order (with different id) and their corresponding row
columns can be out of order. I think it boils down to these test cases:
@Test
public void testIdenticalAndSimilar() throws Exception {
final String
controlXML="<account><id>3A-00</id><name>acme</name></account>";
final String
testXML="<account><name>acme</name><id>3A-00</id></account>";
final Diff diff=new Diff(controlXML, testXML);
assertTrue(diff.similar());
}
@Test
public void testIdenticalAndSimilarWithNested() throws Exception {
final String
controlXML="<table><id>1</id><map><k>a</k><k>b</k></map></table>";
final String
testXML="<table><id>1</id><map><k>b</k><k>a</k></map></table>";
final Diff diff=new Diff(controlXML, testXML);
assertTrue(diff.similar());
}
The second one should also pass but doesn't. Does anybody know a solution?
Best regards
Oliver Schrenk
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Xmlunit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmlunit-general