I've been seeing that XMLUnit does not fail for the given scenario, such as two closely identical xml files are compared where one of them is a bad-form.
For example:
<envelope01>....</envelope>
and
<envelope>....</envelope>
Eventhough the junit swing passed the test, the error message was printed on the command line.
Has it anything to do with junit ?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
String control = "<envelope><header><orig>1</orig></header><body>test</body></envelope>";
String test = "<envelope0001><header><orig>1</orig></header><body>test</body></envelope>";
xmlTestCase.assertXMLEqual(control, test);
assertXMLEqual does not fail.
Any hint ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The difference is I have the try-catch block instead of just throwing an exception in my test case.
If I put the assertXMLEqual() inside the try-catch block, the swing junit will not display the failure whenever an exception is raised.
I think I should follow your suggestion. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been seeing that XMLUnit does not fail for the given scenario, such as two closely identical xml files are compared where one of them is a bad-form.
For example:
<envelope01>....</envelope>
and
<envelope>....</envelope>
Eventhough the junit swing passed the test, the error message was printed on the command line.
Has it anything to do with junit ?
Thanks.
I tried with this sample:
String control = "<envelope><header><orig>1</orig></header><body>test</body></envelope>";
String test = "<envelope0001><header><orig>1</orig></header><body>test</body></envelope>";
xmlTestCase.assertXMLEqual(control, test);
assertXMLEqual does not fail.
Any hint ?
Sorry for the slow reply, I'm having one of those lives.
Just tried this
public void testBug() throws Exception{
String control = "<envelope><header><orig>1</orig></header><body>test</body></envelope>";
String test = "<envelope0001><header><orig>1</orig></header><body>test</body></envelope>";
assertXMLEqual(control, test);
}
and it fails quite happily.
Not quite sure what your problem could be. Can you post the complete testsuite code?
The difference is I have the try-catch block instead of just throwing an exception in my test case.
If I put the assertXMLEqual() inside the try-catch block, the swing junit will not display the failure whenever an exception is raised.
I think I should follow your suggestion. Thanks.