- From: Freek de Bruijn <freek@x-hive.com>
- Date: Tue, 21 Aug 2001 16:47:13 +0200
- To: <www-dom-ts@w3.org>
- Message-ID: <41D11F414A26E942912B7E7696DC8E220B6F1B@JAKARTA.xhive.archipel>
Would it be a good idea to combine multiple tests into one class, instead of using a separate class for each test? This would reduce the huge number of classes that are generated at the moment, making the test suite more manageable and improving performance as well. The original NIST test suite has 15 classes (one for each interface), which is a lot easier than the 250+ classes we have now. In tests characterdataappenddatanomodificationallowederr.xml, characterdatadeletedatanomodificationallowederr.xml, characterdatainsertdatanomodificationallowederr.xml, and characterdatareplacedatanomodificationallowederr.xml the tagname in the following statement should probably be "gender": <getElementsByTagName interface="Document" obj="doc" tagname=""geneder"" var="genderList"/> For tests characterdataappenddatanomodificationallowederr.xml, characterdatadeletedatanomodificationallowederr.xml, characterdatainsertdatanomodificationallowederr.xml, characterdatareplacedatanomodificationallowederr.xml, and characterdatasetdatanomodificationallowederr.xml the comment tells that the third gender element should contain an entity reference, but this is not the case in the older version of the staff.xml document. In documentcreateentityreferenceknown.xml, the type of newEntRefNode should probably be EntityReference (instead of Element): <var name="newEntRefNode" type="Element"/> Several tests seem to test equivalence of two lists where one list contains a String and the other contains an Integer. Some tests also try to assert null values of nodes with a String value of "null" in a list, maybe it's better to use assertNull. Since I don't have access to the cvs server (but who has ;-), could somebody fix these issues? - Test characterdatadeletedatagetlengthanddata.xml (fixed String/Integer, removed lists): <var name="doc" type="Document"/> <var name="elementList" type="NodeList"/> <var name="nameNode" type="Node"/> <var name="child" type="CharacterData"/> <var name="childData" type="DOMString"/> <var name="childLength" type="int"/> <load var="doc" href="staff.xml" willBeModified="true"/> <getElementsByTagName interface="Document" obj="doc" tagname=""address"" var="elementList"/> <item interface="NodeList" obj="elementList" index="0" var="nameNode"/> <firstChild obj="nameNode" var="child"/> <deleteData obj="child" offset="30" count="5"/> <data interface="CharacterData" obj="child" var="childData"/> <assertEquals actual="childData" expected=""1230 North Ave. Dallas, Texas "" id="characterdataDeleteDataGetLengthAndDataAssert1" ignoreCase="false"/> <length interface="CharacterData" obj="child" var="childLength"/> <assertEquals actual="childLength" expected="30" id="characterdataDeleteDataGetLengthAndDataAssert2"/> - Test documentcreateattribute.xml (fixed String/Integer, removed lists): <var name="doc" type="Document"/> <var name="newAttrNode" type="Attr"/> <var name="attrValue" type="DOMString"/> <var name="attrName" type="DOMString"/> <var name="attrType" type="int"/> <load var="doc" href="staff.xml" willBeModified="false"/> <createAttribute obj="doc" var="newAttrNode" name=""district""/> <nodeValue obj="newAttrNode" var="attrValue"/> <assertEquals actual="attrValue" expected="""" id="nodeValue" ignoreCase="false"/> <nodeName obj="newAttrNode" var="attrName"/> <assertEquals actual="attrName" expected=""district"" id="nodeName" ignoreCase="false"/> <nodeType obj="newAttrNode" var="attrType"/> <assertEquals actual="attrType" expected="2" id="nodeType"/> - Test documentcreatecomment.xml (fixed String/Integer, removed lists): <var name="doc" type="Document"/> <var name="newCommentNode" type="Comment"/> <var name="newCommentValue" type="DOMString"/> <var name="newCommentName" type="DOMString"/> <var name="newCommentType" type="int"/> <load var="doc" href="staff.xml" willBeModified="false"/> <createComment obj="doc" var="newCommentNode" data=""This is a new Comment node""/> <nodeValue obj="newCommentNode" var="newCommentValue"/> <assertEquals actual="newCommentValue" expected=""This is a new Comment node"" id="nodeValue" ignoreCase="false"/> <nodeName obj="newCommentNode" var="newCommentName"/> <assertEquals actual="newCommentName" expected=""#comment"" id="nodeName" ignoreCase="false"/> <nodeType obj="newCommentNode" var="newCommentType"/> <assertEquals actual="newCommentType" expected="8" id="nodeType"/> - Test documentcreatedocumentfragment (fixed String/Integer, assertNull for nodeValue, removed lists): <var name="doc" type="Document"/> <var name="newDocFragment" type="DocumentFragment"/> <var name="children" type="NodeList"/> <var name="length" type="int"/> <var name="newDocFragmentName" type="DOMString"/> <var name="newDocFragmentType" type="int"/> <var name="newDocFragmentValue" type="DOMString"/> <load var="doc" href="staff.xml" willBeModified="false"/> <createDocumentFragment obj="doc" var="newDocFragment"/> <childNodes obj="newDocFragment" var="children"/> <length interface="NodeList" obj="children" var="length"/> <assertEquals actual="length" expected="0" id="lengthZero"/> <nodeName obj="newDocFragment" var="newDocFragmentName"/> <assertEquals actual="newDocFragmentName" expected=""#document-fragment"" id="nodeName" ignoreCase="false"/> <nodeType obj="newDocFragment" var="newDocFragmentType"/> <assertEquals actual="newDocFragmentType" expected="11" id="nodeType"/> <nodeValue obj="newDocFragment" var="newDocFragmentValue"/> <assertNull actual="newDocFragmentValue" id="nodeValue"/> - Test documentcreateelement (fixed String/Integer, assertNull for nodeValue, removed lists): <var name="doc" type="Document"/> <var name="newElement" type="Element"/> <var name="newElementName" type="DOMString"/> <var name="newElementType" type="int"/> <var name="newElementValue" type="DOMString"/> <load var="doc" href="staff.xml" willBeModified="false"/> <createElement obj="doc" var="newElement" tagName=""address""/> <nodeName obj="newElement" var="newElementName"/> <assertEquals actual="newElementName" expected=""address"" id="nodeName" ignoreCase="false"/> <nodeType obj="newElement" var="newElementType"/> <assertEquals actual="newElementType" expected="1" id="nodeType"/> <nodeValue obj="newElement" var="newElementValue"/> <assertNull actual="newElementValue" id="nodeValue"/> - Test documentcreateentityreference (fixed String/Integer, assertNull for nodeValue, removed lists): <var name="doc" type="Document"/> <var name="newEntRefNode" type="EntityReference"/> <var name="entRefValue" type="DOMString"/> <var name="entRefName" type="DOMString"/> <var name="entRefType" type="int"/> <load var="doc" href="staff.xml" willBeModified="false"/> <createEntityReference obj="doc" var="newEntRefNode" name=""ent1""/> <nodeName obj="newEntRefNode" var="entRefName"/> <assertEquals actual="entRefName" expected=""ent1"" id="nodeName" ignoreCase="false"/> <nodeType obj="newEntRefNode" var="entRefType"/> <assertEquals actual="entRefType" expected="5" id="nodeType"/> <nodeValue obj="newEntRefNode" var="entRefValue"/> <assertNull actual="entRefValue" id="nodeValue"/> - Test documentcreateprocessinginstruction (fixed String/Integer, removed lists): <var name="doc" type="Document"/> <var name="newPINode" type="ProcessingInstruction"/> <var name="piValue" type="DOMString"/> <var name="piName" type="DOMString"/> <var name="piType" type="int"/> <load var="doc" href="staff.xml" willBeModified="false"/> <createProcessingInstruction obj="doc" var="newPINode" target=""XML"" data=""This is a new PI node""/> <nodeValue obj="newPINode" var="piValue"/> <assertEquals actual="piValue" expected=""This is a new PI node"" id="nodeValue" ignoreCase="false"/> <nodeName obj="newPINode" var="piName"/> <assertEquals actual="piName" expected=""XML"" id="nodeValue" ignoreCase="false"/> <nodeType obj="newPINode" var="piType"/> <assertEquals actual="piType" expected="7" id="nodeType"/> - Test documentcreatetextnode (fixed String/Integer, removed lists): <var name="doc" type="Document"/> <var name="newTextNode" type="Text"/> <var name="newTextValue" type="DOMString"/> <var name="newTextName" type="DOMString"/> <var name="newTextType" type="int"/> <load var="doc" href="staff.xml" willBeModified="false"/> <createTextNode obj="doc" var="newTextNode" data=""This is a new Text node""/> <nodeValue obj="newTextNode" var="newTextValue"/> <assertEquals actual="newTextValue" expected=""This is a new Text node"" id="nodeValue" ignoreCase="false"/> <nodeName obj="newTextNode" var="newTextName"/> <assertEquals actual="newTextName" expected=""#text"" id="nodeName" ignoreCase="false"/> <nodeType obj="newTextNode" var="newTextType"/> <assertEquals actual="newTextType" expected="3" id="nodeType"/> --- Freek
Received on Tuesday, 21 August 2001 10:47:23 UTC