* Test the generateSaxFragment method.
* @throws MalformedURLException
* @throws ParserConfigurationException
*/
public void testGenerateSaxFragment() throws Exception {
DOMBuilder dest = new DOMBuilder();
ResourceSource source =
new ResourceSource("resource://org/apache/cocoon/woody/datatype/DynamicSelectionListTestCase.source.xml");
Document sourceDoc = parser.parse(source.getInputStream());
Element datatypeElement = (Element) sourceDoc.getElementsByTagNameNS(Constants.WD_NS, "convertor").item(0);
Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
DynamicSelectionList list =
new DynamicSelectionList(datatype, null, serviceManager);
list.generateSaxFragment(dest, Locale.ENGLISH, source);
ResourceSource expectedSource =
new ResourceSource("resource://org/apache/cocoon/woody/datatype/DynamicSelectionListTestCase.dest.xml");
Document expected = parser.parse(expectedSource.getInputStream());
assertEqual("Test if output is what is expected",
expected, dest.getDocument());
}