SPR-6907 - JibxMarshaller - provide access to jibx's writeDocType

This commit is contained in:
Arjen Poutsma
2010-03-02 11:56:22 +00:00
parent d207c2294d
commit 9d1c3fa9ac
2 changed files with 111 additions and 26 deletions

View File

@@ -75,6 +75,16 @@ public class JibxMarshallerTests extends AbstractMarshallerTests {
writer.toString().startsWith("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\"?>"));
}
@Test
public void dtd() throws Exception {
((JibxMarshaller) marshaller).setDocTypeRootElementName("flights");
((JibxMarshaller) marshaller).setDocTypeSystemId("flights.dtd");
StringWriter writer = new StringWriter();
marshaller.marshal(flights, new StreamResult(writer));
assertTrue("doc type not written",
writer.toString().contains("<!DOCTYPE flights SYSTEM \"flights.dtd\">"));
}
@Test
public void testSupports() throws Exception {
assertTrue("JibxMarshaller does not support Flights", marshaller.supports(Flights.class));