Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS02.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS02.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS02.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS02.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.w3c.domts.DOMTest.load; @@ -44,19 +44,14 @@ import static org.w3c.domts.DOMTest.load */ public class hasAttributeNS02 { @Test - public void testRun() throws Throwable { + void testRun() throws Throwable { String localName = "domestic"; String namespaceURI = "http://www.nomatch.com"; - Document doc; - NodeList elementList; - Element testNode; - boolean state; - doc = load("staffNS", false); - elementList = doc.getElementsByTagName("address"); - testNode = (Element) elementList.item(0); - state = testNode.hasAttributeNS(namespaceURI, localName); - assertFalse("throw_False", state); - + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagName("address"); + Element testNode = (Element) elementList.item(0); + boolean state = testNode.hasAttributeNS(namespaceURI, localName); + assertFalse(state, "throw_False"); } /**
Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS03.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS03.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS03.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS03.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.w3c.domts.DOMTest.load; @@ -44,19 +44,14 @@ import static org.w3c.domts.DOMTest.load */ public class hasAttributeNS03 { @Test - public void testRun() throws Throwable { + void testRun() throws Throwable { String localName = "blank"; String namespaceURI = "http://www.nist.gov"; - Document doc; - NodeList elementList; - Element testNode; - boolean state; - doc = load("staffNS", false); - elementList = doc.getElementsByTagName("emp:address"); - testNode = (Element) elementList.item(0); - state = testNode.hasAttributeNS(namespaceURI, localName); - assertFalse("throw_False", state); - + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagName("emp:address"); + Element testNode = (Element) elementList.item(0); + boolean state = testNode.hasAttributeNS(namespaceURI, localName); + assertFalse(state, "throw_False"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS04.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS04.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS04.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS04.java Sun Feb 6 01:51:55 2022 @@ -22,13 +22,13 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -45,20 +45,15 @@ import static org.w3c.domts.DOMTest.load */ public class hasAttributeNS04 { @Test - @Ignore("district is a spec attr") + @Disabled("district is a spec attr") public void testRun() throws Throwable { String localName = "district"; String namespaceURI = "http://www.nist.gov"; - Document doc; - NodeList elementList; - Element testNode; - boolean state; - doc = load("staffNS", false); - elementList = doc.getElementsByTagName("emp:address"); - testNode = (Element) elementList.item(0); - state = testNode.hasAttributeNS(namespaceURI, localName); - assertTrue("hasAttribute", state); - + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagName("emp:address"); + Element testNode = (Element) elementList.item(0); + boolean state = testNode.hasAttributeNS(namespaceURI, localName); + assertTrue(state, "hasAttribute"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS05.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS05.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS05.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributeNS05.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -44,19 +44,14 @@ import static org.w3c.domts.DOMTest.load */ public class hasAttributeNS05 { @Test - public void testRun() throws Throwable { + void testRun() throws Throwable { String localName = "domestic"; String namespaceURI = "http://www.usa.com"; - Document doc; - NodeList elementList; - Element testNode; - boolean state; - doc = load("staffNS", false); - elementList = doc.getElementsByTagName("address"); - testNode = (Element) elementList.item(0); - state = testNode.hasAttributeNS(namespaceURI, localName); - assertTrue("hasAttribute", state); - + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagName("address"); + Element testNode = (Element) elementList.item(0); + boolean state = testNode.hasAttributeNS(namespaceURI, localName); + assertTrue(state, "hasAttribute"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributes01.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributes01.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributes01.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributes01.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.w3c.domts.DOMTest.load; @@ -42,17 +42,12 @@ import static org.w3c.domts.DOMTest.load */ public class hasAttributes01 { @Test - public void testRun() throws Throwable { - Document doc; - NodeList addrList; - Node addrNode; - boolean state; - doc = load("staff", false); - addrList = doc.getElementsByTagName("name"); - addrNode = addrList.item(0); - state = addrNode.hasAttributes(); - assertFalse("throw_False", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + NodeList addrList = doc.getElementsByTagName("name"); + Node addrNode = addrList.item(0); + boolean state = addrNode.hasAttributes(); + assertFalse(state, "throw_False"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hasAttributes02.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -42,17 +42,12 @@ import static org.w3c.domts.DOMTest.load */ public class hasAttributes02 { @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); - + void testRun() throws Throwable { + Document doc = load("staff", false); + NodeList addrList = doc.getElementsByTagName("address"); + Node addrNode = addrList.item(0); + boolean state = addrNode.hasAttributes(); + assertTrue(state, "throw_True"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_attrcreatedocumentfragment.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_attrcreatedocumentfragment.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_attrcreatedocumentfragment.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_attrcreatedocumentfragment.java Sun Feb 6 01:51:55 2022 @@ -19,10 +19,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.*; -import static org.junit.Assert.assertEquals; +import java.util.stream.IntStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -41,33 +43,20 @@ import static org.w3c.domts.DOMTest.load */ public class hc_attrcreatedocumentfragment { @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"); + void testRun() throws Throwable { + + Document doc = load("hc_staff", true); + DocumentFragment docFragment = doc.createDocumentFragment(); + Element 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 ("lang".equals(attrName)) { - langAttrCount += 1; - } - } - assertEquals("hasLangAttr", 1, langAttrCount); + Node appendedChild = docFragment.appendChild(newOne); + Node domesticNode = docFragment.getFirstChild(); + NamedNodeMap attributes = domesticNode.getAttributes(); + + long langAttrCount = IntStream.range(0, attributes.getLength()) + .mapToObj(attributes::item).map(Node::getNodeName).filter("lang"::equals).count(); + assertEquals(1, langAttrCount, "hasLangAttr"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_attrname.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_attrname.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_attrname.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_attrname.java Sun Feb 6 01:51:55 2022 @@ -19,10 +19,10 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -42,24 +42,16 @@ import static org.w3c.domts.DOMTest.load */ public class hc_attrname { @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); - + void testRun() throws Throwable { + Document doc = load("hc_staff", false); + NodeList addressList = doc.getElementsByTagName("acronym"); + Node testNode = addressList.item(1); + NamedNodeMap attributes = testNode.getAttributes(); + Attr streetAttr = (Attr) attributes.getNamedItem("class"); + String strong1 = streetAttr.getNodeName(); + String strong2 = streetAttr.getName(); + assertEquals("class", strong1, "nodeName"); + assertEquals("class", strong2, "name"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_documentcreateattribute.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_documentcreateattribute.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_documentcreateattribute.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_documentcreateattribute.java Sun Feb 6 01:51:55 2022 @@ -19,11 +19,11 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Attr; import org.w3c.dom.Document; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -44,21 +44,15 @@ import static org.w3c.domts.DOMTest.load */ public class hc_documentcreateattribute { @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); - + void testRun() throws Throwable { + Document doc = load("hc_staff", true); + Attr newAttrNode = doc.createAttribute("style"); + String attrValue = newAttrNode.getNodeValue(); + assertEquals("", attrValue, "value"); + String attrName = newAttrNode.getNodeName(); + assertEquals("style", attrName, "name"); + int attrType = newAttrNode.getNodeType(); + assertEquals(2, attrType, "type"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_elementgetattributenode.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_elementgetattributenode.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_elementgetattributenode.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_elementgetattributenode.java Sun Feb 6 01:51:55 2022 @@ -19,13 +19,13 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -45,19 +45,13 @@ import static org.w3c.domts.DOMTest.load */ public class hc_elementgetattributenode { @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); - + void testRun() throws Throwable { + Document doc = load("hc_staff", true); + NodeList elementList = doc.getElementsByTagName("acronym"); + Element testEmployee = (Element) elementList.item(0); + Attr domesticAttr = testEmployee.getAttributeNode("title"); + String strong = domesticAttr.getNodeName(); + assertEquals("title", strong, "nodeName"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_entitiesremovenameditemns1.java Sun Feb 6 01:51:55 2022 @@ -19,11 +19,15 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; -import org.w3c.dom.*; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.NamedNodeMap; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -36,31 +40,14 @@ import static org.w3c.domts.DOMTest.load */ public class hc_entitiesremovenameditemns1 { @Test - @Ignore + @Disabled 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; - } - } + Document doc = load("hc_staff", true); + DocumentType docType = doc.getDoctype(); + NamedNodeMap entities = docType.getEntities(); + DOMException ex = assertThrows(DOMException.class, () -> entities.removeNamedItemNS("http://www.w3.org/1999/xhtml", "alpha")); + assertTrue(ex.code == 7 || ex.code == 8, "throw_NO_MOD_OR_NOT_FOUND_ERR"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_entitiessetnameditemns1.java Sun Feb 6 01:51:55 2022 @@ -19,11 +19,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.*; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -36,33 +37,15 @@ import static org.w3c.domts.DOMTest.load */ public class hc_entitiessetnameditemns1 { @Test - @Ignore + @Disabled 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; - } - } + Document doc = load("hc_staff", true); + DocumentType docType = doc.getDoctype(); + NamedNodeMap entities = docType.getEntities(); + Element elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "br"); + DOMException ex = assertThrows(DOMException.class, () -> entities.setNamedItemNS(elem)); + assertTrue(ex.code == 3 || ex.code == 7, "throw_HIER_OR_NO_MOD_ERR"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_namednodemapgetnameditem.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_namednodemapgetnameditem.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_namednodemapgetnameditem.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_namednodemapgetnameditem.java Sun Feb 6 01:51:55 2022 @@ -19,10 +19,10 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -44,21 +44,14 @@ import static org.w3c.domts.DOMTest.load */ public class hc_namednodemapgetnameditem { @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); - + void testRun() throws Throwable { + Document doc = load("hc_staff", false); + NodeList elementList = doc.getElementsByTagName("acronym"); + Node testEmployee = elementList.item(1); + NamedNodeMap attributes = testEmployee.getAttributes(); + Attr domesticAttr = (Attr) attributes.getNamedItem("title"); + String attrName = domesticAttr.getNodeName(); + assertEquals("title", attrName, "nodeName"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize1.java Sun Feb 6 01:51:55 2022 @@ -19,14 +19,14 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; import org.w3c.dom.Node; import org.w3c.dom.Text; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -37,31 +37,21 @@ import static org.w3c.domts.DOMTest.load * @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 { @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); + void testRun() throws Throwable { + Document doc = load("hc_staff", true); + DocumentFragment docFragment = doc.createDocumentFragment(); + Text txtNode = doc.createTextNode("foo"); + Node 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); + String nodeValue = txtNode.getNodeValue(); + assertEquals("foobar", nodeValue, "normalizedNodeValue"); retval = txtNode.getNextSibling(); - assertNull("singleChild", retval); - + assertNull(retval, "singleChild"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_nodedocumentfragmentnormalize2.java Sun Feb 6 01:51:55 2022 @@ -19,13 +19,13 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; import org.w3c.dom.Node; import org.w3c.dom.Text; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -36,28 +36,16 @@ import static org.w3c.domts.DOMTest.load * @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 { @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); + void testRun() throws Throwable { + Document doc = load("hc_staff", true); + DocumentFragment docFragment = doc.createDocumentFragment(); + Text txtNode = doc.createTextNode(""); + Node retval = docFragment.appendChild(txtNode); docFragment.normalize(); txtNode = (Text) docFragment.getFirstChild(); - assertNull("There should be no child nodes after normalization", txtNode); - + assertNull(txtNode, "There should be no child nodes after normalization"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_notationsremovenameditemns1.java Sun Feb 6 01:51:55 2022 @@ -19,11 +19,15 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; -import org.w3c.dom.*; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.NamedNodeMap; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -36,31 +40,14 @@ import static org.w3c.domts.DOMTest.load */ public class hc_notationsremovenameditemns1 { @Test - @Ignore + @Disabled 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; - } - } + Document doc = load("hc_staff", true); + DocumentType docType = doc.getDoctype(); + NamedNodeMap notations = docType.getNotations(); + DOMException ex = assertThrows(DOMException.class, () -> notations.removeNamedItemNS("http://www.w3.org/1999/xhtml", "alpha")); + assertTrue(ex.code == 7 || ex.code == 8, "throw_NO_MOD_OR_NOT_FOUND_ERR"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/hc_notationssetnameditemns1.java Sun Feb 6 01:51:55 2022 @@ -19,11 +19,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.*; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -36,33 +37,16 @@ import static org.w3c.domts.DOMTest.load */ public class hc_notationssetnameditemns1 { @Test - @Ignore + @Disabled 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; - } - } + Document doc = load("hc_staff", true); + DocumentType docType = doc.getDoctype(); + NamedNodeMap notations = docType.getNotations(); + Element elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "br"); + DOMException ex = assertThrows(DOMException.class, () -> notations.setNamedItemNS(elem)); + assertTrue(ex.code == 3 || ex.code == 7, "throw_HIER_OR_NO_MOD_ERR"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode01.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode01.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode01.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode01.java Sun Feb 6 01:51:55 2022 @@ -22,11 +22,11 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.*; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import static org.w3c.domts.DOMTest.assertURIEquals; import static org.w3c.domts.DOMTest.load; @@ -49,51 +49,30 @@ import static org.w3c.domts.DOMTest.load */ public class importNode01 { @Test - @Ignore + @Disabled 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); + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + Attr newAttr = aNewDoc.createAttribute("elem:attr1"); + Text importedChild = aNewDoc.createTextNode("importedText"); + Node aNode = newAttr.appendChild(importedChild); aNode = doc.importNode(newAttr, false); - ownerDocument = aNode.getOwnerDocument(); - docType = ownerDocument.getDoctype(); - system = docType.getSystemId(); - assertNotNull("aNode", aNode); + Document ownerDocument = aNode.getOwnerDocument(); + DocumentType docType = ownerDocument.getDoctype(); + String system = docType.getSystemId(); + assertNotNull(aNode, "aNode"); assertURIEquals("systemId", "staffNS.dtd", system); - attrOwnerElement = ((Attr) /*Node */aNode).getOwnerElement(); - assertNull("ownerElement", attrOwnerElement); - specified = ((Attr) /*Node */aNode).getSpecified(); - assertTrue("specified", specified); - childList = aNode.getChildNodes(); - assertEquals("childList", 1, childList.getLength()); - nodeName = aNode.getNodeName(); - assertEquals("nodeName", "elem:attr1", nodeName); - child = aNode.getFirstChild(); - childValue = child.getNodeValue(); - assertEquals("childValue", "importedText", childValue); - + Element attrOwnerElement = ((Attr) /*Node */aNode).getOwnerElement(); + assertNull(attrOwnerElement, "ownerElement"); + boolean specified = ((Attr) /*Node */aNode).getSpecified(); + assertTrue(specified, "specified"); + NodeList childList = aNode.getChildNodes(); + assertEquals(1, childList.getLength(), "childList"); + String nodeName = aNode.getNodeName(); + assertEquals("elem:attr1", nodeName, "nodeName"); + Node child = aNode.getFirstChild(); + String childValue = child.getNodeValue(); + assertEquals("importedText", childValue, "childValue"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode02.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode02.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode02.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode02.java Sun Feb 6 01:51:55 2022 @@ -22,13 +22,13 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.CDATASection; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.Node; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -45,30 +45,20 @@ import static org.w3c.domts.DOMTest.load */ public class importNode02 { @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); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + CDATASection cDataSec = aNewDoc.createCDATASection("this is CDATASection data"); + Node aNode = doc.importNode(cDataSec, false); + Document ownerDocument = aNode.getOwnerDocument(); + DocumentType docType = ownerDocument.getDoctype(); + + // TODO: + // String system = docType.getSystemId(); + // assertURIEquals("dtdSystemId", "staffNS.dtd", system); + String value = aNode.getNodeValue(); + assertEquals("this is CDATASection data", value, "nodeValue"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode03.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode03.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode03.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode03.java Sun Feb 6 01:51:55 2022 @@ -22,13 +22,13 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Comment; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.Node; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -46,26 +46,17 @@ import static org.w3c.domts.DOMTest.load */ public class importNode03 { @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); - + void testRun() throws Throwable { + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + Comment comment = aNewDoc.createComment("this is a comment"); + Node aNode = doc.importNode(comment, false); + Document ownerDocument = aNode.getOwnerDocument(); + DocumentType docType = null;//ownerDocument.getDoctype(); + // String system = docType.getSystemId(); + // assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + String value = aNode.getNodeValue(); + assertEquals("this is a comment", value, "nodeValue"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode04.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode04.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode04.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode04.java Sun Feb 6 01:51:55 2022 @@ -22,10 +22,10 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -44,27 +44,18 @@ import static org.w3c.domts.DOMTest.load */ public class importNode04 { @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); + void testRun() throws Throwable { + Document doc = load("staff", true); + Document aNewDoc = load("staff", true); + DocumentFragment docFrag = aNewDoc.createDocumentFragment(); + Comment comment = aNewDoc.createComment("descendant1"); + Node aNode = docFrag.appendChild(comment); aNode = doc.importNode(docFrag, true); - children = aNode.getChildNodes(); - assertEquals("throw_Size", 1, children.getLength()); - child = aNode.getFirstChild(); - childValue = child.getNodeValue(); - assertEquals("descendant1", "descendant1", childValue); - + NodeList children = aNode.getChildNodes(); + assertEquals(1, children.getLength(), "throw_Size"); + Node child = aNode.getFirstChild(); + String childValue = child.getNodeValue(); + assertEquals("descendant1", childValue, "descendant1"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode05.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode05.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode05.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode05.java Sun Feb 6 01:51:55 2022 @@ -22,15 +22,15 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.Element; import org.w3c.dom.Node; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.w3c.domts.DOMTest.assertURIEquals; import static org.w3c.domts.DOMTest.load; @@ -50,30 +50,20 @@ import static org.w3c.domts.DOMTest.load */ public class importNode05 { @Test - @Ignore + @Disabled 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(); + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + Element element = aNewDoc.getElementById("CANADA"); + Node aNode = doc.importNode(element, false); + boolean hasChild = aNode.hasChildNodes(); + assertFalse(hasChild, "hasChild"); + Document ownerDocument = aNode.getOwnerDocument(); + DocumentType docType = ownerDocument.getDoctype(); + String system = docType.getSystemId(); assertURIEquals("dtdSystemId", "staffNS.dtd", system); - name = aNode.getNodeName(); - assertEquals("nodeName", "emp:address", name); - + String name = aNode.getNodeName(); + assertEquals("emp:address", name, "nodeName"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode06.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode06.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode06.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode06.java Sun Feb 6 01:51:55 2022 @@ -22,14 +22,14 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -48,28 +48,19 @@ import static org.w3c.domts.DOMTest.load public class importNode06 { @Test - @Ignore + @Disabled 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); - + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + Element element = aNewDoc.getElementById("CANADA"); + Node aNode = doc.importNode(element, true); + boolean hasChild = aNode.hasChildNodes(); + assertTrue(hasChild, "throw_True"); + String name = aNode.getNodeName(); + assertEquals("emp:address", name, "nodeName"); + Node child = aNode.getFirstChild(); + String value = child.getNodeValue(); + assertEquals("27 South Road. Dallas, texas 98556", value, "nodeValue"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode07.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode07.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode07.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode07.java Sun Feb 6 01:51:55 2022 @@ -22,15 +22,14 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -50,30 +49,21 @@ import static org.w3c.domts.DOMTest.load */ public class importNode07 { @Test - @Ignore("default attribute not supported") + @Disabled("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(); - Assert.assertEquals("throw_Size", 1, attributes.getLength()); - name = aNode.getNodeName(); - assertEquals("nodeName", "emp:employee", name); - attr = attributes.item(0); - lname = attr.getLocalName(); - assertEquals("lname", "defaultAttr", lname); - + Document doc = load("staffNS", true); + Document aNewDoc = load("staff", true); + Element element = aNewDoc.createElementNS(namespaceURI, qualifiedName); + Node aNode = doc.importNode(element, false); + NamedNodeMap attributes = aNode.getAttributes(); + assertEquals(1, attributes.getLength(), "throw_Size"); + String name = aNode.getNodeName(); + assertEquals("emp:employee", name, "nodeName"); + Node attr = attributes.item(0); + String lname = attr.getLocalName(); + assertEquals("defaultAttr", lname, "lname"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode08.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode08.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode08.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode08.java Sun Feb 6 01:51:55 2022 @@ -22,13 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; -import org.w3c.dom.DocumentType; import org.w3c.dom.Node; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.w3c.domts.DOMTest.load; @@ -47,27 +46,18 @@ import static org.w3c.domts.DOMTest.load */ public class importNode08 { @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(); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + DocumentFragment docFrag = aNewDoc.createDocumentFragment(); + Node aNode = doc.importNode(docFrag, false); + boolean hasChild = aNode.hasChildNodes(); + assertFalse(hasChild, "hasChild"); + Document ownerDocument = aNode.getOwnerDocument(); //TODO: docType - // docType = ownerDocument.getDoctype(); - // system = docType.getSystemId(); + // DocumentType docType = ownerDocument.getDoctype(); + // String system = docType.getSystemId(); // assertURIEquals("system", null, null, null, "staffNS.dtd", null, null, null, null, system); - } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode09.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode09.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode09.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode09.java Sun Feb 6 01:51:55 2022 @@ -22,14 +22,14 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.Entity; import org.w3c.dom.NamedNodeMap; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.assertURIEquals; import static org.w3c.domts.DOMTest.load; @@ -48,39 +48,26 @@ import static org.w3c.domts.DOMTest.load */ public class importNode09 { @Test - @Ignore + @Disabled 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(); + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + DocumentType docType = aNewDoc.getDoctype(); + NamedNodeMap entityList = docType.getEntities(); + Entity entity2 = (Entity) entityList.getNamedItem("ent6"); + Entity entity1 = (Entity) doc.importNode(entity2, false); + Document ownerDocument = entity1.getOwnerDocument(); docType = ownerDocument.getDoctype(); - system = docType.getSystemId(); + String system = docType.getSystemId(); assertURIEquals("dtdSystemId", "staffNS.dtd", system); - entityName = entity1.getNodeName(); - assertEquals("entityName", "ent6", entityName); - publicVal = entity1.getPublicId(); - assertEquals("entityPublicId", "uri", publicVal); + String entityName = entity1.getNodeName(); + assertEquals("ent6", entityName, "entityName"); + String publicVal = entity1.getPublicId(); + assertEquals("uri", publicVal, "entityPublicId"); system = entity1.getSystemId(); assertURIEquals("entitySystemId", "file", system); - notationName = entity1.getNotationName(); - assertEquals("notationName", "notation2", notationName); - + String notationName = entity1.getNotationName(); + assertEquals("notation2", notationName, "notationName"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode10.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode10.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode10.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode10.java Sun Feb 6 01:51:55 2022 @@ -22,14 +22,14 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.EntityReference; import org.w3c.dom.Node; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.assertURIEquals; import static org.w3c.domts.DOMTest.load; @@ -50,28 +50,19 @@ import static org.w3c.domts.DOMTest.load */ public class importNode10 { @Test - @Ignore + @Disabled 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"); + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + EntityReference entRef = aNewDoc.createEntityReference("entRef1"); entRef.setNodeValue("entRef1Value"); - aNode = doc.importNode(entRef, false); - ownerDocument = aNode.getOwnerDocument(); - docType = ownerDocument.getDoctype(); - system = docType.getSystemId(); + Node aNode = doc.importNode(entRef, false); + Document ownerDocument = aNode.getOwnerDocument(); + DocumentType docType = ownerDocument.getDoctype(); + String system = docType.getSystemId(); assertURIEquals("systemId", "staffNS.dtd", system); - name = aNode.getNodeName(); - assertEquals("nodeName", "entRef1", name); - + String name = aNode.getNodeName(); + assertEquals("entRef1", name, "nodeName"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode11.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode11.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode11.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode11.java Sun Feb 6 01:51:55 2022 @@ -22,14 +22,14 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.EntityReference; import org.w3c.dom.Node; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.w3c.domts.DOMTest.load; @@ -49,26 +49,18 @@ import static org.w3c.domts.DOMTest.load */ public class importNode11 { @Test - @Ignore + @Disabled 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); - + Document doc = load("staff", true); + Document aNewDoc = load("staff", true); + EntityReference entRef = aNewDoc.createEntityReference("ent3"); + Node aNode = doc.importNode(entRef, true); + String name = aNode.getNodeName(); + assertEquals("ent3", name, "entityName"); + Node child = aNode.getFirstChild(); + assertNotNull(child, "child"); + String childValue = child.getNodeValue(); + assertEquals("Texas", childValue, "childValue"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode12.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode12.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode12.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode12.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.w3c.domts.DOMTest.assertURIEquals; import static org.w3c.domts.DOMTest.load; @@ -45,38 +45,25 @@ import static org.w3c.domts.DOMTest.load */ public class importNode12 { @Test - @Ignore + @Disabled 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", "staffNS.dtd", system); - entityName = entity1.getNodeName(); - assertEquals("entityName", "ent4", entityName); - child = entity1.getFirstChild(); - assertNotNull("notnull", child); - childName = child.getNodeName(); - assertEquals("childName", "entElement1", childName); + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + DocumentType doc1Type = aNewDoc.getDoctype(); + NamedNodeMap entityList = doc1Type.getEntities(); + Entity entity2 = (Entity) entityList.getNamedItem("ent4"); + Entity entity1 = (Entity) doc.importNode(entity2, true); + Document ownerDocument = entity1.getOwnerDocument(); + DocumentType docType = ownerDocument.getDoctype(); + String system = docType.getSystemId(); + assertURIEquals("systemId", "staffNS.dtd", system); + String entityName = entity1.getNodeName(); + assertEquals("ent4", entityName, "entityName"); + Node child = entity1.getFirstChild(); + assertNotNull(child, "notnull"); + String childName = child.getNodeName(); + assertEquals("entElement1", childName, "childName"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode13.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode13.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode13.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode13.java Sun Feb 6 01:51:55 2022 @@ -22,15 +22,15 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Notation; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.assertURIEquals; import static org.w3c.domts.DOMTest.load; @@ -49,33 +49,22 @@ import static org.w3c.domts.DOMTest.load */ public class importNode13 { @Test - @Ignore + @Disabled 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(); + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + DocumentType doc1Type = aNewDoc.getDoctype(); + NamedNodeMap notationList = doc1Type.getNotations(); + Notation notation = (Notation) notationList.getNamedItem("notation1"); + Notation aNode = (Notation) doc.importNode(notation, false); + Document ownerDocument = aNode.getOwnerDocument(); + DocumentType docType = ownerDocument.getDoctype(); + String system = docType.getSystemId(); assertURIEquals("systemId", "staffNS.dtd", system); - publicVal = aNode.getPublicId(); - assertEquals("publicId", "notation1File", publicVal); + String publicVal = aNode.getPublicId(); + assertEquals("notation1File", publicVal, "publicId"); system = aNode.getSystemId(); - assertNull("notationSystemId", system); - + assertNull(system, "notationSystemId"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode14.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode14.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode14.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode14.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,11 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; import org.w3c.dom.ProcessingInstruction; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -44,34 +43,19 @@ import static org.w3c.domts.DOMTest.load */ public class importNode14 { @Test - public void testRun() throws Throwable { - Document doc; - Document aNewDoc; - ProcessingInstruction pi; - ProcessingInstruction aNode; - Document ownerDocument; - DocumentType docType; - String system; - String target; - String data; - java.util.List result = new java.util.ArrayList(); - - doc = load("staffNS", true); - aNewDoc = load("staffNS", true); - pi = aNewDoc.createProcessingInstruction("target1", "data1"); - aNode = (ProcessingInstruction) doc.importNode(pi, false); - ownerDocument = aNode.getOwnerDocument(); - //$NOTE:add this if ever implemented - /* - docType = ownerDocument.getDoctype(); - system = docType.getSystemId(); - assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); - */ - target = aNode.getTarget(); - assertEquals("piTarget", "target1", target); - data = aNode.getData(); - assertEquals("piData", "data1", data); - + void testRun() throws Throwable { + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + ProcessingInstruction pi = aNewDoc.createProcessingInstruction("target1", "data1"); + ProcessingInstruction aNode = (ProcessingInstruction) doc.importNode(pi, false); + // TODO: add this if ever implemented + // DocumentType docType = ownerDocument.getDoctype(); + // String system = docType.getSystemId(); + // assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + String target = aNode.getTarget(); + assertEquals("target1", target, "piTarget"); + String data = aNode.getData(); + assertEquals("data1", data, "piData"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode15.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode15.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode15.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode15.java Sun Feb 6 01:51:55 2022 @@ -22,13 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; import org.w3c.dom.Node; import org.w3c.dom.Text; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -46,29 +45,17 @@ import static org.w3c.domts.DOMTest.load */ public class importNode15 { @Test - public void testRun() throws Throwable { - Document doc; - Document aNewDoc; - Text text; - Node aNode; - Document ownerDocument; - DocumentType docType; - String system; - String value; - doc = load("staffNS", true); - aNewDoc = load("staffNS", true); - text = aNewDoc.createTextNode("this is text data"); - aNode = doc.importNode(text, false); - ownerDocument = aNode.getOwnerDocument(); - //$NOTE:add this if ever implemented - /* - docType = ownerDocument.getDoctype(); - system = docType.getSystemId(); - assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); - */ - value = aNode.getNodeValue(); - assertEquals("nodeValue", "this is text data", value); - + void testRun() throws Throwable { + Document doc = load("staffNS", true); + Document aNewDoc = load("staffNS", true); + Text text = aNewDoc.createTextNode("this is text data"); + Node aNode = doc.importNode(text, false); + // TODO: add this if ever implemented + // DocumentType docType = ownerDocument.getDoctype(); + // String system = docType.getSystemId(); + // assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system); + String value = aNode.getNodeValue(); + assertEquals("this is text data", value, "nodeValue"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode16.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode16.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode16.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode16.java Sun Feb 6 01:51:55 2022 @@ -22,14 +22,14 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; -import org.w3c.dom.Node; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.w3c.domts.DOMTest.load; @@ -48,26 +48,14 @@ import static org.w3c.domts.DOMTest.load */ public class importNode16 { @Test - @Ignore("Doctype tricks") + @Disabled("Doctype tricks") public void testRun() throws Throwable { - Document doc; - Document anotherDoc; - DocumentType docType; - Node node; - doc = load("staffNS", true); - anotherDoc = load("staffNS", true); - docType = anotherDoc.getDoctype(); - - { - boolean success = false; - try { - node = doc.importNode(docType, false); - } catch (DOMException ex) { - success = (ex.code == DOMException.NOT_SUPPORTED_ERR); - } - assertTrue("throw_NOT_SUPPORTED_ERR", success); - } + Document doc = load("staffNS", true); + Document anotherDoc = load("staffNS", true); + DocumentType docType = anotherDoc.getDoctype(); + DOMException ex = assertThrows(DOMException.class, () -> doc.importNode(docType, false)); + assertEquals(DOMException.NOT_SUPPORTED_ERR, ex.code, "throw_NOT_SUPPORTED_ERR"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode17.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode17.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode17.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/importNode17.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.DOMException; import org.w3c.dom.Document; -import org.w3c.dom.Node; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.w3c.domts.DOMTest.load; @@ -46,23 +46,12 @@ import static org.w3c.domts.DOMTest.load */ public class importNode17 { @Test - public void testRun() throws Throwable { - Document doc; - Document anotherDoc; - Node node; - doc = load("staffNS", true); - anotherDoc = load("staffNS", true); - - { - boolean success = false; - try { - node = doc.importNode(anotherDoc, false); - } catch (DOMException ex) { - success = (ex.code == DOMException.NOT_SUPPORTED_ERR); - } - assertTrue("throw_NOT_SUPPORTED_ERR", success); - } + void testRun() throws Throwable { + Document doc = load("staffNS", true); + Document anotherDoc = load("staffNS", true); + DOMException ex = assertThrows(DOMException.class, () -> doc.importNode(anotherDoc, false)); + assertEquals(DOMException.NOT_SUPPORTED_ERR, ex.code, "throw_NOT_SUPPORTED_ERR"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/internalSubset01.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/internalSubset01.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/internalSubset01.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/internalSubset01.java Sun Feb 6 01:51:55 2022 @@ -22,12 +22,12 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -43,15 +43,12 @@ import static org.w3c.domts.DOMTest.load */ public class internalSubset01 { @Test - @Ignore + @Disabled public void testRun() throws Throwable { - Document doc; - DocumentType docType; - String internal; - doc = load("staff2", false); - docType = doc.getDoctype(); - internal = docType.getInternalSubset(); - assertNull("throw_Null", internal); + Document doc = load("staff2", false); + DocumentType docType = doc.getDoctype(); + String internal = docType.getInternalSubset(); + assertNull(internal, "throw_Null"); } Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported01.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported01.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported01.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported01.java Sun Feb 6 01:51:55 2022 @@ -22,11 +22,11 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.w3c.domts.DOMTest.load; @@ -47,15 +47,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported01 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("XXX", "1.0"); - assertFalse("throw_False", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("XXX", "1.0"); + assertFalse(state, "throw_False"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported02.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported02.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported02.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported02.java Sun Feb 6 01:51:55 2022 @@ -22,11 +22,11 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.w3c.domts.DOMTest.load; @@ -47,15 +47,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported02 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("XML", "9.0"); - assertFalse("throw_False", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("XML", "9.0"); + assertFalse(state, "throw_False"); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
