In my xml message that I need to test, one of the elements include dynamic information (as attribute values), such as a timestamp. The system that generates this xml fills this dynamically. Is there any way I can turn off checking for this element?
This way I can call the assertXMLEqual(..) method with a FileReader (that contains the control xml) and a SringReader (that has the test xml).
If this is not possible, any ideas of how I can achieve this...
Thanx
Bhaskar
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can use a custom DifferenceListener implementation to vary how to respond when a Difference is found between control and test XML. See the IgnoreTextAndAttributeValuesDifferenceListener for an example of such a class.
Hope this helps,
Tim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In my xml message that I need to test, one of the elements include dynamic information (as attribute values), such as a timestamp. The system that generates this xml fills this dynamically. Is there any way I can turn off checking for this element?
This way I can call the assertXMLEqual(..) method with a FileReader (that contains the control xml) and a SringReader (that has the test xml).
If this is not possible, any ideas of how I can achieve this...
Thanx
Bhaskar
You can use a custom DifferenceListener implementation to vary how to respond when a Difference is found between control and test XML. See the IgnoreTextAndAttributeValuesDifferenceListener for an example of such a class.
Hope this helps,
Tim