Home | History | Annotate | Download | only in core
      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  * Calls isSupported("Core",null) should return true for all implementations (by extension of core-14).
     35 * @author Curt Arnold
     36 * @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>
     37 * @see <a href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-14">http://www.w3.org/2000/11/DOM-Level-2-errata#core-14</a>
     38 */
     39 public final class isSupported14 extends DOMTestCase {
     40 
     41    /**
     42     * Constructor.
     43     * @param factory document factory, may not be null
     44     * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
     45     */
     46    public isSupported14(final DOMTestDocumentBuilderFactory factory)  throws org.w3c.domts.DOMTestIncompatibleException {
     47       super(factory);
     48 
     49     //
     50     //   check if loaded documents are supported for content type
     51     //
     52     String contentType = getContentType();
     53     preload(contentType, "staff", false);
     54     }
     55 
     56    /**
     57     * Runs the test case.
     58     * @throws Throwable Any uncaught exception causes test to fail
     59     */
     60    public void runTest() throws Throwable {
     61       Document doc;
     62       Node rootNode;
     63       boolean state;
     64       String nullString = null;
     65 
     66       doc = (Document) load("staff", false);
     67       rootNode = doc.getDocumentElement();
     68       state = rootNode.isSupported("Core", nullString);
     69       assertTrue("Core", state);
     70       }
     71    /**
     72     *  Gets URI that identifies the test.
     73     *  @return uri identifier of test
     74     */
     75    public String getTargetURI() {
     76       return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/isSupported14";
     77    }
     78    /**
     79     * Runs this test from the command line.
     80     * @param args command line arguments
     81     */
     82    public static void main(final String[] args) {
     83         DOMTestCase.doMain(isSupported14.class, args);
     84    }
     85 }
     86 
     87