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 method createElementNS creates an element of the given valid qualifiedName and NamespaceURI.
49 * Invoke the createElementNS method on this Document object with a valid namespaceURI
50 * and qualifiedName. Check if a valid Element object is returned with the same node attributes.
53 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a>
54 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
56 public final class documentcreateelementNS01 extends DOMTestCase {
60 * @param factory document factory, may not be null
61 * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
63 public documentcreateelementNS01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
67 // check if loaded documents are supported for content type
69 String contentType = getContentType();
70 preload(contentType, "staffNS", false);
75 * @throws Throwable Any uncaught exception causes test to fail
77 public void runTest() throws Throwable {
80 String namespaceURI = "http://www.w3.org/DOM/Test/level2";
81 String qualifiedName = "XML:XML";
87 doc = (Document) load("staffNS", false);
88 element = doc.createElementNS(namespaceURI, qualifiedName);
89 nodeName = element.getNodeName();
90 nsURI = element.getNamespaceURI();
91 localName = element.getLocalName();
92 prefix = element.getPrefix();
93 tagName = element.getTagName();
94 assertEquals("documentcreateelementNS01_nodeName", "XML:XML", nodeName);
95 assertEquals("documentcreateelementNS01_namespaceURI", "http://www.w3.org/DOM/Test/level2", nsURI);
96 assertEquals("documentcreateelementNS01_localName", "XML", localName);
97 assertEquals("documentcreateelementNS01_prefix", "XML", prefix);
98 assertEquals("documentcreateelementNS01_tagName", "XML:XML", tagName);
101 * Gets URI that identifies the test.
102 * @return uri identifier of test
104 public String getTargetURI() {
105 return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateelementNS01";
108 * Runs this test from the command line.
109 * @param args command line arguments
111 public static void main(final String[] args) {
112 DOMTestCase.doMain(documentcreateelementNS01.class, args);