Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,79 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Ignore; +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + + +/** + * The method removeNamedItemNS removes a node specified by local name and namespace + * A removed attribute may be known to have a default value when this map contains the + * attributes attached to an element, as returned by the attributes attribute of the Node + * interface. If so, an attribute immediately appears containing the default value as well + * as the corresponding namespace URI, local name, and prefix when applicable. + * Retreive a default attribute node. Remove it from the NodeMap. Check if a new one immediately + * appears containing the default value. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + */ +public class namednodemapremovenameditemns02 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + Node element; + Attr attribute; + NodeList elementList; + String attrValue; + String nullNS = null; + + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); + element = elementList.item(1); + attributes = element.getAttributes(); + attribute = (Attr) attributes.removeNamedItemNS(nullNS, "defaultAttr"); + attribute = (Attr) attributes.getNamedItemNS(nullNS, "defaultAttr"); + attrValue = attribute.getNodeValue(); + assertNotNull("namednodemapremovenameditemns02", attribute); + assertEquals("namednodemapremovenameditemns02_attrValue", "defaultVal", attrValue); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns02"; + } + +}
Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,74 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The method removeNamedItemNS removes a node specified by local name and namespace + * Create a new element node and add 2 new attribute nodes to it that have the same localName + * but different namespaceURI's. Remove the first attribute node from the namedNodeMap of the + * new element node and check to see that the second attribute still exists. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a> + */ +public class namednodemapremovenameditemns03 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + Node element; + Attr attribute; + Attr newAttribute; + Attr attribute1; + Attr attribute2; + String nodeName; + doc = load("staffNS", true); + element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); + attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); + newAttribute = ((Element) /*Node */element).setAttributeNodeNS(attribute1); + attribute2 = doc.createAttributeNS("http://www.w3.org/DOM/L2", "L2:att"); + newAttribute = ((Element) /*Node */element).setAttributeNodeNS(attribute2); + attributes = element.getAttributes(); + attribute = (Attr) attributes.removeNamedItemNS("http://www.w3.org/DOM/L1", "att"); + attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L2", "att"); + nodeName = attribute.getNodeName(); + assertEquals("namednodemapremovenameditemns02", "L2:att", nodeName); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns03"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,70 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertNull; + + +/** + * The method removeNamedItemNS removes a node specified by local name and namespace + * Attempt to remove the xmlns and dmstc attributes of the first element node with the localName + * employee. Verify if the 2 attributes were successfully removed. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a> + */ +public class namednodemapremovenameditemns04 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + Node element; + Attr attribute; + Attr attributeRemoved; + NodeList elementList; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("*", "employee"); + element = elementList.item(0); + attributes = element.getAttributes(); + attributeRemoved = (Attr) attributes.removeNamedItemNS("http://www.w3.org/2000/xmlns/", "xmlns"); + attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/2000/xmlns/", "xmlns"); + assertNull("namednodemapremovenameditemns04_1", attribute); + attributeRemoved = (Attr) attributes.removeNamedItemNS("http://www.w3.org/2000/xmlns/", "dmstc"); + attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/2000/xmlns/", "dmstc"); + assertNull("namednodemapremovenameditemns04_2", attribute); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns04"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,101 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Ignore; +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.fail; + + +/** + * Retreive an entity and notation node and remove the first notation from the + * entity node map and first entity node from the notation map. Since both these + * maps are readonly, a NO_MODIFICATION_ALLOWED_ERR should be raised. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=407">http://www.w3.org/Bugs/Public/show_bug.cgi?id=407</a> + * @see <a href="http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html">http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html</a> + */ + +public class namednodemapremovenameditemns05 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + DocumentType docType; + NamedNodeMap entities; + NamedNodeMap notations; + Node removedNode; + String nullNS = null; + + doc = load("staffNS", true); + docType = doc.getDoctype(); + entities = docType.getEntities(); + notations = docType.getNotations(); + + try { + removedNode = entities.removeNamedItemNS(nullNS, "ent1"); + fail("entity_throw_DOMException"); + + } catch (DOMException ex) { + switch (ex.code) { + case 8: + break; + case 7: + break; + default: + throw ex; + } + } + + try { + removedNode = notations.removeNamedItemNS(nullNS, "notation1"); + fail("notation_throw_DOMException"); + + } catch (DOMException ex) { + switch (ex.code) { + case 8: + break; + case 7: + break; + default: + throw ex; + } + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns05"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,75 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The method removeNamedItemNS removes a node using its namespaceURI and localName and + * raises a NOT_FOUND_ERR if there is no node with the specified namespaceURI and + * localName in this map + * Retreive an attribute node into a namednodemap. While removing it from the map specify + * an incorrect namespaceURI. This should raise a NOT_FOUND_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a> + */ +public class namednodemapremovenameditemns06 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + Node element; + Attr attribute; + NodeList elementList; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); + element = elementList.item(1); + attributes = element.getAttributes(); + + { + boolean success = false; + try { + attribute = (Attr) attributes.removeNamedItemNS("http://www.Nist.gov", "domestic"); + } catch (DOMException ex) { + success = (ex.code == DOMException.NOT_FOUND_ERR); + } + assertTrue("namednodemapremovenameditemns06", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns06"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,75 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The method removeNamedItemNS removes a node using its namespaceURI and localName and + * raises a NOT_FOUND_ERR if there is no node with the specified namespaceURI and + * localName in this map + * Retreive an attribute node from a namednodemap. While removing it from the map specify + * an incorrect localName. This should raise a NOT_FOUND_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a> + */ +public class namednodemapremovenameditemns07 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + Node element; + Attr attribute; + NodeList elementList; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); + element = elementList.item(1); + attributes = element.getAttributes(); + + { + boolean success = false; + try { + attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); + } catch (DOMException ex) { + success = (ex.code == DOMException.NOT_FOUND_ERR); + } + assertTrue("namednodemapremovenameditemns07", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns07"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,78 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The method removeNamedItemNS removes a node using its namespaceURI and localName and + * raises a NOT_FOUND_ERR if there is no node with the specified namespaceURI and + * localName in this map + * Retreive an attribute node from a namednodemap. Remove the attribute node from the document + * object. Since NamedNodeMaps are live it should also automatically get removed from + * the node map. And so if an attempt is made to remove it using removeAttributeNS, this should + * raise a NOT_FOUND_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a> + */ +public class namednodemapremovenameditemns08 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + Element element; + Attr attribute; + NodeList elementList; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + element = (Element) elementList.item(1); + attributes = element.getAttributes(); + element.removeAttributeNS("http://www.nist.gov", "domestic"); + + { + boolean success = false; + try { + attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); + } catch (DOMException ex) { + success = (ex.code == DOMException.NOT_FOUND_ERR); + } + assertTrue("namednodemapremovenameditemns08", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns08"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,70 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertNull; + + +/** + * The method removeNamedItemNS removes a node using its namespaceURI and localName and + * raises a NOT_FOUND_ERR if there is no node with the specified namespaceURI and + * localName in this map + * Retreive an attribute node. Remove the attribute node from the node map. + * Check the element object to ensure that the attribute node has been removed from it. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a> + */ +public class namednodemapremovenameditemns09 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + NamedNodeMap newAttributes; + Element element; + Attr attribute; + NodeList elementList; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + element = (Element) elementList.item(1); + attributes = element.getAttributes(); + attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); + newAttributes = element.getAttributes(); + attribute = (Attr) newAttributes.getNamedItemNS("http://www.nist.gov", "domestic"); + assertNull("namednodemapremovenameditemns09", attribute); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns09"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,74 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The method setNamedItemNS adds a node using its namespaceURI and localName. If a node with + * that namespace URI and that local name is already present in this map, it is replaced + * by the new one. + * Retreive the first element whose localName is address and namespaceURI http://www.nist.gov", + * and put its attributes into a named node map. Create a new attribute node and add it to this map. + * Verify if the attr node was successfully added by checking the nodeName of the retreived atttribute. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a> + */ +public class namednodemapsetnameditemns01 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + Node element; + Attr attribute; + Attr newAttribute; + Attr newAttr1; + NodeList elementList; + String attrName; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + element = elementList.item(0); + attributes = element.getAttributes(); + newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "streets"); + newAttribute = ((Element) /*Node */element).setAttributeNodeNS(newAttr1); + attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "streets"); + attrName = attribute.getNodeName(); + assertEquals("namednodemapsetnameditemns01", "streets", attrName); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns01"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,72 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The method setNamedItemNS adds a node using its namespaceURI and localName. If a node with + * that namespace URI and that local name is already present in this map, it is replaced + * by the new one. + * Create a new element and attribute Node and add the newly created attribute node to the elements + * NamedNodeMap. Verify if the new attr node has been successfully added to the map by checking + * the nodeName of the retreived atttribute from the list of attribute nodes in this map. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + */ +public class namednodemapsetnameditemns02 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + Element element; + Attr attribute; + Attr attribute1; + Node newNode; + String attrName; + doc = load("staffNS", true); + element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); + attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); + attributes = element.getAttributes(); + newNode = attributes.setNamedItemNS(attribute1); + attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "att"); + attrName = attribute.getNodeName(); + assertEquals("namednodemapsetnameditemns02", "L1:att", attrName); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns02"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,90 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The method setNamedItemNS adds a node using its namespaceURI and localName and + * raises a WRONG_DOCUMENT_ERR if arg was created from a different document than the + * one that created this map. + * Retreieve the second element whose local name is address and its attribute into a named node map. + * Do the same for another document and retreive its street attribute. Call the setNamedItemNS + * using the first namedNodeMap and the retreive street attribute of the second. This should + * raise a WRONG_DOCUMENT_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + */ +public class namednodemapsetnameditemns03 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document docAlt; + NamedNodeMap attributes; + NamedNodeMap attributesAlt; + NodeList elementList; + NodeList elementListAlt; + Element element; + Element elementAlt; + Attr attr; + Node newNode; + String nullNS = null; + + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("*", "address"); + element = (Element) elementList.item(1); + attributes = element.getAttributes(); + docAlt = load("staffNS", true); + elementListAlt = docAlt.getElementsByTagNameNS("*", "address"); + elementAlt = (Element) elementListAlt.item(1); + attributesAlt = elementAlt.getAttributes(); + attr = (Attr) attributesAlt.getNamedItemNS(nullNS, "street"); + + { + boolean success = false; + try { + newNode = attributes.setNamedItemNS(attr); + } catch (DOMException ex) { + success = (ex.code == DOMException.WRONG_DOCUMENT_ERR); + } + assertTrue("namednodemapsetnameditemns03", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns03"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,90 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The method setNamedItemNS adds a node using its namespaceURI and localName and + * raises a WRONG_DOCUMENT_ERR if arg was created from a different document than the + * one that created this map. + * Retreieve the second element whose local name is address and its attribute into a named node map. + * Create a new document and a new attribute node in it. Call the setNamedItemNS using the first + * namedNodeMap and the new attribute node attribute of the new document. This should + * raise a WRONG_DOCUMENT_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + */ +public class namednodemapsetnameditemns04 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + DOMImplementation domImpl; + Document docAlt; + DocumentType docType = null; + + NamedNodeMap attributes; + NodeList elementList; + Element element; + Attr attrAlt; + Node newNode; + // String nullNS = null; + String nullNS = ""; + + + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("*", "address"); + element = (Element) elementList.item(1); + attributes = element.getAttributes(); + domImpl = doc.getImplementation(); + docAlt = domImpl.createDocument(nullNS, "newDoc", docType); + attrAlt = docAlt.createAttributeNS(nullNS, "street"); + + { + boolean success = false; + try { + newNode = attributes.setNamedItemNS(attrAlt); + } catch (DOMException ex) { + assertEquals(ex.code, DOMException.WRONG_DOCUMENT_ERR); + } + + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns04"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,94 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Ignore; +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * Retreive an entity and notation node and add the first notation to the + * notation node map and first entity node to the entity map. Since both these + * maps are for readonly node, a NO_MODIFICATION_ALLOWED_ERR should be raised. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=407">http://www.w3.org/Bugs/Public/show_bug.cgi?id=407</a> + * @see <a href="http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html">http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html</a> + */ +public class namednodemapsetnameditemns05 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + DocumentType docType; + NamedNodeMap entities; + NamedNodeMap notations; + Entity entity; + Notation notation; + Node newNode; + String nullNS = null; + + doc = load("staffNS", true); + docType = doc.getDoctype(); + entities = docType.getEntities(); + notations = docType.getNotations(); + entity = (Entity) entities.getNamedItem("ent1"); + notation = (Notation) notations.getNamedItem("notation1"); + + { + boolean success = false; + try { + newNode = entities.setNamedItemNS(entity); + } catch (DOMException ex) { + success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue("namednodemapsetnameditemns05_entities", success); + } + + { + boolean success = false; + try { + newNode = notations.setNamedItemNS(notation); + } catch (DOMException ex) { + success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue("namednodemapsetnameditemns05_notations", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns05"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,79 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * Retreieve the first element whose localName is address and its attributes into a named node map. + * Retreiving the domestic attribute from the namednodemap. + * Retreieve the second element whose localName is address and its attributes into a named node map. + * Invoke setNamedItemNS on the second NamedNodeMap specifying the first domestic attribute from + * the first map. This should raise an INUSE_ATTRIBIUTE_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + */ +public class namednodemapsetnameditemns06 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + NodeList elementList; + Element element; + Attr attr; + Node newNode; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("*", "address"); + element = (Element) elementList.item(0); + attributes = element.getAttributes(); + attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); + element = (Element) elementList.item(1); + attributes = element.getAttributes(); + + { + boolean success = false; + try { + newNode = attributes.setNamedItemNS(attr); + } catch (DOMException ex) { + success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); + } + assertTrue("namednodemapsetnameditemns06", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns06"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,84 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The method setNamedItemNS adds a node using its namespaceURI and localName and + * raises a INUSE_ATTRIBUTE_ERR Raised if arg is an Attr that is already an + * attribute of another Element object. + * Retreieve the attributes of first element whose localName is address into a named node map. + * Retreive the attribute whose namespaceURI=http://www.usa.com and localName=domestic + * from the NamedNodeMap. Retreieve the attributes of second element whose localName is address + * into a named node map. Call the setNamedItemNS method on the second nodemap with the domestic + * attribute that was retreived and removed from the first nodeMap as an argument. + * Assuming that when an attribute is removed from a nodemap, it still remains in the domtree + * his should raise an INUSE_ATTRIBIUTE_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + */ +public class namednodemapsetnameditemns07 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + NodeList elementList; + Element element; + Attr attr; + Node newNode; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("*", "address"); + element = (Element) elementList.item(0); + attributes = element.getAttributes(); + attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); + element = (Element) elementList.item(1); + attributes = element.getAttributes(); + + { + boolean success = false; + try { + newNode = attributes.setNamedItemNS(attr); + } catch (DOMException ex) { + success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); + } + assertTrue("namednodemapsetnameditemns07", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns07"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,81 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * raises a INUSE_ATTRIBUTE_ERR Raised if arg is an Attr that is already an + * attribute of another Element object. + * Retreieve the first element whose localName is address and its attributes into a named node map. + * Retreiving the domestic attribute from the namednodemap. Retreieve the second element whose + * localName is address and its attributes into a named node map. Invoke setNamedItemNS on the + * second NamedNodeMap specifying the attribute from the first map. + * This should raise an INUSE_ATTRIBIUTE_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + */ +public class namednodemapsetnameditemns08 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NamedNodeMap attributes; + NodeList elementList; + Element element; + Attr attr; + Node newNode; + doc = load("staffNS", true); + elementList = doc.getElementsByTagNameNS("*", "address"); + element = (Element) elementList.item(0); + attributes = element.getAttributes(); + attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); + element = (Element) elementList.item(1); + attributes = element.getAttributes(); + + { + boolean success = false; + try { + newNode = attributes.setNamedItemNS(attr); + } catch (DOMException ex) { + success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); + } + assertTrue("namednodemapsetnameditemns08", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns08"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns09.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns09.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns09.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns09.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,88 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Ignore; +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The method setNamedItemNS adds a node using its namespaceURI and localName and + * raises a NO_MODIFICATION_ALLOWED_ERR if this map is readonly. + * Create a new attribute node and attempt to add it to the nodemap of entities and notations + * for this documenttype. This should reaise a NO_MODIFICATION_ALLOWED_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + */ +public class namednodemapsetnameditemns09 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + DocumentType docType; + NamedNodeMap entities; + NamedNodeMap notations; + Attr attr; + Node newNode; + doc = load("staffNS", true); + docType = doc.getDoctype(); + entities = docType.getEntities(); + notations = docType.getNotations(); + attr = doc.createAttributeNS("http://www.w3.org/DOM/Test", "test"); + + { + boolean success = false; + try { + newNode = entities.setNamedItemNS(attr); + } catch (DOMException ex) { + success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue("namednodemapsetnameditemns09_entities", success); + } + + { + boolean success = false; + try { + newNode = notations.setNamedItemNS(attr); + } catch (DOMException ex) { + success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue("namednodemapsetnameditemns09_notations", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns09"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns10.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns10.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns10.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns10.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,88 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Ignore; +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The method setNamedItemNS adds a node using its namespaceURI and localName and + * raises a HIERARCHY_REQUEST_ERR if an attempt is made to add a node doesn't belong + * in this NamedNodeMap. + * Attempt to add an entity to a NamedNodeMap of attribute nodes, + * Since nodes of this type cannot be added to the attribute node map a HIERARCHY_REQUEST_ERR + * should be raised. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + */ +public class namednodemapsetnameditemns10 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + DocumentType docType; + NamedNodeMap entities; + NamedNodeMap attributes; + Entity entity; + Notation notation; + Element element; + NodeList elementList; + Node newNode; + doc = load("staffNS", true); + + docType = doc.getDoctype(); + entities = docType.getEntities(); + entity = (Entity) entities.getNamedItem("ent1"); + + elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + element = (Element) elementList.item(0); + attributes = element.getAttributes(); + + { + boolean success = false; + try { + newNode = attributes.setNamedItemNS(entity); + } catch (DOMException ex) { + success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR); + } + assertTrue("namednodemapsetnameditemns10_entity", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns10"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns11.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns11.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns11.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns11.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,87 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Ignore; +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The method setNamedItemNS adds a node using its namespaceURI and localName and + * raises a HIERARCHY_REQUEST_ERR if an attempt is made to add a node doesn't belong + * in this NamedNodeMap. + * Attempt to add a notation node to a NamedNodeMap of attribute nodes, + * Since notations nodes do not belong in the attribute node map a HIERARCHY_REQUEST_ERR + * should be raised. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + */ +public class namednodemapsetnameditemns11 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + DocumentType docType; + NamedNodeMap notations; + NamedNodeMap attributes; + Notation notation; + Element element; + NodeList elementList; + Node newNode; + String nullNS = null; + + doc = load("staffNS", true); + docType = doc.getDoctype(); + notations = docType.getNotations(); + notation = (Notation) notations.getNamedItem("notation1"); + elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + element = (Element) elementList.item(0); + attributes = element.getAttributes(); + + { + boolean success = false; + try { + newNode = attributes.setNamedItemNS(notation); + } catch (DOMException ex) { + success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR); + } + assertTrue("namednodemapsetnameditemns11_notation", success); + } + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapsetnameditemns11"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI01.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI01.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI01.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI01.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,75 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertNull; + + +/** + * The "getNamespaceURI()" method for an Attribute + * returns the namespace URI of this node, or null if unspecified. + * Retrieve the first "emp:address" node which has an attribute of "emp:district" + * that is specified in the DTD. + * Invoke the "getNamespaceURI()" method on the attribute. + * The method should return "http://www.nist.gov". + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a> + */ +public class namespaceURI01 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList elementList; + Element testAddr; + Attr addrAttr; + String attrNamespaceURI; + doc = load("staffNS", false); + elementList = doc.getElementsByTagName("emp:address"); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributeNodeNS("http://www.nist.gov", "district"); + assertNull("Default Attrs not supported", addrAttr); +/* +TODO: + attrNamespaceURI = addrAttr.getNamespaceURI(); + assertEquals("namespaceURI", "http://www.nist.gov", attrNamespaceURI); + */ + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namespaceURI01"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI02.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI02.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI02.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI02.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,71 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "getNamespaceURI()" method for an Attribute + * returns the namespace URI of this node, or null if unspecified. + * <p> + * Retrieve the first emp:address node and get the emp:domestic attribute. + * Invoke the "getNamespaceURI()" method on the attribute. + * The method should return "http://www.nist.gov". + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a> + */ +public class namespaceURI02 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList elementList; + Element testAddr; + Attr addrAttr; + String attrNamespaceURI; + doc = load("staffNS", false); + elementList = doc.getElementsByTagName("emp:address"); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributeNodeNS("http://www.nist.gov", "domestic"); + attrNamespaceURI = addrAttr.getNamespaceURI(); + assertEquals("namespaceURI", "http://www.nist.gov", attrNamespaceURI); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namespaceURI02"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI03.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI03.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI03.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI03.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,67 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "getNamespaceURI()" method for a Node + * returns the namespace URI of this node, or null if unspecified. + * <p> + * Retrieve the first employee node and invoke the "getNamespaceURI()" + * method. The method should return "http://www.nist.gov". + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a> + */ +public class namespaceURI03 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList elementList; + Node testEmployee; + String employeeNamespace; + doc = load("staffNS", false); + elementList = doc.getElementsByTagName("employee"); + testEmployee = elementList.item(0); + employeeNamespace = testEmployee.getNamespaceURI(); + assertEquals("namespaceURI", "http://www.nist.gov", employeeNamespace); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namespaceURI03"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI04.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI04.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI04.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/namespaceURI04.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,68 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "getNamespaceURI()" method for a Node + * returns the namespace URI of this node, or null if unspecified. + * <p> + * Retrieve the second employee node and invoke the "getNamespaceURI()" + * method. The method should return "null". + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a> + */ +public class namespaceURI04 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList elementList; + Node testEmployee; + String employeeNamespace; + String sExpected = "";//TODO null; + doc = load("staffNS", false); + elementList = doc.getElementsByTagName("employee"); + testEmployee = elementList.item(1); + employeeNamespace = testEmployee.getNamespaceURI(); + assertEquals("throw_Null", sExpected, employeeNamespace); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namespaceURI04"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/nodegetlocalname03.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/nodegetlocalname03.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/nodegetlocalname03.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/nodegetlocalname03.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,79 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The method getLocalName returns the local part of the qualified name of this node. + * Ceate two new element nodes and atribute nodes, with and without namespace prefixes. + * Retreive the local part of their qualified names using getLocalName and verrify + * if it is correct. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a> + */ +public class nodegetlocalname03 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Element element; + Element qelement; + Attr attr; + Attr qattr; + String localElemName; + String localQElemName; + String localAttrName; + String localQAttrName; + doc = load("staff", false); + element = doc.createElementNS("http://www.w3.org/DOM/Test/elem", "elem"); + qelement = doc.createElementNS("http://www.w3.org/DOM/Test/elem", "qual:qelem"); + attr = doc.createAttributeNS("http://www.w3.org/DOM/Test/attr", "attr"); + qattr = doc.createAttributeNS("http://www.w3.org/DOM/Test/attr", "qual:qattr"); + localElemName = element.getLocalName(); + localQElemName = qelement.getLocalName(); + localAttrName = attr.getLocalName(); + localQAttrName = qattr.getLocalName(); + assertEquals("nodegetlocalname03_localElemName", "elem", localElemName); + assertEquals("nodegetlocalname03_localQElemName", "qelem", localQElemName); + assertEquals("nodegetlocalname03_localAttrName", "attr", localAttrName); + assertEquals("nodegetlocalname03_localQAttrName", "qattr", localQAttrName); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodegetlocalname03"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/nodegetnamespaceuri03.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/nodegetnamespaceuri03.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/nodegetnamespaceuri03.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/nodegetnamespaceuri03.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,83 @@ +/* +This Java source file was generated by test-to-java.xsl +and is a derived work from the source document. +The source document contained the following notice: + + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + + +*/ + +package org.w3c.domts.level2.core; + + +import org.junit.Test; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The method getNamespaceURI returns the namespace URI of this node, or null if it is unspecified + * For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with + * a DOM Level 1 method, such as createElement from the Document interface, this is always null. + * Ceate two new element nodes and atribute nodes, with and without namespace prefixes. + * Retreive their namespaceURI's using getNamespaceURI and verrify if it is correct. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + */ +public class nodegetnamespaceuri03 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Element element; + Element elementNS; + Attr attr; + Attr attrNS; + String elemNSURI; + String elemNSURINull; + String attrNSURI; + String attrNSURINull; + String nullNS = null; + + doc = load("staff", false); + element = doc.createElementNS(nullNS, "elem"); + elementNS = doc.createElementNS("http://www.w3.org/DOM/Test/elem", "qual:qelem"); + attr = doc.createAttributeNS(nullNS, "attr"); + attrNS = doc.createAttributeNS("http://www.w3.org/DOM/Test/attr", "qual:qattr"); + elemNSURI = elementNS.getNamespaceURI(); + elemNSURINull = element.getNamespaceURI(); + attrNSURI = attrNS.getNamespaceURI(); + attrNSURINull = attr.getNamespaceURI(); + assertEquals("nodegetnamespaceuri03_elemNSURI", "http://www.w3.org/DOM/Test/elem", elemNSURI); + assertEquals("nodegetnamespaceuri03_1", "", elemNSURINull); + assertEquals("nodegetnamespaceuri03_attrNSURI", "http://www.w3.org/DOM/Test/attr", attrNSURI); + assertEquals("nodegetnamespaceuri03_2", "", attrNSURINull); + + } + + /** + * Gets URI that identifies the test + * + * @return uri identifier of test + */ + public String getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodegetnamespaceuri03"; + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
