InternalSubset.java revision f6c387128427e121477c1b32ad35cdcaa5101ba3
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 dalvik.annotation.TestTargets;
26import dalvik.annotation.TestLevel;
27import dalvik.annotation.TestTargetNew;
28import dalvik.annotation.TestTargetClass;
29
30import org.w3c.dom.DocumentType;
31import org.w3c.dom.Document;
32
33import 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)
48public 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
93