OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / libcore / dom / src / test / java / org / w3c / domts / level2 / core / isSupported07.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 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 org.w3c.domts.level2.core;
24
25 import org.w3c.dom.*;
26
27
28 import org.w3c.domts.DOMTestCase;
29 import org.w3c.domts.DOMTestDocumentBuilderFactory;
30
31
32
33 /**
34  *     The "feature" parameter in the
35  *     isSupported(feature,version)" method is the name
36  *     of the feature and the version is the version number of the
37  *     feature to test.   XML is a legal value for the feature parameter
38  *     (Test for XML). 
39  *     If the version is not specified, supporting any version of the
40  *     method to return true.
41  *     
42  *     Retrieve the root node of the DOM document by invoking 
43  *     the "getDocumentElement()" method.   This should create a
44  *     node object on which the "isSupported(feature,version)"
45  *     method is invoked with "feature" equal to "XML" and the version equal blank.
46  *     The method should return a boolean "true".
47 * @author NIST
48 * @author Mary Brady
49 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
50 */
51 public final class isSupported07 extends DOMTestCase {
52
53    /**
54     * Constructor.
55     * @param factory document factory, may not be null
56     * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
57     */
58    public isSupported07(final DOMTestDocumentBuilderFactory factory)  throws org.w3c.domts.DOMTestIncompatibleException {
59       super(factory);
60
61     //
62     //   check if loaded documents are supported for content type
63     //
64     String contentType = getContentType();
65     preload(contentType, "staff", false);
66     }
67
68    /**
69     * Runs the test case.
70     * @throws Throwable Any uncaught exception causes test to fail
71     */
72    public void runTest() throws Throwable {
73       Document doc;
74       Node rootNode;
75       boolean state;
76       doc = (Document) load("staff", false);
77       rootNode = doc.getDocumentElement();
78       state = rootNode.isSupported("XML", "");
79       assertTrue("throw_True", state);
80       }
81    /**
82     *  Gets URI that identifies the test.
83     *  @return uri identifier of test
84     */
85    public String getTargetURI() {
86       return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported07";
87    }
88    /**
89     * Runs this test from the command line.
90     * @param args command line arguments
91     */
92    public static void main(final String[] args) {
93         DOMTestCase.doMain(isSupported07.class, args);
94    }
95 }
96