OSDN Git Service

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