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:
11 Copyright (c) 2001 World Wide Web Consortium,
13 (Massachusetts Institute of Technology, Institut National de
15 Recherche en Informatique et en Automatique, Keio University). All
17 Rights Reserved. This program is distributed under the W3C's Software
19 Intellectual Property License. This program is distributed in the
21 hope that it will be useful, but WITHOUT ANY WARRANTY; without even
23 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29 See W3C License http://www.w3.org/Consortium/Legal/ for more details.
36 package org.w3c.domts.level2.core;
41 import org.w3c.domts.DOMTestCase;
42 import org.w3c.domts.DOMTestDocumentBuilderFactory;
47 * The "feature" parameter in the
48 * "hasFeature(feature,version)" method is the package name
49 * of the feature. Legal values are XML and HTML and CORE.
50 * (Test for feature core, lower case)
52 * Retrieve the entire DOM document and invoke its
53 * "getImplementation()" method. This should create a
54 * DOMImplementation object whose "hasFeature(feature,
55 * version)" method is invoked with feature equal to "core".
56 * The method should return a boolean "true".
59 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7</a>
61 public final class domimplementationfeaturecore extends DOMTestCase {
65 * @param factory document factory, may not be null
66 * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
68 public domimplementationfeaturecore(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
72 // check if loaded documents are supported for content type
74 String contentType = getContentType();
75 preload(contentType, "staff", false);
80 * @throws Throwable Any uncaught exception causes test to fail
82 public void runTest() throws Throwable {
84 DOMImplementation domImpl;
86 doc = (Document) load("staff", false);
87 domImpl = doc.getImplementation();
88 state = domImpl.hasFeature("core", "2.0");
89 assertTrue("domimplementationFeaturecoreAssert", state);
92 * Gets URI that identifies the test.
93 * @return uri identifier of test
95 public String getTargetURI() {
96 return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationfeaturecore";
99 * Runs this test from the command line.
100 * @param args command line arguments
102 public static void main(final String[] args) {
103 DOMTestCase.doMain(domimplementationfeaturecore.class, args);