I have an issue in the following code.
String xml1="<Akash><status>COMPLETE</status>"
+"<startedTime>23</startedTime></Akash>";
String xml2="<Akash><status>COMPLETE</status><startedTime></startedTime></Akash>";
Diff diff = new Diff(xml1,xml2);
diff.overrideElementQualifier(new ElementNameAndTextQualifier());
assertTrue("XML similar " + diff.toString(), diff.similar());
When I dont' write this following line in my above java code.
XMLUnit.setIgnoreWhitespace(true)
Assert gives an exception near "started time" that value of this node is not there, which is what I wanted, because value 23 is not present. But when I add this line (setIgnoreWhitespace) to the code before instantiating Diff class, Despite having same xml, this code passes the assert test.
I am really not getting what the **** is happening here. Please help me.
Note: I need XMLUnit.setIgnoreWhitespace(true) for equating two xmls which have space in between some of their nodes, otherwise code gives some other error.
Aucun commentaire:
Enregistrer un commentaire