public void testConstructor1Arg() {
String name = "MyName";
DocType doctype = new DocType(name);
assertEquals(name, doctype.getRootElementName());
assertEquals("", doctype.getInternalDTDSubset());
assertNull(doctype.getSystemID());
assertNull(doctype.getPublicID());
// legal to have a colon here
name = "try:MyName";
doctype = new DocType(name);
assertEquals("", doctype.getInternalDTDSubset());
assertEquals(name, doctype.getRootElementName());
assertNull(doctype.getSystemID());
assertNull(doctype.getPublicID());
// illegal name
try {
name = "try MyName";
doctype = new DocType(name);
fail("allowed root element name to contain spaces");
}
catch (IllegalNameException success) {
assertNotNull(success.getMessage());
}