Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS01.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS01.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS01.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS01.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.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + + +/** + * The method getElementsByTagNameNS returns a NodeList of all the Elements with + * a given local name and namespace URI in the order in which they are encountered + * in a preorder traversal of the Document tree. + * Invoke the getElementsByTagNameNS method on a new Document object with the values of + * namespaceURI=* and localName=*. This should return a nodeList of 1 item. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</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 documentgetelementsbytagnameNS01 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document newDoc; + DocumentType docType = null; + + DOMImplementation domImpl; + NodeList childList; + String nullNS = null; + + doc = load("staffNS", false); + domImpl = doc.getImplementation(); + newDoc = domImpl.createDocument(nullNS, "root", docType); + childList = newDoc.getElementsByTagNameNS("*", "*"); + assertSize("documentgetelementsbytagnameNS01", 1, childList); + + } + + /** + * 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/documentgetelementsbytagnameNS01"; + } + +}
Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS02.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS02.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS02.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS02.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.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + + +/** + * The method getElementsByTagNameNS returns a NodeList of all the Elements with + * a given local name and namespace URI in the order in which they are encountered + * in a preorder traversal of the Document tree. + * Create a new element having a local name="employeeId" belonging to the namespace "test" + * and append it to this document. Invoke the getElementsByTagNameNS method on a this + * Document object with the values of namespaceURI=* and localName="elementId". This + * should return a nodeList of 6 item. Check the length of the nodeList returned. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a> + */ +public class documentgetelementsbytagnameNS02 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Element docElem; + Element element; + NodeList childList; + Node appendedChild; + doc = load("staffNS", true); + docElem = doc.getDocumentElement(); + element = doc.createElementNS("test", "employeeId"); + appendedChild = docElem.appendChild(element); + childList = doc.getElementsByTagNameNS("*", "employeeId"); + assertSize("documentgetelementsbytagnameNS02", 6, childList); + + } + + /** + * 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/documentgetelementsbytagnameNS02"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS03.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS03.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS03.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS03.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,61 @@ +/* +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.NodeList; +import org.w3c.domts.DOMTestCase; + + +/** + * The method getElementsByTagNameNS returns a NodeList of all the Elements with + * a given local name and namespace URI in the order in which they are encountered + * in a preorder traversal of the Document tree. + * Invoke the getElementsByTagNameNS method on a new Document object with the values of + * namespaceURI=** and localName=**. This should return a nodeList of 0 items. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a> + */ +public class documentgetelementsbytagnameNS03 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList childList; + doc = load("staffNS", false); + childList = doc.getElementsByTagNameNS("**", "*"); + assertSize("documentgetelementsbytagnameNS03", 0, childList); + + } + + /** + * 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/documentgetelementsbytagnameNS03"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS04.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS04.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS04.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS04.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,64 @@ +/* +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.Document; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + + +/** + * The method getElementsByTagNameNS returns a NodeList of all the Elements with + * a given local name and namespace URI in the order in which they are encountered + * in a preorder traversal of the Document tree. + * Invoke the getElementsByTagNameNS method on a new Document object with the values of + * namespaceURI="null" and localName="0". This should return a nodeList of 0 items. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</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 documentgetelementsbytagnameNS04 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList childList; + String nullNS = null; + + doc = load("staffNS", false); + childList = doc.getElementsByTagNameNS(nullNS, "0"); + assertSize("documentgetelementsbytagnameNS04", 0, childList); + + } + + /** + * 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/documentgetelementsbytagnameNS04"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS05.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS05.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS05.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentgetelementsbytagnameNS05.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,62 @@ +/* +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.NodeList; +import org.w3c.domts.DOMTestCase; + + +/** + * The method getElementsByTagNameNS returns a NodeList of all the Elements with + * a given local name and namespace URI in the order in which they are encountered + * in a preorder traversal of the Document tree. + * Invoke the getElementsByTagNameNS method on a this Document object with the + * values of namespaceURI=null and localName="elementId". This + * should return a nodeList of 0 item. Check the length of the nodeList returned. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a> + */ +public class documentgetelementsbytagnameNS05 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList childList; + doc = load("staffNS", false); + childList = doc.getElementsByTagNameNS("null", "elementId"); + assertSize("documentgetelementsbytagnameNS05", 0, childList); + + } + + /** + * 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/documentgetelementsbytagnameNS05"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode01.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode01.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode01.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode01.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.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=true, import the attribute, "street" of the second + * element node, from a list of nodes whose local names are "address" and namespaceURI + * "http://www.nist.gov" into the same document. Check the parentNode, nodeName, + * nodeType and nodeValue of the imported node to verify if it has been imported correctly. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode01 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Element element; + Attr attr; + NodeList childList; + Node importedAttr; + String nodeName; + int nodeType; + String nodeValue; + + String sExpected = "Y";//TODO: "Yes" if Entities + + doc = load("staffNS", true); + childList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + element = (Element) childList.item(1); + attr = element.getAttributeNode("street"); + importedAttr = doc.importNode(attr, false); + nodeName = importedAttr.getNodeName(); + nodeValue = importedAttr.getNodeValue(); + nodeType = importedAttr.getNodeType(); + assertEquals("documentimportnode01_nodeName", "street", nodeName); + assertEquals("documentimportnode01_nodeType", 2, nodeType); + assertEquals("documentimportnode01_nodeValue", sExpected, nodeValue); + + } + + /** + * 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/documentimportnode01"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode02.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode02.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode02.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode02.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.Attr; +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; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=false, import the attribute, "emp:zone" of the + * element node which is retreived by its elementId="CANADA", into the another document. + * Check the parentNode, nodeName, nodeType and nodeValue of the imported node to + * verify if it has been imported correctly. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode02 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document docImported; + Element element; + Attr attr; + Node importedAttr; + String nodeName; + int nodeType; + String nodeValue; + doc = load("staffNS", true); + docImported = load("staff", true); + element = doc.getElementById("CANADA"); + attr = element.getAttributeNodeNS("http://www.nist.gov", "zone"); + importedAttr = docImported.importNode(attr, false); + nodeName = importedAttr.getNodeName(); + nodeType = importedAttr.getNodeType(); + nodeValue = importedAttr.getNodeValue(); + assertEquals("documentimportnode02_nodeName", "emp:zone", nodeName); + assertEquals("documentimportnode02_nodeType", 2, nodeType); + assertEquals("documentimportnode02_nodeValue", "CANADA", nodeValue); + + } + + /** + * 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/documentimportnode02"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode03.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode03.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode03.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode03.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.Ignore; +import org.junit.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=false, import the default Attribute attribute, + * "defaultAttr" of the second element node whose namespaceURI="http://www.nist.gov" and + * localName="defaultAttr", into the same document. + * Check the parentNode, nodeName, nodeType and nodeValue of the imported node to + * verify if it has been imported correctly. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode03 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Element element; + Attr attr; + NodeList childList; + Node importedAttr; + String nodeName; + int nodeType; + String nodeValue; + doc = load("staffNS", true); + childList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); + element = (Element) childList.item(1); + attr = element.getAttributeNode("defaultAttr"); + importedAttr = doc.importNode(attr, false); + nodeName = importedAttr.getNodeName(); + nodeValue = importedAttr.getNodeValue(); + nodeType = importedAttr.getNodeType(); + assertEquals("documentimportnode03_nodeName", "defaultAttr", nodeName); + assertEquals("documentimportnode03_nodeType", 2, nodeType); + assertEquals("documentimportnode03_nodeValue", "defaultVal", nodeValue); + + } + + /** + * 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/documentimportnode03"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode04.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode04.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode04.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode04.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.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=true, import the default Attribute attribute, + * "defaultAttr" of the second element node whose namespaceURI="http://www.nist.gov" and + * localName="defaultAttr", into a new document. + * Check the parentNode, nodeName, nodeType and nodeValue of the imported node to + * verify if it has been imported correctly. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode04 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document newDoc; + DocumentType docType = null; + + DOMImplementation domImpl; + Element element; + Attr attr; + NodeList childList; + Node importedAttr; + String nodeName; + int nodeType; + String nodeValue; + doc = load("staffNS", true); + domImpl = doc.getImplementation(); + newDoc = domImpl.createDocument("http://www.w3.org/DOM/Test", "l2:root", docType); + childList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); + element = (Element) childList.item(1); + attr = element.getAttributeNode("defaultAttr"); + importedAttr = newDoc.importNode(attr, true); + nodeName = importedAttr.getNodeName(); + nodeValue = importedAttr.getNodeValue(); + nodeType = importedAttr.getNodeType(); + assertEquals("documentimportnode04_nodeName", "defaultAttr", nodeName); + assertEquals("documentimportnode04_nodeType", 2, nodeType); + assertEquals("documentimportnode04_nodeValue", "defaultVal", nodeValue); + + } + + /** + * 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/documentimportnode04"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode05.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode05.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode05.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode05.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.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=false, import a newly created attribute node, + * into the another document. + * Check the nodeName, nodeType and nodeValue namespaceURI of the imported node to + * verify if it has been imported correctly. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode05 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document docImported; + Attr attr; + Node importedAttr; + String nodeName; + int nodeType; + String nodeValue; + String namespaceURI; + doc = load("staffNS", true); + docImported = load("staff", true); + attr = doc.createAttributeNS("http://www.w3.org/DOM/Test", "a_:b0"); + importedAttr = docImported.importNode(attr, false); + nodeName = importedAttr.getNodeName(); + nodeValue = importedAttr.getNodeValue(); + nodeType = importedAttr.getNodeType(); + namespaceURI = importedAttr.getNamespaceURI(); + assertEquals("documentimportnode05_nodeName", "a_:b0", nodeName); + assertEquals("documentimportnode05_nodeType", 2, nodeType); + assertEquals("documentimportnode05_nodeValue", "", nodeValue); + assertEquals("documentimportnode05_namespaceURI", "http://www.w3.org/DOM/Test", namespaceURI); + + } + + /** + * 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/documentimportnode05"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode06.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode06.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode06.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode06.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.DOMException; +import org.w3c.dom.Document; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The importNode method imports a node from another document to this document. + * A NOT_SUPPORTED_ERR is raised if the type of node being imported is + * not supported + * Using the method importNode with deep=false, try to import this document object to itself. + * Since Document nodes cannot be imported, a NOT_SUPPORTED_ERR should be raised. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode06 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document docImported; + doc = load("staffNS", true); + + { + boolean success = false; + try { + docImported = (Document) doc.importNode(doc, false); + } catch (DOMException ex) { + success = (ex.code == DOMException.NOT_SUPPORTED_ERR); + } + assertTrue("documentimportnode06", 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/documentimportnode06"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode07.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode07.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode07.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode07.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.DOMException; +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.assertTrue; + + +/** + * The importNode method imports a node from another document to this document. + * A NOT_SUPPORTED_ERR is raised if the type of node being imported is + * not supported + * Using the method importNode with deep=true, try to import this Document's + * DocumentType object. Since DocumentType nodes cannot be imported, a + * NOT_SUPPORTED_ERR should be raised. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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> + */ + + +/** + * @ ignore true + */ +public class documentimportnode07 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Node imported; + DocumentType docType; + doc = load("staffNS", true); + docType = doc.getDoctype(); + + { + boolean success = false; + try { + imported = doc.importNode(docType, true); + } catch (DOMException ex) { + success = (ex.code == DOMException.NOT_SUPPORTED_ERR); + } + assertTrue("documentimportnode07", 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/documentimportnode07"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode08.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode08.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode08.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode08.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.Test; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import javax.xml.parsers.DocumentBuilderFactory; + +import static org.junit.Assert.assertTrue; + + +/** + * The importNode method imports a node from another document to this document. + * A NOT_SUPPORTED_ERR is raised if the type of node being imported is + * not supported + * Using the method importNode with deep=true, try to import a newly created DOcumentType + * node. Since DocumentType nodes cannot be imported, a NOT_SUPPORTED_ERR should be raised. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> + */ +public class documentimportnode08 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Node imported; + DocumentType docType; + DOMImplementation domImpl; + String nullNS = null; + + doc = load("staffNS", true); + domImpl = DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation(); + docType = domImpl.createDocumentType("test:root", nullNS, nullNS); + + { + boolean success = false; + try { + imported = doc.importNode(docType, true); + } catch (DOMException ex) { + success = (ex.code == DOMException.NOT_SUPPORTED_ERR); + } + assertTrue("documentimportnode08, Since DocumentType nodes cannot be imported, a NOT_SUPPORTED_ERR should be raised.", 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/documentimportnode08"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode09.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode09.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode09.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode09.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) 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.Node; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertFalse; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=false, import a newly created DocumentFragment node + * with the first address element from this Document appended to it into this document. + * Since deep=false, an empty DocumentFragment should be returned + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode09 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + DocumentFragment docFragment; + NodeList childList; + boolean success; + Node addressNode; + Node appendedChild; + Node importedDocFrag; + doc = load("staffNS", true); + docFragment = doc.createDocumentFragment(); + childList = doc.getElementsByTagNameNS("*", "address"); + addressNode = childList.item(0); + appendedChild = docFragment.appendChild(addressNode); + importedDocFrag = doc.importNode(docFragment, false); + success = importedDocFrag.hasChildNodes(); + assertFalse("documentimportnode09", 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/documentimportnode09"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode10.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode10.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode10.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode10.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,86 @@ +/* +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.Node; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertTrue; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=false, import a newly created DocumentFragment node + * with the first address element from this Document appended to it into this document. + * Since deep=true, a DocumentFragment with its child should be returned + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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> + */ + +/** + * seems to run infinite loop--TODO--put back in with newstore2 + * + * @ignore true + */ +public class documentimportnode10 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + DocumentFragment docFragment; + NodeList childList; + boolean success; + Node addressNode; + Node appendedChild; + Node importedDocFrag; + doc = load("staffNS", true); + docFragment = doc.createDocumentFragment(); + childList = doc.getElementsByTagNameNS("*", "address"); + addressNode = childList.item(0); + + appendedChild = docFragment.appendChild(addressNode); + System.out.println(" PAss 0"); + importedDocFrag = doc.importNode(docFragment, true); + System.out.println(" PAss 1"); + success = importedDocFrag.hasChildNodes(); + assertTrue("documentimportnode10", 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/documentimportnode10"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode11.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode11.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode11.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode11.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) 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.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 method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=false, import this Document's documentElement + * node. Verify if the node has been imported correctly by its nodeName atttribute and + * if the original document is not altered by checking if hasChildNodes returns false. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode11 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Element docElement; + Node imported; + boolean success; + String nodeNameOrig; + String nodeNameImported; + doc = load("staffNS", true); + docElement = doc.getDocumentElement(); + imported = doc.importNode(docElement, false); + success = imported.hasChildNodes(); + assertFalse("documentimportnode11", success); + nodeNameImported = imported.getNodeName(); + nodeNameOrig = docElement.getNodeName(); + assertEquals("documentimportnode11_NodeName", nodeNameImported, nodeNameOrig); + + } + + /** + * 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/documentimportnode11"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode12.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode12.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode12.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode12.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.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=true, import the first address element node of this + * Document. Verify if the node has been imported correctly by checking the length of the + * this elements childNode list before and after the import. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode12 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList childList; + Node imported; + Node addressElem; + NodeList addressElemChildren; + NodeList importedChildren; + int addressElemLen; + int importedLen; + doc = load("staffNS", true); + childList = doc.getElementsByTagNameNS("*", "address"); + addressElem = childList.item(0); + imported = doc.importNode(addressElem, true); + addressElemChildren = addressElem.getChildNodes(); + importedChildren = imported.getChildNodes(); + addressElemLen = addressElemChildren.getLength(); + importedLen = importedChildren.getLength(); + assertEquals("documentimportnode12", importedLen, addressElemLen); + + } + + /** + * 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/documentimportnode12"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode13.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode13.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode13.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode13.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.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=false, import the first employee element node of this + * Document. Verify if the node has been imported correctly by checking the length of the + * this elements childNode list before and after the import. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode13 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + NodeList childList; + Node imported; + NodeList importedList; + Node employeeElem; + int importedLen; + doc = load("staffNS", true); + childList = doc.getElementsByTagNameNS("*", "employee"); + employeeElem = childList.item(0); + imported = doc.importNode(employeeElem, false); + importedList = imported.getChildNodes(); + importedLen = importedList.getLength(); + assertEquals("documentimportnode13", 0, importedLen); + + } + + /** + * 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/documentimportnode13"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode14.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode14.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode14.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode14.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-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; +import static org.junit.Assert.assertNull; + + +/** + * Using the method importNode with deep=true, import the fourth employee element node of this + * Document. Verify if the node has been imported correctly by checking + * if the default attribute present on this node has not been imported + * and an explicit attribute has been imported. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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=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=402">http://www.w3.org/Bugs/Public/show_bug.cgi?id=402</a> + */ +public class documentimportnode14 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document newDoc; + DOMImplementation domImpl; + DocumentType nullDocType = null; + + NodeList childList; + Node imported; + Node employeeElem; + Attr attrNode; + String attrValue; + String nullNS = null; + + doc = load("staffNS", true); + childList = doc.getElementsByTagNameNS("*", "employee"); + employeeElem = childList.item(3); + domImpl = getImplementation(); + newDoc = domImpl.createDocument(nullNS, "staff", nullDocType); + imported = newDoc.importNode(employeeElem, true); + attrNode = ((Element) /*Node */imported).getAttributeNodeNS(nullNS, "defaultAttr"); + assertNull("defaultAttrNotImported", attrNode); + attrValue = ((Element) /*Node */imported).getAttributeNS("http://www.w3.org/2000/xmlns/", "emp"); + assertEquals("explicitAttrImported", "http://www.nist.gov", 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/documentimportnode14"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode15.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode15.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode15.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode15.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.Document; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=true, import a newly created Text node for this + * Document. Verify if the node has been imported correctly by checking the value of the + * imported text node. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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> + */ +//TODO: BUG +public class documentimportnode15 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document docImp; + Node textImport; + Node textToImport; + String nodeValue; + doc = load("staffNS", true); + docImp = load("staffNS", true); + textToImport = doc.createTextNode("Document.importNode test for a TEXT_NODE"); + textImport = doc.importNode(textToImport, true); + nodeValue = textImport.getNodeValue(); + assertEquals("documentimportnode15", "Document.importNode test for a TEXT_NODE", nodeValue); + + } + + /** + * 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/documentimportnode15"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode17.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode17.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode17.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode17.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.Document; +import org.w3c.dom.Node; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=true, import a newly created Comment node for this + * Document. Verify if the node has been imported correctly by checking the value of the + * imported Comment node. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode17 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document docImp; + Node commentImport; + Node commentToImport; + String nodeValue; + doc = load("staffNS", true); + docImp = load("staffNS", true); + commentToImport = doc.createComment("Document.importNode test for a COMMENT_NODE"); + commentImport = doc.importNode(commentToImport, true); + nodeValue = commentImport.getNodeValue(); + assertEquals("documentimportnode17", "Document.importNode test for a COMMENT_NODE", nodeValue); + + } + + /** + * 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/documentimportnode17"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode18.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode18.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode18.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode18.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.Document; +import org.w3c.dom.ProcessingInstruction; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=true, import a newly created PI node for this + * Document. Verify if the node has been imported correctly by checking the PITarget and + * PIData values of the imported PI node. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode18 extends DOMTestCase { + @Test + public void testRun() throws Throwable { + Document doc; + Document docImp; + ProcessingInstruction piImport; + ProcessingInstruction piToImport; + String PIData; + String PITarget; + doc = load("staffNS", true); + docImp = load("staffNS", true); + piToImport = doc.createProcessingInstruction("Target", "Data"); + piImport = (ProcessingInstruction) doc.importNode(piToImport, false); + PITarget = piImport.getTarget(); + PIData = piImport.getData(); + assertEquals("documentimportnode18_Target", "Target", PITarget); + assertEquals("documentimportnode18_Data", "Data", PIData); + + } + + /** + * 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/documentimportnode18"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode19.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode19.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode19.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode19.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,105 @@ +/* +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; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=true/false, import a entity nodes ent2 and ent6 + * from this document to a new document object. Verify if the nodes have been + * imported correctly by checking the nodeNames of the imported nodes and public and system ids. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode19 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + DocumentType docTypeNull = null; + + Document docImp; + DOMImplementation domImpl; + DocumentType docType; + NamedNodeMap nodeMap; + Entity entity2; + Entity entity6; + Entity entityImp2; + Entity entityImp6; + String nodeName; + String systemId; + String notationName; + String nodeNameImp; + String systemIdImp; + String notationNameImp; + doc = load("staffNS", true); + domImpl = doc.getImplementation(); + docType = doc.getDoctype(); + docImp = domImpl.createDocument("http://www.w3.org/DOM/Test", "a:b", docTypeNull); + nodeMap = docType.getEntities(); + entity2 = (Entity) nodeMap.getNamedItem("ent2"); + entity6 = (Entity) nodeMap.getNamedItem("ent6"); + entityImp2 = (Entity) docImp.importNode(entity2, false); + entityImp6 = (Entity) docImp.importNode(entity6, true); + nodeName = entity2.getNodeName(); + nodeNameImp = entityImp2.getNodeName(); + assertEquals("documentimportnode19_Ent2NodeName", nodeName, nodeNameImp); + nodeName = entity6.getNodeName(); + nodeNameImp = entityImp6.getNodeName(); + assertEquals("documentimportnode19_Ent6NodeName", nodeName, nodeNameImp); + systemId = entity2.getSystemId(); + systemIdImp = entityImp2.getSystemId(); + assertEquals("documentimportnode19_Ent2SystemId", systemId, systemIdImp); + systemId = entity6.getSystemId(); + systemIdImp = entityImp6.getSystemId(); + assertEquals("documentimportnode19_Ent6SystemId", systemId, systemIdImp); + notationName = entity2.getNotationName(); + notationNameImp = entityImp2.getNotationName(); + assertEquals("documentimportnode19_Ent2NotationName", notationName, notationNameImp); + notationName = entity6.getNotationName(); + notationNameImp = entityImp6.getNotationName(); + assertEquals("documentimportnode19_Ent6NotationName", notationName, notationNameImp); + + } + + /** + * 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/documentimportnode19"; + } + +} Added: xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode20.java URL: http://svn.apache.org/viewvc/xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode20.java?rev=1896456&view=auto ============================================================================== --- xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode20.java (added) +++ xmlbeans/branches/gradle-build/src/test/java/org/w3c/domts/level2/core/documentimportnode20.java Mon Dec 27 20:28:38 2021 @@ -0,0 +1,103 @@ +/* +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.CharacterData; +import org.w3c.dom.*; +import org.w3c.domts.DOMTestCase; + +import static org.junit.Assert.assertEquals; + + +/** + * The importNode method imports a node from another document to this document. + * The returned node has no parent; (parentNode is null). The source node is not + * altered or removed from the original document but a new copy of the source node + * is created. + * Using the method importNode with deep=true, import a entity node ent4 + * from this document to a new document object. The replacement text of this entity is an element + * node, a cdata node and a pi. Verify if the nodes have been + * imported correctly by checking the nodeNames of the imported element node, the data for the + * cdata nodes and the PItarget and PIData for the pi nodes. + * + * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core">http://www.w3.org/TR/DOM-Level-2-Core/core</a> + * @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 documentimportnode20 extends DOMTestCase { + @Test + @Ignore + public void testRun() throws Throwable { + Document doc; + Document docImp; + DOMImplementation domImpl; + DocumentType docType; + DocumentType docTypeNull = null; + NamedNodeMap nodeMap; + Entity entity4; + Entity entityImp4; + Element element; + CharacterData cdata; + ProcessingInstruction pi; + NodeList childList; + NodeList elemchildList; + String ent4Name; + String ent4ImpName; + String cdataVal; + String piTargetVal; + String piDataVal; + doc = load("staffNS", true); + domImpl = doc.getImplementation(); + docType = doc.getDoctype(); + docImp = domImpl.createDocument("http://www.w3.org/DOM/Test", "a:b", docTypeNull); + nodeMap = docType.getEntities(); + entity4 = (Entity) nodeMap.getNamedItem("ent4"); + entityImp4 = (Entity) docImp.importNode(entity4, true); + childList = entityImp4.getChildNodes(); + element = (Element) childList.item(0); + elemchildList = element.getChildNodes(); + cdata = (CharacterData) elemchildList.item(0); + pi = (ProcessingInstruction) childList.item(1); + ent4Name = entity4.getNodeName(); + ent4ImpName = entityImp4.getNodeName(); + cdataVal = cdata.getData(); + piTargetVal = pi.getTarget(); + piDataVal = pi.getData(); + assertEquals("documentimportnode20_Ent4NodeName", ent4Name, ent4ImpName); + assertEquals("documentimportnode20_Cdata", "Element data", cdataVal); + assertEquals("documentimportnode20_PITarget", "PItarget", piTargetVal); + assertEquals("documentimportnode20_PIData", "PIdata", piDataVal); + + } + + /** + * 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/documentimportnode20"; + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
