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 9 10 11Copyright (c) 2001 World Wide Web Consortium, 12 13(Massachusetts Institute of Technology, Institut National de 14 15Recherche en Informatique et en Automatique, Keio University). All 16 17Rights Reserved. This program is distributed under the W3C's Software 18 19Intellectual Property License. This program is distributed in the 20 21hope that it will be useful, but WITHOUT ANY WARRANTY; without even 22 23the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 24 25PURPOSE. 26 27 28 29See W3C License http://www.w3.org/Consortium/Legal/ for more details. 30 31 32 33 34*/ 35 36package org.w3c.domts.level2.core; 37 38import org.w3c.dom.*; 39 40 41import org.w3c.domts.DOMTestCase; 42import org.w3c.domts.DOMTestDocumentBuilderFactory; 43 44 45 46/** 47 * The "getOwnerElement()" will return the Element node this attribute 48 * is attached to or null if this attribute is not in use. 49 * 50 * Create a new attribute node for this document node. Since the newly attribute is 51 * not it use its owner element should be null. 52* @author IBM 53* @author Neil Delima 54* @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement">http://www.w3.org/TR/DOM-Level-2-Core/core#Attr-ownerElement</a> 55*/ 56public final class attrgetownerelement03 extends DOMTestCase { 57 58 /** 59 * Constructor. 60 * @param factory document factory, may not be null 61 * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration 62 */ 63 public attrgetownerelement03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException { 64 super(factory); 65 66 // 67 // check if loaded documents are supported for content type 68 // 69 String contentType = getContentType(); 70 preload(contentType, "staffNS", false); 71 } 72 73 /** 74 * Runs the test case. 75 * @throws Throwable Any uncaught exception causes test to fail 76 */ 77 public void runTest() throws Throwable { 78 Document doc; 79 Node ownerElement; 80 Attr attr; 81 doc = (Document) load("staffNS", false); 82 attr = doc.createAttributeNS("http://www.w3.org/DOM", "dom:attr"); 83 ownerElement = attr.getOwnerElement(); 84 assertNull("attrgetownerelement03", ownerElement); 85 } 86 /** 87 * Gets URI that identifies the test. 88 * @return uri identifier of test 89 */ 90 public String getTargetURI() { 91 return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/attrgetownerelement03"; 92 } 93 /** 94 * Runs this test from the command line. 95 * @param args command line arguments 96 */ 97 public static void main(final String[] args) { 98 DOMTestCase.doMain(attrgetownerelement03.class, args); 99 } 100} 101 102