Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hasAttributes02.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.assertTrue; + + +/** + * The "hasAttributes()" method for a node should + * return true if the node has attributes. + * <p> + * Retrieve the first address node and the "hasAttributes()" method + * should return true since the node has "domestic" as an attribute. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a> + */ +public class hasAttributes02 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList addrList; + Node addrNode; + boolean state; + doc = load("staff", false); + addrList = doc.getElementsByTagName("address"); + addrNode = addrList.item(0); + state = addrNode.hasAttributes(); + assertTrue("throw_True", state); + + } + + /** + * 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/hasAttributes02"; + } + +}
Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_attrcreatedocumentfragment.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_attrcreatedocumentfragment.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_attrcreatedocumentfragment.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_attrcreatedocumentfragment.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,82 @@ +/* +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; + + +/** + * Attr nodes may be associated with Element nodes contained within a DocumentFragment. + * Create a new DocumentFragment and add a newly created Element node(with one attribute). + * Once the element is added, its attribute should be available as an attribute associated + * with an Element within a DocumentFragment. + * * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5</a> + * + * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082</a> + * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a> + * @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=184">http://www.w3.org/Bugs/Public/show_bug.cgi?id=184</a> + */ +public class hc_attrcreatedocumentfragment extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + DocumentFragment docFragment; + Element newOne; + Node domesticNode; + NamedNodeMap attributes; + Attr attribute; + String attrName; + Node appendedChild; + int langAttrCount = 0; + doc = load("hc_staff", true); + docFragment = doc.createDocumentFragment(); + newOne = doc.createElement("html"); + newOne.setAttribute("lang", "EN"); + appendedChild = docFragment.appendChild(newOne); + domesticNode = docFragment.getFirstChild(); + attributes = domesticNode.getAttributes(); + for (int indexd428e69 = 0; indexd428e69 < attributes.getLength(); indexd428e69++) { + attribute = (Attr) attributes.item(indexd428e69); + attrName = attribute.getNodeName(); + + if (equals("lang", attrName)) { + langAttrCount += 1; + } + } + assertEquals("hasLangAttr", 1, langAttrCount); + + } + + /** + * 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/hc_attrcreatedocumentfragment"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_attrname.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_attrname.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_attrname.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_attrname.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-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 getNodeName() method of an Attribute node. + * Retrieve the attribute named street from the last + * child of of the second employee and examine its + * NodeName. This test uses the getNamedItem(name) method from the NamedNodeMap + * interface. + * Unlike the DOM 1 Core equivalent, this test can expect the + * attribute name to be upper case for HTML documents. + * * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095</a> + * + * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a> + * @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a> + */ +public class hc_attrname extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String strong1; + String strong2; + doc = load("hc_staff", false); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(1); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem("class"); + strong1 = streetAttr.getNodeName(); + strong2 = streetAttr.getName(); + assertEquals("nodeName", "class", strong1); + assertEquals("name", "class", strong2); + + } + + /** + * 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/hc_attrname"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_documentcreateattribute.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_documentcreateattribute.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_documentcreateattribute.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_documentcreateattribute.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,73 @@ +/* +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.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "createAttribute(name)" method creates an Attribute + * node of the given name. + * Retrieve the entire DOM document and invoke its + * "createAttribute(name)" method. It should create a + * new Attribute node with the given name. The name, value + * and type of the newly created object are retrieved and + * output. + * Unlike the DOM 1 Core equivalent, this test can expect the + * attribute name to be upper case for HTML documents. + * * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198</a> + * + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a> + * @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a> + */ +public class hc_documentcreateattribute extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Attr newAttrNode; + String attrValue; + String attrName; + int attrType; + doc = load("hc_staff", true); + newAttrNode = doc.createAttribute("style"); + attrValue = newAttrNode.getNodeValue(); + assertEquals("value", "", attrValue); + attrName = newAttrNode.getNodeName(); + assertEquals("name", "style", attrName); + attrType = newAttrNode.getNodeType(); + assertEquals("type", 2, attrType); + + } + + /** + * 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/hc_documentcreateattribute"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_elementgetattributenode.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_elementgetattributenode.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_elementgetattributenode.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_elementgetattributenode.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-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.assertEquals; + + +/** + * The "getAttributeNode(name)" method retrieves an + * attribute node by name. + * Retrieve the attribute "domestic" from the last child + * of the first employee. Since the method returns an + * Attr object, the "strong" can be examined to ensure the + * proper attribute was retrieved. + * Unlike the DOM 1 Core equivalent, this test can expect the + * attribute name to be upper case for HTML documents. + * * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8</a> + * + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a> + * @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a> + */ +public class hc_elementgetattributenode extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList elementList; + Element testEmployee; + Attr domesticAttr; + String strong; + doc = load("hc_staff", true); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = (Element) elementList.item(0); + domesticAttr = testEmployee.getAttributeNode("title"); + strong = domesticAttr.getNodeName(); + assertEquals("nodeName", "title", strong); + + } + + /** + * 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/hc_elementgetattributenode"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.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) 2004 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; + + +/** + * An attempt to add remove an entity using removeNamedItemNS should result in + * a NO_MODIFICATION_ERR or a NOT_FOUND_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1788794630">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1788794630</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a> + */ +public class hc_entitiesremovenameditemns1 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + NamedNodeMap entities; + DocumentType docType; + Node retval; + doc = load("hc_staff", true); + docType = doc.getDoctype(); + entities = docType.getEntities(); + + try { + retval = entities.removeNamedItemNS("http://www.w3.org/1999/xhtml", "alpha"); + fail("throw_NO_MOD_OR_NOT_FOUND_ERR"); + + } catch (DOMException ex) { + switch (ex.code) { + case 7: + break; + case 8: + 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/hc_entitiesremovenameditemns1"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,77 @@ +/* +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) 2004 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; + + +/** + * An attempt to add an element to the named node map returned by entities should + * result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1788794630">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1788794630</a> + * @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 hc_entitiessetnameditemns1 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + NamedNodeMap entities; + DocumentType docType; + Node retval; + Element elem; + doc = load("hc_staff", true); + docType = doc.getDoctype(); + entities = docType.getEntities(); + elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "br"); + + try { + retval = entities.setNamedItemNS(elem); + fail("throw_HIER_OR_NO_MOD_ERR"); + + } catch (DOMException ex) { + switch (ex.code) { + case 3: + 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/hc_entitiessetnameditemns1"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_namednodemapgetnameditem.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_namednodemapgetnameditem.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_namednodemapgetnameditem.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_namednodemapgetnameditem.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,73 @@ +/* +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 "getNamedItem(name)" method retrieves a node + * specified by name. + * Retrieve the second employee and create a NamedNodeMap + * listing of the attributes of the last child. Once the + * list is created an invocation of the "getNamedItem(name)" + * method is done with name="domestic". This should result + * in the domestic Attr node being returned. + * Unlike the DOM 1 Core equivalent, this test can expect the + * attribute name to be upper case for HTML documents. + * * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549</a> + * + * @see <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9</a> + * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236">http://www.w3.org/Bugs/Public/show_bug.cgi?id=236</a> + * @see <a href="http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html">http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html</a> + */ +public class hc_namednodemapgetnameditem extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Attr domesticAttr; + String attrName; + doc = load("hc_staff", false); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem("title"); + attrName = domesticAttr.getNodeName(); + assertEquals("nodeName", "title", 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/hc_namednodemapgetnameditem"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,76 @@ +/* +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) 2004 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.DocumentFragment; +import org.w3c.dom.Node; +import org.w3c.dom.Text; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + + +/** + * Create a document fragment with two adjacent text nodes, normalize and see if the text nodes + * were combined. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3</a> + */ + +/** + * TODO: add this back + */ +public class hc_nodedocumentfragmentnormalize1 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + DocumentFragment docFragment; + String nodeValue; + Text txtNode; + Node retval; + doc = load("hc_staff", true); + docFragment = doc.createDocumentFragment(); + txtNode = doc.createTextNode("foo"); + retval = docFragment.appendChild(txtNode); + txtNode = doc.createTextNode("bar"); + retval = docFragment.appendChild(txtNode); + docFragment.normalize(); + txtNode = (Text) docFragment.getFirstChild(); + nodeValue = txtNode.getNodeValue(); + assertEquals("normalizedNodeValue", "foobar", nodeValue); + retval = txtNode.getNextSibling(); + assertNull("singleChild", retval); + + } + + /** + * 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/hc_nodedocumentfragmentnormalize1"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.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) 2004 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.DocumentFragment; +import org.w3c.dom.Node; +import org.w3c.dom.Text; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertNull; + + +/** + * Create a document fragment with an empty text node, after normalization there should be no child nodes. + * were combined. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3</a> + */ + +/** + * TODO: add this back + * + * @ignore true + */ +public class hc_nodedocumentfragmentnormalize2 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + DocumentFragment docFragment; + String nodeValue; + Text txtNode; + Node retval; + doc = load("hc_staff", true); + docFragment = doc.createDocumentFragment(); + txtNode = doc.createTextNode(""); + retval = docFragment.appendChild(txtNode); + docFragment.normalize(); + txtNode = (Text) docFragment.getFirstChild(); + assertNull("There should be no child nodes after normalization", txtNode); + + } + + /** + * 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/hc_nodedocumentfragmentnormalize2"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.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) 2004 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; + + +/** + * An attempt to add remove an notation using removeNamedItemNS should result in + * a NO_MODIFICATION_ERR or a NOT_FOUND_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D46829EF">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D46829EF</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a> + */ +public class hc_notationsremovenameditemns1 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + NamedNodeMap notations; + DocumentType docType; + Node retval; + doc = load("hc_staff", true); + docType = doc.getDoctype(); + notations = docType.getNotations(); + + try { + retval = notations.removeNamedItemNS("http://www.w3.org/1999/xhtml", "alpha"); + fail("throw_NO_MOD_OR_NOT_FOUND_ERR"); + + } catch (DOMException ex) { + switch (ex.code) { + case 7: + break; + case 8: + 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/hc_notationsremovenameditemns1"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,77 @@ +/* +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) 2004 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; + + +/** + * An attempt to add an element to the named node map returned by notations should + * result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D46829EF">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D46829EF</a> + * @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 hc_notationssetnameditemns1 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + NamedNodeMap notations; + DocumentType docType; + Node retval; + Element elem; + doc = load("hc_staff", true); + docType = doc.getDoctype(); + notations = docType.getNotations(); + elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "br"); + + try { + retval = notations.setNamedItemNS(elem); + fail("throw_HIER_OR_NO_MOD_ERR"); + + } catch (DOMException ex) { + switch (ex.code) { + case 3: + 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/hc_notationssetnameditemns1"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode01.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode01.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode01.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode01.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,107 @@ +/* +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.*; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Attr. + * The ownerElement is set to null. Specified flag is set to true. + * Children is imported. + * Create a new attribute whose name is "elem:attr1" in a different document. + * Create a child Text node with value "importedText" for the attribute node above. + * Invoke method importNode(importedNode,deep) on this document with + * importedNode being the newly created attribute. + * Method should return a node whose name matches "elem:attr1" and a child node + * whose value equals "importedText". + * The returned node should belong to this document whose systemId is "staff.dtd" + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode01 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + Attr newAttr; + Text importedChild; + Node aNode; + Document ownerDocument; + Element attrOwnerElement; + DocumentType docType; + String system; + boolean specified; + NodeList childList; + String nodeName; + Node child; + String childValue; + java.util.List result = new java.util.ArrayList(); + + java.util.List expectedResult = new java.util.ArrayList(); + expectedResult.add("elem:attr1"); + expectedResult.add("importedText"); + + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + newAttr = aNewDoc.createAttribute("elem:attr1"); + importedChild = aNewDoc.createTextNode("importedText"); + aNode = newAttr.appendChild(importedChild); + aNode = doc.importNode(newAttr, false); + ownerDocument = aNode.getOwnerDocument(); + docType = ownerDocument.getDoctype(); + system = docType.getSystemId(); + assertNotNull("aNode", aNode); + assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + attrOwnerElement = ((Attr) /*Node */aNode).getOwnerElement(); + assertNull("ownerElement", attrOwnerElement); + specified = ((Attr) /*Node */aNode).getSpecified(); + assertTrue("specified", specified); + childList = aNode.getChildNodes(); + assertSize("childList", 1, childList); + nodeName = aNode.getNodeName(); + assertEquals("nodeName", "elem:attr1", nodeName); + child = aNode.getFirstChild(); + childValue = child.getNodeValue(); + assertEquals("childValue", "importedText", childValue); + + } + + /** + * 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/importNode01"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode02.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode02.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode02.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode02.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 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.CDATASection; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type CData_Section. + * Create a CDATASection node with value being the string "this is CDATASection data" in + * a different document. Invoke method importNode(importedNode,deep) on + * this document. Method should return a CDATASection node whose value matches + * the above string. The returned node should belong to this document whose systemId is "staff.dtd" + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode02 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + CDATASection cDataSec; + Node aNode; + Document ownerDocument; + DocumentType docType; + String system; + String value; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + cDataSec = aNewDoc.createCDATASection("this is CDATASection data"); + aNode = doc.importNode(cDataSec, false); + ownerDocument = aNode.getOwnerDocument(); + docType = ownerDocument.getDoctype(); + +/* TODO: + system = docType.getSystemId(); + assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + +*/ + value = aNode.getNodeValue(); + assertEquals("nodeValue", "this is CDATASection data", value); + + } + + /** + * 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/importNode02"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode03.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode03.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode03.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode03.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,80 @@ +/* +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.Comment; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Comment. + * Create a comment node with value being the string "this is a comment" in + * a different document. Invoke method importNode(importedNode,deep) on + * this document. Method should return a comment node whose value matches + * the above string. The returned node should belong to this document whose + * systemId is "staff.dtd" + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode03 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + Comment comment; + Node aNode; + Document ownerDocument; + DocumentType docType; + String system; + String value; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + comment = aNewDoc.createComment("this is a comment"); + aNode = doc.importNode(comment, false); + ownerDocument = aNode.getOwnerDocument(); + docType = null;//ownerDocument.getDoctype(); +// system = docType.getSystemId(); + // assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + value = aNode.getNodeValue(); + assertEquals("nodeValue", "this is a comment", value); + + } + + /** + * 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/importNode03"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode04.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode04.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode04.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode04.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.assertEquals; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Document_Fragment. + * Create a DocumentFragment in a different document. + * Create a Comment child node for the Document Fragment. + * Invoke method importNode(importedNode,deep) on this document + * with importedNode being the newly created DocumentFragment. + * Method should return a node of type DocumentFragment whose child has + * comment value "descendant1". + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode04 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + DocumentFragment docFrag; + Comment comment; + Node aNode; + NodeList children; + Node child; + String childValue; + doc = load("staff", true); + aNewDoc = load("staff", true); + docFrag = aNewDoc.createDocumentFragment(); + comment = aNewDoc.createComment("descendant1"); + aNode = docFrag.appendChild(comment); + aNode = doc.importNode(docFrag, true); + children = aNode.getChildNodes(); + assertSize("throw_Size", 1, children); + child = aNode.getFirstChild(); + childValue = child.getNodeValue(); + assertEquals("descendant1", "descendant1", childValue); + + } + + /** + * 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/importNode04"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode05.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode05.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode05.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode05.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 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.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Element. + * Retrieve element "emp:address" from staffNS.xml document. + * Invoke method importNode(importedNode,deep) on this document + * with importedNode being the element from above and deep is false. + * Method should return an element node whose name matches "emp:address" + * and whose children are not imported. The returned node should + * belong to this document whose systemId is "staff.dtd" + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode05 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + Element element; + Node aNode; + boolean hasChild; + Document ownerDocument; + DocumentType docType; + String system; + String name; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + element = aNewDoc.getElementById("CANADA"); + aNode = doc.importNode(element, false); + hasChild = aNode.hasChildNodes(); + assertFalse("hasChild", hasChild); + ownerDocument = aNode.getOwnerDocument(); + docType = ownerDocument.getDoctype(); + system = docType.getSystemId(); + assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + name = aNode.getNodeName(); + assertEquals("nodeName", "emp:address", name); + + } + + /** + * 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/importNode05"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode06.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode06.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode06.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode06.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.Ignore; +import org.junit.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Element. + * Retrieve element "emp:address" from staffNS.xml document. + * Invoke method importNode(importedNode,deep) on this document + * with importedNode being the element from above and deep is true. + * Method should return an element node whose name matches "emp:address" and + * whose descendant is imported. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ + +public class importNode06 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + Element element; + Node aNode; + boolean hasChild; + String name; + Node child; + String value; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + element = aNewDoc.getElementById("CANADA"); + aNode = doc.importNode(element, true); + hasChild = aNode.hasChildNodes(); + assertTrue("throw_True", hasChild); + name = aNode.getNodeName(); + assertEquals("nodeName", "emp:address", name); + child = aNode.getFirstChild(); + value = child.getNodeValue(); + assertEquals("nodeValue", "27 South Road. Dallas, texas 98556", value); + + } + + /** + * 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/importNode06"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode07.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode07.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode07.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode07.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.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Element. + * If this document defines default attributes for this element name (importedNode), + * those default attributes are assigned. + * Create an element whose name is "emp:employee" in a different document. + * Invoke method importNode(importedNode,deep) on this document which + * defines default attribute for the element name "emp:employee". + * Method should return an the imported element with an assigned default attribute. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</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 importNode07 extends DOMTestCase { + @Test + @Ignore("default attribute not supported") + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + Element element; + Node aNode; + NamedNodeMap attributes; + String name; + Node attr; + String lname; + String namespaceURI = "http://www.nist.gov"; + String qualifiedName = "emp:employee"; + doc = load("staffNS", true); + aNewDoc = load("staff", true); + element = aNewDoc.createElementNS(namespaceURI, qualifiedName); + aNode = doc.importNode(element, false); + attributes = aNode.getAttributes(); + assertSize("throw_Size", 1, attributes); + name = aNode.getNodeName(); + assertEquals("nodeName", "emp:employee", name); + attr = attributes.item(0); + lname = attr.getLocalName(); + assertEquals("lname", "defaultAttr", lname); + + } + + /** + * 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/importNode07"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode08.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode08.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode08.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode08.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,82 @@ +/* +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.DocumentFragment; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertFalse; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Document_Fragment. + * Create a DocumentFragment in a different document. + * Invoke method importNode(importedNode,deep) on this document + * with importedNode being the newly created DocumentFragment. + * Method should return an empty DocumentFragment that belongs + * to this document whose systemId is "staff.dtd" + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId</a> + */ +public class importNode08 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + DocumentFragment docFrag; + Node aNode; + boolean hasChild; + Document ownerDocument; + DocumentType docType; + String system; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + docFrag = aNewDoc.createDocumentFragment(); + aNode = doc.importNode(docFrag, false); + hasChild = aNode.hasChildNodes(); + assertFalse("hasChild", hasChild); + ownerDocument = aNode.getOwnerDocument(); + //TODO: docType + // docType = ownerDocument.getDoctype(); + // system = docType.getSystemId(); + // assertURIEquals("system", null, null, null, "staffNS.dtd", null, null, null, null, system); + + } + + /** + * 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/importNode08"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode09.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode09.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode09.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode09.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 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.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Entity; +import org.w3c.dom.NamedNodeMap; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Entity. + * Retrieve entity "ent6" from staffNS.xml document. + * Invoke method importNode(importedNode,deep) on this document. + * Method should return a node of type Entity whose publicId, systemId and + * notationName attributes are copied. + * The returned node should belong to this document whose systemId is "staff.dtd" + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode09 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + DocumentType doc1Type; + NamedNodeMap entityList; + Entity entity2; + Entity entity1; + Document ownerDocument; + DocumentType docType; + String system; + String entityName; + String publicVal; + String notationName; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + docType = aNewDoc.getDoctype(); + entityList = docType.getEntities(); + entity2 = (Entity) entityList.getNamedItem("ent6"); + entity1 = (Entity) doc.importNode(entity2, false); + ownerDocument = entity1.getOwnerDocument(); + docType = ownerDocument.getDoctype(); + system = docType.getSystemId(); + assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + entityName = entity1.getNodeName(); + assertEquals("entityName", "ent6", entityName); + publicVal = entity1.getPublicId(); + assertEquals("entityPublicId", "uri", publicVal); + system = entity1.getSystemId(); + assertURIEquals("entitySystemId", null, null, null, "file", null, null, null, null, system); + notationName = entity1.getNotationName(); + assertEquals("notationName", "notation2", notationName); + + } + + /** + * 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/importNode09"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode10.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode10.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode10.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode10.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,85 @@ +/* +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.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.EntityReference; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Entity_Reference. + * Only the EntityReference is copied, regardless of deep's value. + * Create an entity reference whose name is "entRef1" in a different document. + * Give it value "entRef1Value". + * Invoke method importNode(importedNode,deep) on this document with importedNode + * being "entRef1". + * Method should return a node of type Entity_Reference (whose value is null) that + * belongs to this document whose systemId is "staff.dtd". + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode10 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + EntityReference entRef; + Node aNode; + Document ownerDocument; + DocumentType docType; + String system; + String name; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + entRef = aNewDoc.createEntityReference("entRef1"); + entRef.setNodeValue("entRef1Value"); + aNode = doc.importNode(entRef, false); + ownerDocument = aNode.getOwnerDocument(); + docType = ownerDocument.getDoctype(); + system = docType.getSystemId(); + assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + name = aNode.getNodeName(); + assertEquals("nodeName", "entRef1", name); + + } + + /** + * 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/importNode10"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode11.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode11.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode11.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode11.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 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.Document; +import org.w3c.dom.EntityReference; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Entity_Reference. + * Only the EntityReference is copied, regardless of deep's value. + * If the Document provides a definition for the entity name, its value is assigned. + * Create an entity reference whose name is "ent3" in a different document. + * Invoke method importNode(importedNode,deep) on this document with importedNode + * being "ent3". + * Method should return a node of type Entity_Reference whose first child's value is "Texas" as defined + * in this document. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode11 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + EntityReference entRef; + Node aNode; + String name; + Node child; + String childValue; + doc = load("staff", true); + aNewDoc = load("staff", true); + entRef = aNewDoc.createEntityReference("ent3"); + aNode = doc.importNode(entRef, true); + name = aNode.getNodeName(); + assertEquals("entityName", "ent3", name); + child = aNode.getFirstChild(); + assertNotNull("child", child); + childValue = child.getNodeValue(); + assertEquals("childValue", "Texas", childValue); + + } + + /** + * 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/importNode11"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode12.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode12.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode12.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode12.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 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 "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Entity. + * Retrieve entity "ent4" from staffNS.xml document. + * Invoke method importNode(importedNode,deep) on this document with deep as false. + * Method should return a node of type Entity whose descendant is copied. + * The returned node should belong to this document whose systemId is "staffNS.dtd" + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode12 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + DocumentType doc1Type; + NamedNodeMap entityList; + Entity entity2; + Entity entity1; + Document ownerDocument; + DocumentType docType; + String system; + String entityName; + Node child; + String childName; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + + doc1Type = aNewDoc.getDoctype(); + entityList = doc1Type.getEntities(); + entity2 = (Entity) entityList.getNamedItem("ent4"); + entity1 = (Entity) doc.importNode(entity2, true); + ownerDocument = entity1.getOwnerDocument(); + docType = ownerDocument.getDoctype(); + system = docType.getSystemId(); + assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + entityName = entity1.getNodeName(); + assertEquals("entityName", "ent4", entityName); + child = entity1.getFirstChild(); + assertNotNull("notnull", child); + childName = child.getNodeName(); + assertEquals("childName", "entElement1", childName); + + } + + /** + * 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/importNode12"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode13.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode13.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode13.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/importNode13.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,89 @@ +/* +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.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Notation; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + + +/** + * The "importNode(importedNode,deep)" method for a + * Document should import the given importedNode into that Document. + * The importedNode is of type Notation. + * Retrieve notation named "notation1" from document staffNS.xml. + * Invoke method importNode(importedNode,deep) where importedNode + * contains the retrieved notation and deep is false. Method should + * return a node of type notation whose name is "notation1". + * The returned node should belong to this document whose systemId is "staff.dtd" + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> + */ +public class importNode13 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document aNewDoc; + DocumentType doc1Type; + NamedNodeMap notationList; + Notation notation; + Notation aNode; + Document ownerDocument; + DocumentType docType; + String system; + String publicVal; + doc = load("staffNS", true); + aNewDoc = load("staffNS", true); + doc1Type = aNewDoc.getDoctype(); + notationList = doc1Type.getNotations(); + notation = (Notation) notationList.getNamedItem("notation1"); + aNode = (Notation) doc.importNode(notation, false); + ownerDocument = aNode.getOwnerDocument(); + docType = ownerDocument.getDoctype(); + system = docType.getSystemId(); + assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + publicVal = aNode.getPublicId(); + assertEquals("publicId", "notation1File", publicVal); + system = aNode.getSystemId(); + assertNull("notationSystemId", system); + + } + + /** + * 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/importNode13"; + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
