Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported04.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported04.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported04.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported04.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -49,15 +49,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported04 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("xml", "1.0"); - assertTrue("throw_True", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("xml", "1.0"); + assertTrue(state, "throw_True"); } /**
Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported05.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported05.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported05.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported05.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -49,15 +49,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported05 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("core", "2.0"); - assertTrue("throw_True", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("core", "2.0"); + assertTrue(state, "throw_True"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported06.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported06.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported06.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported06.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -49,15 +49,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported06 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("xml", "2.0"); - assertTrue("throw_True", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("xml", "2.0"); + assertTrue(state, "throw_True"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported07.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported07.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported07.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported07.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -49,15 +49,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported07 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("XML", ""); - assertTrue("throw_True", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("XML", ""); + assertTrue(state, "throw_True"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported09.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported09.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported09.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported09.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -49,15 +49,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported09 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("XML", "1.0"); - assertTrue("throw_True", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("XML", "1.0"); + assertTrue(state, "throw_True"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported10.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported10.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported10.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported10.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -49,15 +49,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported10 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("CORE", "2.0"); - assertTrue("throw_True", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("CORE", "2.0"); + assertTrue(state, "throw_True"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported11.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported11.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported11.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported11.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -49,15 +49,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported11 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("XML", "2.0"); - assertTrue("throw_True", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("XML", "2.0"); + assertTrue(state, "throw_True"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported12.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported12.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported12.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported12.java Sun Feb 6 01:51:55 2022 @@ -22,11 +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.Assertions; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -48,41 +49,23 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported12 { @Test - public void testRun() throws Throwable { - java.util.List features = new java.util.ArrayList(); - features.add("Core"); - features.add("XML"); - features.add("HTML"); - features.add("Views"); - features.add("StyleSheets"); - features.add("CSS"); - features.add("CSS2"); - features.add("Events"); - features.add("UIEvents"); - features.add("MouseEvents"); - features.add("MutationEvents"); - features.add("HTMLEvents"); - features.add("Range"); - features.add("Traversal"); - //features.add(new Double("bogus.bogus.bogus")); - - Document doc; - Node rootNode; - String featureElement; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("Core", "2.0"); - assertTrue("Core2", state); - for (int indexd467e91 = 0; indexd467e91 < features.size(); indexd467e91++) { - featureElement = (String) features.get(indexd467e91); - state = rootNode.isSupported(featureElement, "1.0"); + void testRun() throws Throwable { + String[] features = { + "Core", "XML", "HTML", "Views", "StyleSheets", "CSS", "CSS2", "Events", "UIEvents", + "MouseEvents", "MutationEvents", "HTMLEvents", "Range", "Traversal" + /* ,"bogus.bogus.bogus" */ + }; + + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + + boolean state = rootNode.isSupported("Core", "2.0"); + assertTrue(state, "Core2"); + + for (String featureElement : features) { + Assertions.assertDoesNotThrow(() -> rootNode.isSupported(featureElement, "1.0")); + Assertions.assertDoesNotThrow(() -> rootNode.isSupported(featureElement, "2.0")); } - for (int indexd467e96 = 0; indexd467e96 < features.size(); indexd467e96++) { - featureElement = (String) features.get(indexd467e96); - state = rootNode.isSupported(featureElement, "2.0"); - } - } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported13.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported13.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported13.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported13.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -38,15 +38,11 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported13 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("Core", ""); - assertTrue("Core", state); - + void testRun() throws Throwable { + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("Core", ""); + assertTrue(state, "Core"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported14.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported14.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported14.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/isSupported14.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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.w3c.domts.DOMTest.load; @@ -38,17 +38,13 @@ import static org.w3c.domts.DOMTest.load */ public class isSupported14 { @Test - public void testRun() throws Throwable { - Document doc; - Node rootNode; - boolean state; + void testRun() throws Throwable { String nullString = null; - doc = load("staff", false); - rootNode = doc.getDocumentElement(); - state = rootNode.isSupported("Core", nullString); - assertTrue("Core", state); - + Document doc = load("staff", false); + Node rootNode = doc.getDocumentElement(); + boolean state = rootNode.isSupported("Core", nullString); + assertTrue(state, "Core"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName01.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName01.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName01.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName01.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.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; @@ -46,19 +46,13 @@ import static org.w3c.domts.DOMTest.load */ public class localName01 { @Test - public void testRun() throws Throwable { - Document doc; - NodeList elementList; - Element testAddr; - Attr addrAttr; - String localName; - doc = load("staffNS", false); - elementList = doc.getElementsByTagName("emp:address"); - testAddr = (Element) elementList.item(0); - addrAttr = testAddr.getAttributeNode("emp:domestic"); - localName = addrAttr.getLocalName(); - assertEquals("localName", "domestic", localName); - + void testRun() throws Throwable { + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagName("emp:address"); + Element testAddr = (Element) elementList.item(0); + Attr addrAttr = testAddr.getAttributeNode("emp:domestic"); + String localName = addrAttr.getLocalName(); + assertEquals("domestic", localName, "localName"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName02.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName02.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName02.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName02.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.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -44,16 +44,13 @@ import static org.w3c.domts.DOMTest.load */ public class localName02 { @Test - public void testRun() throws Throwable { - Document doc; - Node createdNode; - String localName; - doc = load("staffNS", false); - createdNode = doc.createElement("test:employee"); - localName = createdNode.getLocalName(); - assertNull("throw_Null," + - "Expected: nodeName attribute set to tagName, and localName, " + - "prefix, and namespaceURI set to null", localName); + void testRun() throws Throwable { + Document doc = load("staffNS", false); + Node createdNode = doc.createElement("test:employee"); + String localName = createdNode.getLocalName(); + assertNull(localName, "throw_Null," + + "Expected: nodeName attribute set to tagName, and localName, " + + "prefix, and namespaceURI set to null"); } Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName03.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName03.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName03.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName03.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.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -45,18 +45,13 @@ import static org.w3c.domts.DOMTest.load */ public class localName03 { @Test - public void testRun() throws Throwable { - Document doc; - NodeList elementList; - Node testEmployee; - Node textNode; - String localName; - doc = load("staffNS", false); - elementList = doc.getElementsByTagName("employeeId"); - testEmployee = elementList.item(0); - textNode = testEmployee.getFirstChild(); - localName = textNode.getLocalName(); - assertNull("textNodeLocalName", localName); + void testRun() throws Throwable { + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagName("employeeId"); + Node testEmployee = elementList.item(0); + Node textNode = testEmployee.getFirstChild(); + String localName = textNode.getLocalName(); + assertNull(localName, "textNodeLocalName"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName04.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName04.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName04.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/localName04.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.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -44,17 +44,12 @@ import static org.w3c.domts.DOMTest.load */ public class localName04 { @Test - public void testRun() throws Throwable { - Document doc; - NodeList elementList; - Node testEmployee; - String employeeLocalName; - doc = load("staffNS", false); - elementList = doc.getElementsByTagName("employee"); - testEmployee = elementList.item(0); - employeeLocalName = testEmployee.getLocalName(); - assertEquals("lname", "employee", employeeLocalName); - + void testRun() throws Throwable { + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagName("employee"); + Node testEmployee = elementList.item(0); + String employeeLocalName = testEmployee.getLocalName(); + assertEquals("employee", employeeLocalName, "lname"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns01.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns01.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns01.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns01.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.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -42,27 +42,18 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapgetnameditemns01 { @Test - @Ignore + @Disabled public void testRun() throws Throwable { - Document doc; - DocumentType docType; - NamedNodeMap entities; - NamedNodeMap notations; - Entity entity; - Notation notation; - String entityName; - String notationName; String nullNS = null; - doc = load("staffNS", false); - docType = doc.getDoctype(); - entities = docType.getEntities(); - notations = docType.getNotations(); - entity = (Entity) entities.getNamedItemNS(nullNS, "ent1"); - assertNull("entityNull", entity); - notation = (Notation) notations.getNamedItemNS(nullNS, "notation1"); - assertNull("notationNull", notation); - + Document doc = load("staffNS", false); + DocumentType docType = doc.getDoctype(); + NamedNodeMap entities = docType.getEntities(); + NamedNodeMap notations = docType.getNotations(); + Entity entity = (Entity) entities.getNamedItemNS(nullNS, "ent1"); + assertNull(entity, "entityNull"); + Notation notation = (Notation) notations.getNamedItemNS(nullNS, "notation1"); + assertNull(notation, "notationNull"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns02.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns02.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns02.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns02.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; @@ -40,21 +40,14 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapgetnameditemns02 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - NodeList elementList; - String attrName; - doc = load("staffNS", false); - elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); - element = elementList.item(1); - attributes = element.getAttributes(); - attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic"); - attrName = attribute.getNodeName(); - assertEquals("namednodemapgetnameditemns02", "emp:domestic", attrName); - + void testRun() throws Throwable { + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + Node element = elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + Attr attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic"); + String attrName = attribute.getNodeName(); + assertEquals("emp:domestic", attrName, "namednodemapgetnameditemns02"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns03.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns03.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns03.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns03.java Sun Feb 6 01:51:55 2022 @@ -22,10 +22,13 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; -import org.w3c.dom.*; +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.NamedNodeMap; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -39,26 +42,18 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapgetnameditemns03 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - Attr newAttr1; - Attr newAttr2; - Attr newAttribute; + void testRun() throws Throwable { String attrName; - doc = load("staffNS", false); - element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); - newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); - newAttribute = ((Element) /*Node */element).setAttributeNodeNS(newAttr1); - newAttr2 = doc.createAttributeNS("http://www.w3.org/DOM/L2", "L2:att"); - newAttribute = ((Element) /*Node */element).setAttributeNodeNS(newAttr2); - attributes = element.getAttributes(); - attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L2", "att"); + Document doc = load("staffNS", false); + Element element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); + Attr newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); + element.setAttributeNodeNS(newAttr1); + Attr newAttr2 = doc.createAttributeNS("http://www.w3.org/DOM/L2", "L2:att"); + element.setAttributeNodeNS(newAttr2); + NamedNodeMap attributes = element.getAttributes(); + Attr attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L2", "att"); attrName = attribute.getNodeName(); - assertEquals("namednodemapgetnameditemns03", "L2:att", attrName); - + assertEquals("L2:att", attrName, "namednodemapgetnameditemns03"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns04.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns04.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns04.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns04.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; @@ -41,25 +41,16 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapgetnameditemns04 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Element element; - Attr attribute; - Attr newAttr1; - Attr newAttribute; - NodeList elementList; - String attrName; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("*", "address"); - element = (Element) elementList.item(1); - newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "street"); - newAttribute = element.setAttributeNodeNS(newAttr1); - attributes = element.getAttributes(); - attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "street"); - attrName = attribute.getNodeName(); - assertEquals("namednodemapgetnameditemns04", "street", attrName); - + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("*", "address"); + Element element = (Element) elementList.item(1); + Attr newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "street"); + element.setAttributeNodeNS(newAttr1); + NamedNodeMap attributes = element.getAttributes(); + Attr attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "street"); + String attrName = attribute.getNodeName(); + assertEquals("street", attrName, "namednodemapgetnameditemns04"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns05.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns05.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns05.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns05.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.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -40,19 +40,13 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapgetnameditemns05 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - NodeList elementList; - doc = load("staffNS", false); - elementList = doc.getElementsByTagNameNS("*", "address"); - element = elementList.item(1); - attributes = element.getAttributes(); - attribute = (Attr) attributes.getNamedItemNS("*", "street"); - assertNull("namednodemapgetnameditemns05", attribute); - + void testRun() throws Throwable { + Document doc = load("staffNS", false); + NodeList elementList = doc.getElementsByTagNameNS("*", "address"); + Node element = elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + Attr attribute = (Attr) attributes.getNamedItemNS("*", "street"); + assertNull(attribute, "namednodemapgetnameditemns05"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns06.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns06.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns06.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapgetnameditemns06.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; @@ -40,30 +40,20 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapgetnameditemns06 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributesMap1; - NamedNodeMap attributesMap2; - Element element; - Attr attribute; - Attr newAttr1; - Attr newAttribute; - NodeList elementList; - String attrName; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("*", "address"); - element = (Element) elementList.item(1); - attributesMap1 = element.getAttributes(); - attributesMap2 = element.getAttributes(); - newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "street"); - newAttribute = element.setAttributeNodeNS(newAttr1); - attribute = (Attr) attributesMap1.getNamedItemNS("http://www.w3.org/DOM/L1", "street"); - attrName = attribute.getNodeName(); - assertEquals("namednodemapgetnameditemnsMap106", "street", attrName); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("*", "address"); + Element element = (Element) elementList.item(1); + NamedNodeMap attributesMap1 = element.getAttributes(); + NamedNodeMap attributesMap2 = element.getAttributes(); + Attr newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "street"); + Attr newAttribute = element.setAttributeNodeNS(newAttr1); + Attr attribute = (Attr) attributesMap1.getNamedItemNS("http://www.w3.org/DOM/L1", "street"); + String attrName = attribute.getNodeName(); + assertEquals("street", attrName, "namednodemapgetnameditemnsMap106"); attribute = (Attr) attributesMap2.getNamedItemNS("http://www.w3.org/DOM/L1", "street"); attrName = attribute.getNodeName(); - assertEquals("namednodemapgetnameditemnsMap206", "street", attrName); - + assertEquals("street", attrName, "namednodemapgetnameditemnsMap206"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns01.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns01.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns01.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns01.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.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -38,20 +38,14 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapremovenameditemns01 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - NodeList elementList; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); - element = elementList.item(1); - attributes = element.getAttributes(); - attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + Node element = elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + Attr attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic"); - assertNull("namednodemapremovenameditemns01", attribute); - + assertNull(attribute, "namednodemapremovenameditemns01"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns02.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.load; @@ -45,26 +45,19 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapremovenameditemns02 { @Test - @Ignore + @Disabled public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - NodeList elementList; - String attrValue; String nullNS = null; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); - element = elementList.item(1); - attributes = element.getAttributes(); - attribute = (Attr) attributes.removeNamedItemNS(nullNS, "defaultAttr"); + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); + Node element = elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + Attr attribute = (Attr) attributes.removeNamedItemNS(nullNS, "defaultAttr"); attribute = (Attr) attributes.getNamedItemNS(nullNS, "defaultAttr"); - attrValue = attribute.getNodeValue(); - assertNotNull("namednodemapremovenameditemns02", attribute); - assertEquals("namednodemapremovenameditemns02_attrValue", "defaultVal", attrValue); - + String attrValue = attribute.getNodeValue(); + assertNotNull(attribute, "namednodemapremovenameditemns02"); + assertEquals("defaultVal", attrValue, "namednodemapremovenameditemns02_attrValue"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns03.java Sun Feb 6 01:51:55 2022 @@ -22,10 +22,13 @@ See W3C License http://www.w3.org/Consor package org.w3c.domts.level2.core; -import org.junit.Test; -import org.w3c.dom.*; +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.NamedNodeMap; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.w3c.domts.DOMTest.load; @@ -39,27 +42,18 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapremovenameditemns03 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - Attr newAttribute; - Attr attribute1; - Attr attribute2; - String nodeName; - doc = load("staffNS", true); - element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); - attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); - newAttribute = ((Element) /*Node */element).setAttributeNodeNS(attribute1); - attribute2 = doc.createAttributeNS("http://www.w3.org/DOM/L2", "L2:att"); - newAttribute = ((Element) /*Node */element).setAttributeNodeNS(attribute2); - attributes = element.getAttributes(); - attribute = (Attr) attributes.removeNamedItemNS("http://www.w3.org/DOM/L1", "att"); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + Element element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); + Attr attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); + element.setAttributeNodeNS(attribute1); + Attr attribute2 = doc.createAttributeNS("http://www.w3.org/DOM/L2", "L2:att"); + element.setAttributeNodeNS(attribute2); + NamedNodeMap attributes = element.getAttributes(); + Attr attribute = (Attr) attributes.removeNamedItemNS("http://www.w3.org/DOM/L1", "att"); attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L2", "att"); - nodeName = attribute.getNodeName(); - assertEquals("namednodemapremovenameditemns02", "L2:att", nodeName); - + String nodeName = attribute.getNodeName(); + assertEquals("L2:att", nodeName, "namednodemapremovenameditemns02"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns04.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.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -38,24 +38,18 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapremovenameditemns04 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - Attr attributeRemoved; + void testRun() throws Throwable { NodeList elementList; - doc = load("staffNS", true); + Document doc = load("staffNS", true); elementList = doc.getElementsByTagNameNS("*", "employee"); - element = elementList.item(0); - attributes = element.getAttributes(); - attributeRemoved = (Attr) attributes.removeNamedItemNS("http://www.w3.org/2000/xmlns/", "xmlns"); - attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/2000/xmlns/", "xmlns"); - assertNull("namednodemapremovenameditemns04_1", attribute); + Node element = elementList.item(0); + NamedNodeMap attributes = element.getAttributes(); + Attr attributeRemoved = (Attr) attributes.removeNamedItemNS("http://www.w3.org/2000/xmlns/", "xmlns"); + Attr attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/2000/xmlns/", "xmlns"); + assertNull(attribute, "namednodemapremovenameditemns04_1"); attributeRemoved = (Attr) attributes.removeNamedItemNS("http://www.w3.org/2000/xmlns/", "dmstc"); attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/2000/xmlns/", "dmstc"); - assertNull("namednodemapremovenameditemns04_2", attribute); - + assertNull(attribute, "namednodemapremovenameditemns04_2"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns05.java Sun Feb 6 01:51:55 2022 @@ -22,11 +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.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; @@ -43,50 +47,20 @@ import static org.w3c.domts.DOMTest.load public class namednodemapremovenameditemns05 { @Test - @Ignore + @Disabled public void testRun() throws Throwable { - Document doc; - DocumentType docType; - NamedNodeMap entities; - NamedNodeMap notations; - Node removedNode; String nullNS = null; - doc = load("staffNS", true); - docType = doc.getDoctype(); - entities = docType.getEntities(); - notations = docType.getNotations(); - - try { - removedNode = entities.removeNamedItemNS(nullNS, "ent1"); - fail("entity_throw_DOMException"); - - } catch (DOMException ex) { - switch (ex.code) { - case 8: - break; - case 7: - break; - default: - throw ex; - } - } - - try { - removedNode = notations.removeNamedItemNS(nullNS, "notation1"); - fail("notation_throw_DOMException"); - - } catch (DOMException ex) { - switch (ex.code) { - case 8: - break; - case 7: - break; - default: - throw ex; - } - } + Document doc = load("staffNS", true); + DocumentType docType = doc.getDoctype(); + NamedNodeMap entities = docType.getEntities(); + NamedNodeMap notations = docType.getNotations(); + DOMException ex1 = assertThrows(DOMException.class, () -> entities.removeNamedItemNS(nullNS, "ent1")); + assertTrue(ex1.code == 8 || ex1.code == 7, "entity_throw_DOMException"); + + DOMException ex2 = assertThrows(DOMException.class, () -> notations.removeNamedItemNS(nullNS, "notation1")); + assertTrue(ex1.code == 8 || ex1.code == 7, "notation_throw_DOMException"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns06.java Sun Feb 6 01:51:55 2022 @@ -22,10 +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.*; -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; @@ -40,27 +41,14 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapremovenameditemns06 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - NodeList elementList; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); - element = elementList.item(1); - attributes = element.getAttributes(); - - { - boolean success = false; - try { - attribute = (Attr) attributes.removeNamedItemNS("http://www.Nist.gov", "domestic"); - } catch (DOMException ex) { - success = (ex.code == DOMException.NOT_FOUND_ERR); - } - assertTrue("namednodemapremovenameditemns06", success); - } + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); + Node element = elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + DOMException ex = assertThrows(DOMException.class, () -> attributes.removeNamedItemNS("http://www.Nist.gov", "domestic")); + assertEquals(DOMException.NOT_FOUND_ERR, ex.code, "namednodemapremovenameditemns06"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns07.java Sun Feb 6 01:51:55 2022 @@ -22,10 +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.*; -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; @@ -40,27 +41,14 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapremovenameditemns07 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - NodeList elementList; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); - element = elementList.item(1); - attributes = element.getAttributes(); - - { - boolean success = false; - try { - attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); - } catch (DOMException ex) { - success = (ex.code == DOMException.NOT_FOUND_ERR); - } - assertTrue("namednodemapremovenameditemns07", success); - } + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee"); + Node element = elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + DOMException ex = assertThrows(DOMException.class, () -> attributes.removeNamedItemNS("http://www.nist.gov", "domestic")); + assertEquals(DOMException.NOT_FOUND_ERR, ex.code, "namednodemapremovenameditemns07"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns08.java Sun Feb 6 01:51:55 2022 @@ -22,10 +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.*; -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; @@ -42,28 +43,15 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapremovenameditemns08 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Element element; - Attr attribute; - NodeList elementList; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); - element = (Element) elementList.item(1); - attributes = element.getAttributes(); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + Element element = (Element) elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); element.removeAttributeNS("http://www.nist.gov", "domestic"); - { - boolean success = false; - try { - attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); - } catch (DOMException ex) { - success = (ex.code == DOMException.NOT_FOUND_ERR); - } - assertTrue("namednodemapremovenameditemns08", success); - } - + DOMException ex = assertThrows(DOMException.class, () -> attributes.removeNamedItemNS("http://www.nist.gov", "domestic")); + assertEquals(DOMException.NOT_FOUND_ERR, ex.code, "namednodemapremovenameditemns08"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapremovenameditemns09.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.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.w3c.domts.DOMTest.load; @@ -40,22 +40,15 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapremovenameditemns09 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - NamedNodeMap newAttributes; - Element element; - Attr attribute; - NodeList elementList; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); - element = (Element) elementList.item(1); - attributes = element.getAttributes(); - attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); - newAttributes = element.getAttributes(); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + Element element = (Element) elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + Attr attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); + NamedNodeMap newAttributes = element.getAttributes(); attribute = (Attr) newAttributes.getNamedItemNS("http://www.nist.gov", "domestic"); - assertNull("namednodemapremovenameditemns09", attribute); - + assertNull(attribute, "namednodemapremovenameditemns09"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns01.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; @@ -41,25 +41,16 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapsetnameditemns01 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Node element; - Attr attribute; - Attr newAttribute; - Attr newAttr1; - NodeList elementList; - String attrName; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); - element = elementList.item(0); - attributes = element.getAttributes(); - newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "streets"); - newAttribute = ((Element) /*Node */element).setAttributeNodeNS(newAttr1); - attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "streets"); - attrName = attribute.getNodeName(); - assertEquals("namednodemapsetnameditemns01", "streets", attrName); - + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); + Node element = elementList.item(0); + NamedNodeMap attributes = element.getAttributes(); + Attr newAttr1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "streets"); + Attr newAttribute = ((Element) /*Node */element).setAttributeNodeNS(newAttr1); + Attr attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "streets"); + String attrName = attribute.getNodeName(); + assertEquals("streets", attrName, "namednodemapsetnameditemns01"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns02.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; @@ -41,23 +41,15 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapsetnameditemns02 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - Element element; - Attr attribute; - Attr attribute1; - Node newNode; - String attrName; - doc = load("staffNS", true); - element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); - attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); - attributes = element.getAttributes(); - newNode = attributes.setNamedItemNS(attribute1); - attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "att"); - attrName = attribute.getNodeName(); - assertEquals("namednodemapsetnameditemns02", "L1:att", attrName); - + void testRun() throws Throwable { + Document doc = load("staffNS", true); + Element element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); + Attr attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); + NamedNodeMap attributes = element.getAttributes(); + Node newNode = attributes.setNamedItemNS(attribute1); + Attr attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "att"); + String attrName = attribute.getNodeName(); + assertEquals("L1:att", attrName, "namednodemapsetnameditemns02"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns03.java Sun Feb 6 01:51:55 2022 @@ -22,10 +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.*; -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; @@ -43,39 +44,21 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapsetnameditemns03 { @Test - public void testRun() throws Throwable { - Document doc; - Document docAlt; - NamedNodeMap attributes; - NamedNodeMap attributesAlt; - NodeList elementList; - NodeList elementListAlt; - Element element; - Element elementAlt; - Attr attr; - Node newNode; + void testRun() throws Throwable { String nullNS = null; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("*", "address"); - element = (Element) elementList.item(1); - attributes = element.getAttributes(); - docAlt = load("staffNS", true); - elementListAlt = docAlt.getElementsByTagNameNS("*", "address"); - elementAlt = (Element) elementListAlt.item(1); - attributesAlt = elementAlt.getAttributes(); - attr = (Attr) attributesAlt.getNamedItemNS(nullNS, "street"); - - { - boolean success = false; - try { - newNode = attributes.setNamedItemNS(attr); - } catch (DOMException ex) { - success = (ex.code == DOMException.WRONG_DOCUMENT_ERR); - } - assertTrue("namednodemapsetnameditemns03", success); - } + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("*", "address"); + Element element = (Element) elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + Document docAlt = load("staffNS", true); + NodeList elementListAlt = docAlt.getElementsByTagNameNS("*", "address"); + Element elementAlt = (Element) elementListAlt.item(1); + NamedNodeMap attributesAlt = elementAlt.getAttributes(); + Attr attr = (Attr) attributesAlt.getNamedItemNS(nullNS, "street"); + DOMException ex = assertThrows(DOMException.class, () -> attributes.setNamedItemNS(attr)); + assertEquals(DOMException.WRONG_DOCUMENT_ERR, ex.code, "namednodemapsetnameditemns03"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns04.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; @@ -33,7 +33,7 @@ import static org.w3c.domts.DOMTest.load * The method setNamedItemNS adds a node using its namespaceURI and localName and * raises a WRONG_DOCUMENT_ERR if arg was created from a different document than the * one that created this map. - * Retreieve the second element whose local name is address and its attribute into a named node map. + * Retrieve the second element whose local name is address and its attribute into a named node map. * Create a new document and a new attribute node in it. Call the setNamedItemNS using the first * namedNodeMap and the new attribute node attribute of the new document. This should * raise a WRONG_DOCUMENT_ERR. @@ -43,39 +43,27 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapsetnameditemns04 { @Test - public void testRun() throws Throwable { - Document doc; - DOMImplementation domImpl; - Document docAlt; + void testRun() throws Throwable { DocumentType docType = null; - - NamedNodeMap attributes; - NodeList elementList; - Element element; - Attr attrAlt; - Node newNode; - // String nullNS = null; String nullNS = ""; - - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("*", "address"); - element = (Element) elementList.item(1); - attributes = element.getAttributes(); - domImpl = doc.getImplementation(); - docAlt = domImpl.createDocument(nullNS, "newDoc", docType); - attrAlt = docAlt.createAttributeNS(nullNS, "street"); - - { - boolean success = false; - try { - newNode = attributes.setNamedItemNS(attrAlt); - } catch (DOMException ex) { - assertEquals(ex.code, DOMException.WRONG_DOCUMENT_ERR); - } - + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("*", "address"); + Element element = (Element) elementList.item(1); + NamedNodeMap attributes = element.getAttributes(); + DOMImplementation domImpl = doc.getImplementation(); + Document docAlt = domImpl.createDocument(nullNS, "newDoc", docType); + Attr attrAlt = docAlt.createAttributeNS(nullNS, "street"); + + // original implementation (see below) is bugged, but fits to our implementation + // DOMException ex = assertThrows(DOMException.class, () -> attributes.setNamedItemNS(attrAlt)); + // assertEquals(DOMException.WRONG_DOCUMENT_ERR, ex.code); + + try { + attributes.setNamedItemNS(attrAlt); + } catch (DOMException ex) { + assertEquals(ex.code, DOMException.WRONG_DOCUMENT_ERR); } - } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns05.java Sun Feb 6 01:51:55 2022 @@ -22,11 +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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.w3c.domts.DOMTest.load; @@ -42,44 +43,22 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapsetnameditemns05 { @Test - @Ignore + @Disabled public void testRun() throws Throwable { - Document doc; - DocumentType docType; - NamedNodeMap entities; - NamedNodeMap notations; - Entity entity; - Notation notation; - Node newNode; String nullNS = null; - doc = load("staffNS", true); - docType = doc.getDoctype(); - entities = docType.getEntities(); - notations = docType.getNotations(); - entity = (Entity) entities.getNamedItem("ent1"); - notation = (Notation) notations.getNamedItem("notation1"); - - { - boolean success = false; - try { - newNode = entities.setNamedItemNS(entity); - } catch (DOMException ex) { - success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); - } - assertTrue("namednodemapsetnameditemns05_entities", success); - } - - { - boolean success = false; - try { - newNode = notations.setNamedItemNS(notation); - } catch (DOMException ex) { - success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); - } - assertTrue("namednodemapsetnameditemns05_notations", success); - } + Document doc = load("staffNS", true); + DocumentType docType = doc.getDoctype(); + NamedNodeMap entities = docType.getEntities(); + NamedNodeMap notations = docType.getNotations(); + Entity entity = (Entity) entities.getNamedItem("ent1"); + Notation notation = (Notation) notations.getNamedItem("notation1"); + DOMException ex1 = assertThrows(DOMException.class, () -> entities.setNamedItemNS(entity)); + assertEquals(DOMException.NO_MODIFICATION_ALLOWED_ERR, ex1.code, "namednodemapsetnameditemns05_entities"); + + DOMException ex2 = assertThrows(DOMException.class, () -> entities.setNamedItemNS(notation)); + assertEquals(DOMException.NO_MODIFICATION_ALLOWED_ERR, ex2.code, "namednodemapsetnameditemns05_notations"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns06.java Sun Feb 6 01:51:55 2022 @@ -22,10 +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.*; -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; @@ -40,31 +41,17 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapsetnameditemns06 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - NodeList elementList; - Element element; - Attr attr; - Node newNode; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("*", "address"); - element = (Element) elementList.item(0); - attributes = element.getAttributes(); - attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("*", "address"); + Element element = (Element) elementList.item(0); + NamedNodeMap attributes = element.getAttributes(); + Attr attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); element = (Element) elementList.item(1); - attributes = element.getAttributes(); - - { - boolean success = false; - try { - newNode = attributes.setNamedItemNS(attr); - } catch (DOMException ex) { - success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); - } - assertTrue("namednodemapsetnameditemns06", success); - } + NamedNodeMap attributes2 = element.getAttributes(); + DOMException ex = assertThrows(DOMException.class, () -> attributes2.setNamedItemNS(attr)); + assertEquals(DOMException.INUSE_ATTRIBUTE_ERR, ex.code, "namednodemapsetnameditemns06"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns07.java Sun Feb 6 01:51:55 2022 @@ -22,10 +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.*; -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; @@ -45,31 +46,17 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapsetnameditemns07 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - NodeList elementList; - Element element; - Attr attr; - Node newNode; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("*", "address"); - element = (Element) elementList.item(0); - attributes = element.getAttributes(); - attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("*", "address"); + Element element = (Element) elementList.item(0); + NamedNodeMap attributes = element.getAttributes(); + Attr attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); element = (Element) elementList.item(1); - attributes = element.getAttributes(); - - { - boolean success = false; - try { - newNode = attributes.setNamedItemNS(attr); - } catch (DOMException ex) { - success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); - } - assertTrue("namednodemapsetnameditemns07", success); - } + NamedNodeMap attributes2 = element.getAttributes(); + DOMException ex = assertThrows(DOMException.class, () -> attributes2.setNamedItemNS(attr)); + assertEquals(DOMException.INUSE_ATTRIBUTE_ERR, ex.code, "namednodemapsetnameditemns07"); } /** Modified: xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java?rev=1897795&r1=1897794&r2=1897795&view=diff ============================================================================== --- xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java (original) +++ xmlbeans/trunk/src/test/java/org/w3c/domts/level2/core/namednodemapsetnameditemns08.java Sun Feb 6 01:51:55 2022 @@ -22,10 +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.*; -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; @@ -42,31 +43,17 @@ import static org.w3c.domts.DOMTest.load */ public class namednodemapsetnameditemns08 { @Test - public void testRun() throws Throwable { - Document doc; - NamedNodeMap attributes; - NodeList elementList; - Element element; - Attr attr; - Node newNode; - doc = load("staffNS", true); - elementList = doc.getElementsByTagNameNS("*", "address"); - element = (Element) elementList.item(0); - attributes = element.getAttributes(); - attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); + void testRun() throws Throwable { + Document doc = load("staffNS", true); + NodeList elementList = doc.getElementsByTagNameNS("*", "address"); + Element element = (Element) elementList.item(0); + NamedNodeMap attributes = element.getAttributes(); + Attr attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); element = (Element) elementList.item(1); - attributes = element.getAttributes(); - - { - boolean success = false; - try { - newNode = attributes.setNamedItemNS(attr); - } catch (DOMException ex) { - success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); - } - assertTrue("namednodemapsetnameditemns08", success); - } + NamedNodeMap attributes2 = element.getAttributes(); + DOMException ex = assertThrows(DOMException.class, () -> attributes2.setNamedItemNS(attr)); + assertEquals(DOMException.INUSE_ATTRIBUTE_ERR, ex.code, "namednodemapsetnameditemns08"); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
