JarFileEntityResolver entityResolver = new JarFileEntityResolver();
entityResolver.addSystemIdMapping(
"http://www.wapforum.org/DTD/wml_1.1.xml",
"com/volantis/mcs/protocols/dtd/wml_1.1.xml");
// create the Documents from the markup
StyledDOMTester tester = new StyledDOMTester(entityResolver);
Document inputDoc =
tester.parse(getClass().getResourceAsStream(inputFile));
Document expectedDoc =
tester.parse(getClass().getResourceAsStream(expectedFile));
DOMProtocol protocol = createProtocol(protocolConfig, psf);
protocol.setMarinerPageContext(pageContext);
// run the test
XFormEmulationTransformer transformer = new XFormEmulationTransformer();
Document outputDoc = transformer.transform(protocol, inputDoc);
// convert Document to markup
String canonicalExpectedXML = tester.render(expectedDoc);
String actualXML = tester.render(outputDoc);
// compare the actual markup with that expected
assertXMLEquals("Actual XML does not match expected XML." +
"\nExpectedXML:\n" + canonicalExpectedXML +
"\nActualXML:\n" + actualXML,