Posted By:
Scott_Large
Posted On:
Thursday, March 20, 2003 02:53 AM
I have been having a debate with a few other developers about how to test a method in a class that expects a JDOM element. They say it is ok to read in an XML file and extract the required element but I say it is best to build up the Element in code. Does anyone know the general practice for testing this sort of method? I believe classes should be as self contained as possible and not rely on other parts of the system. Obviously if a class is responsible for parsing an XML file or reading a text file then an external file is needed. What do you people think? Cheers.
More>>
I have been having a debate with a few other developers about how to test a method in a class that expects a JDOM element.
They say it is ok to read in an XML file and extract the required element but I say it is best to build up the Element in code.
Does anyone know the general practice for testing this sort of method?
I believe classes should be as self contained as possible and not rely on other parts of the system. Obviously if a class is responsible for parsing an XML file or reading a text file then an external file is needed.
What do you people think?
Cheers.
<<Less