1 2/* 3This Java source file was generated by test-to-java.xsl 4and is a derived work from the source document. 5The source document contained the following notice: 6 7 8 9Copyright (c) 2001-2004 World Wide Web Consortium, 10(Massachusetts Institute of Technology, Institut National de 11Recherche en Informatique et en Automatique, Keio University). All 12Rights Reserved. This program is distributed under the W3C's Software 13Intellectual Property License. This program is distributed in the 14hope that it will be useful, but WITHOUT ANY WARRANTY; without even 15the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 16PURPOSE. 17 18See W3C License http://www.w3.org/Consortium/Legal/ for more details. 19 20 21*/ 22 23package tests.org.w3c.dom; 24 25import org.w3c.dom.DocumentType; 26import org.w3c.dom.Document; 27 28import javax.xml.parsers.DocumentBuilder; 29 30/** 31 * The "getInternalSubset()" method returns 32 * the internal subset as a string or null if there is none. 33 * This does not contain the delimiting brackets. 34 * 35 * Retrieve the documenttype. 36 * Apply the "getInternalSubset()" method. Null is returned since there 37 * is not an internal subset. 38* @author NIST 39* @author Mary Brady 40* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset</a> 41*/ 42public final class InternalSubset extends DOMTestCase { 43 44 DOMDocumentBuilderFactory factory; 45 46 DocumentBuilder builder; 47 48 protected void setUp() throws Exception { 49 super.setUp(); 50 try { 51 factory = new DOMDocumentBuilderFactory(DOMDocumentBuilderFactory 52 .getConfiguration1()); 53 builder = factory.getBuilder(); 54 } catch (Exception e) { 55 fail("Unexpected exception" + e.getMessage()); 56 } 57 } 58 59 protected void tearDown() throws Exception { 60 factory = null; 61 builder = null; 62 super.tearDown(); 63 } 64 65 /** 66 * Runs the test case. 67 * @throws Throwable Any uncaught exception causes test to fail 68 */ 69 public void testGetInternalSubset() throws Throwable { 70 Document doc; 71 DocumentType docType; 72 String internal; 73 doc = (Document) load("staff2", builder); 74 docType = doc.getDoctype(); 75 internal = docType.getInternalSubset(); 76 assertNull("internalSubsetNull", internal); 77 } 78 79} 80 81