createDocument08.java revision adc854b798c1cfe3bfd4c27d68d5cee38ca617da
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) 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 org.w3c.domts.level2.core;
24
25import org.w3c.dom.*;
26
27
28import org.w3c.domts.DOMTestCase;
29import org.w3c.domts.DOMTestDocumentBuilderFactory;
30
31
32
33/**
34 * DOMImplementation.createDocument with an empty qualified name should cause an INVALID_CHARACTER_ERR.
35* @author Curt Arnold
36* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#">http://www.w3.org/TR/DOM-Level-2-Core/core#</a>
37* @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=525">http://www.w3.org/Bugs/Public/show_bug.cgi?id=525</a>
38*/
39public final class createDocument08 extends DOMTestCase {
40
41   /**
42    * Constructor.
43    * @param factory document factory, may not be null
44    */
45   public createDocument08(final DOMTestDocumentBuilderFactory factory)  {
46      super(factory);
47
48    //
49    //   check if loaded documents are supported for content type
50    //
51    String contentType = getContentType();
52    }
53
54   /**
55    * Runs the test case.
56    * @throws Throwable Any uncaught exception causes test to fail
57    */
58   public void runTest() throws Throwable {
59      String namespaceURI = "http://www.example.org/schema";
60      DocumentType docType = null;
61
62      DOMImplementation domImpl;
63      Document aNewDoc;
64      String charact;
65      domImpl = getImplementation();
66
67      {
68         boolean success = false;
69         try {
70            aNewDoc = domImpl.createDocument(namespaceURI, "", docType);
71          } catch (DOMException ex) {
72            success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
73         }
74         assertTrue("throw_INVALID_CHARACTER_ERR", success);
75      }
76}
77   /**
78    *  Gets URI that identifies the test.
79    *  @return uri identifier of test
80    */
81   public String getTargetURI() {
82      return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument08";
83   }
84   /**
85    * Runs this test from the command line.
86    * @param args command line arguments
87    */
88   public static void main(final String[] args) {
89        DOMTestCase.doMain(createDocument08.class, args);
90   }
91}
92
93