@@ -20,7 +20,7 @@ public void testDTDWithOnlyRootElement() throws Exception
2020 {
2121 ObjectWriter w = MAPPER .writer ().with (
2222 new XmlGeneratorInitializer ()
23- .setDTD ("StringBean" , null , null , null ));
23+ .addDTD ("StringBean" , null , null , null ));
2424 assertEquals (a2q ("<!DOCTYPE StringBean>"
2525 +"<StringBean><text>test</text></StringBean>" ),
2626 w .writeValueAsString (new StringBean ("test" )));
@@ -31,7 +31,7 @@ public void testDTDWithPublicId() throws Exception
3131 {
3232 ObjectWriter w = MAPPER .writer ().with (
3333 new XmlGeneratorInitializer ()
34- .setDTD ("StringBean" , "system" , "http://foo.bar" , "" ));
34+ .addDTD ("StringBean" , "system" , "http://foo.bar" , "" ));
3535 assertEquals (a2q ("<!DOCTYPE StringBean PUBLIC 'http://foo.bar' 'system'>"
3636 +"<StringBean><text>test</text></StringBean>" ),
3737 w .writeValueAsString (new StringBean ("test" )));
@@ -42,7 +42,7 @@ public void testDTDWithSystemIdOnly() throws Exception
4242 {
4343 ObjectWriter w = MAPPER .writer ().with (
4444 new XmlGeneratorInitializer ()
45- .setDTD ("StringBean" , "system" , "" , null ));
45+ .addDTD ("StringBean" , "system" , "" , null ));
4646 assertEquals (a2q ("<!DOCTYPE StringBean SYSTEM 'system'>"
4747 +"<StringBean><text>test</text></StringBean>" ),
4848 w .writeValueAsString (new StringBean ("test" )));
@@ -53,7 +53,7 @@ public void testDTDWithInternalSubset() throws Exception
5353 {
5454 ObjectWriter w = MAPPER .writer ().with (
5555 new XmlGeneratorInitializer ()
56- .setDTD ("StringBean" , "system" , "http://foo.bar" , "<!ELEMENT root (#PCDATA)>" ));
56+ .addDTD ("StringBean" , "system" , "http://foo.bar" , "<!ELEMENT root (#PCDATA)>" ));
5757 assertEquals (a2q ("<!DOCTYPE StringBean PUBLIC 'http://foo.bar' 'system' "
5858 +"[<!ELEMENT root (#PCDATA)>]>"
5959 +"<StringBean><text>test</text></StringBean>" ),
@@ -69,7 +69,7 @@ public void testDTDWithXmlDeclaration() throws Exception
6969 .build ();
7070 ObjectWriter w = mapper .writer ().with (
7171 new XmlGeneratorInitializer ()
72- .setDTD ("StringBean" , "system" , "http://foo.bar" , null ));
72+ .addDTD ("StringBean" , "system" , "http://foo.bar" , null ));
7373 // XML declaration is emitted with single quotes, DOCTYPE with double quotes,
7474 // so cannot use a2q() on the whole string here.
7575 assertEquals ("<?xml version='1.0' encoding='UTF-8'?>"
@@ -85,7 +85,7 @@ public void testDTDInvalidNoRoot() throws Exception
8585 try {
8686 /*ObjectWriter w =*/ MAPPER .writer ().with (
8787 new XmlGeneratorInitializer ()
88- .setDTD ("" , null , null , null ));
88+ .addDTD ("" , null , null , null ));
8989 fail ("Should not pass" );
9090 } catch (IllegalArgumentException e ) {
9191 verifyException (e , "Illegal argument for 'rootName': must be" );
0 commit comments