From ff61aec7fb571c8c3bb514edb9c4d3a242bb5068 Mon Sep 17 00:00:00 2001 From: jez Date: Thu, 9 Dec 2010 11:34:15 +0000 Subject: [PATCH] Added DOM Level 1 Core conformance tests, derived from W3C DOM Conf tests --- .../DOM/conformance/level1/core/alltests.hpp | 1085 +++++++++++++++++ .../core/attrcreatedocumentfragment.hpp | 108 ++ .../level1/core/attrcreatetextnode.hpp | 109 ++ .../level1/core/attrcreatetextnode2.hpp | 108 ++ .../level1/core/attrdefaultvalue.hpp | 110 ++ .../level1/core/attreffectivevalue.hpp | 102 ++ .../level1/core/attrentityreplacement.hpp | 107 ++ .../DOM/conformance/level1/core/attrname.hpp | 105 ++ .../level1/core/attrnextsiblingnull.hpp | 102 ++ .../level1/core/attrnotspecifiedvalue.hpp | 107 ++ .../level1/core/attrparentnodenull.hpp | 102 ++ .../level1/core/attrprevioussiblingnull.hpp | 102 ++ .../level1/core/attrremovechild1.hpp | 110 ++ .../level1/core/attrreplacechild1.hpp | 112 ++ .../attrsetvaluenomodificationallowederr.hpp | 138 +++ ...attrsetvaluenomodificationallowederrEE.hpp | 134 ++ .../level1/core/attrspecifiedvalue.hpp | 105 ++ .../level1/core/attrspecifiedvaluechanged.hpp | 107 ++ .../level1/core/attrspecifiedvalueremove.hpp | 112 ++ .../level1/core/cdatasectiongetdata.hpp | 104 ++ .../level1/core/cdatasectionnormalize.hpp | 109 ++ .../level1/core/characterdataappenddata.hpp | 108 ++ .../core/characterdataappenddatagetdata.hpp | 107 ++ ...dataappenddatanomodificationallowederr.hpp | 125 ++ ...taappenddatanomodificationallowederrEE.hpp | 112 ++ .../core/characterdatadeletedatabegining.hpp | 105 ++ .../core/characterdatadeletedataend.hpp | 107 ++ .../characterdatadeletedataexceedslength.hpp | 109 ++ ...haracterdatadeletedatagetlengthanddata.hpp | 113 ++ .../core/characterdatadeletedatamiddle.hpp | 107 ++ ...datadeletedatanomodificationallowederr.hpp | 125 ++ ...tadeletedatanomodificationallowederrEE.hpp | 112 ++ .../level1/core/characterdatagetdata.hpp | 101 ++ .../level1/core/characterdatagetlength.hpp | 103 ++ ...ataindexsizeerrdeletedatacountnegative.hpp | 112 ++ ...ataindexsizeerrdeletedataoffsetgreater.hpp | 115 ++ ...taindexsizeerrdeletedataoffsetnegative.hpp | 113 ++ ...ataindexsizeerrinsertdataoffsetgreater.hpp | 114 ++ ...taindexsizeerrinsertdataoffsetnegative.hpp | 112 ++ ...taindexsizeerrreplacedatacountnegative.hpp | 113 ++ ...taindexsizeerrreplacedataoffsetgreater.hpp | 115 ++ ...aindexsizeerrreplacedataoffsetnegative.hpp | 114 ++ ...dataindexsizeerrsubstringcountnegative.hpp | 113 ++ ...ataindexsizeerrsubstringnegativeoffset.hpp | 113 ++ ...dataindexsizeerrsubstringoffsetgreater.hpp | 115 ++ .../core/characterdatainsertdatabeginning.hpp | 105 ++ .../core/characterdatainsertdataend.hpp | 107 ++ .../core/characterdatainsertdatamiddle.hpp | 107 ++ ...datainsertdatanomodificationallowederr.hpp | 125 ++ ...tainsertdatanomodificationallowederrEE.hpp | 110 ++ .../core/characterdatareplacedatabegining.hpp | 105 ++ .../core/characterdatareplacedataend.hpp | 107 ++ ...acterdatareplacedataexceedslengthofarg.hpp | 108 ++ ...cterdatareplacedataexceedslengthofdata.hpp | 106 ++ .../core/characterdatareplacedatamiddle.hpp | 107 ++ ...atareplacedatanomodificationallowederr.hpp | 126 ++ ...areplacedatanomodificationallowederrEE.hpp | 112 ++ ...terdatasetdatanomodificationallowederr.hpp | 125 ++ ...rdatasetdatanomodificationallowederrEE.hpp | 110 ++ .../level1/core/characterdatasetnodevalue.hpp | 103 ++ .../characterdatasubstringexceedsvalue.hpp | 105 ++ .../core/characterdatasubstringvalue.hpp | 104 ++ .../level1/core/commentgetcomment.hpp | 113 ++ .../level1/core/documentcreateattribute.hpp | 105 ++ .../core/documentcreatecdatasection.hpp | 104 ++ .../level1/core/documentcreatecomment.hpp | 103 ++ .../core/documentcreatedocumentfragment.hpp | 107 ++ .../level1/core/documentcreateelement.hpp | 104 ++ .../documentcreateelementcasesensitive.hpp | 106 ++ .../core/documentcreateelementdefaultattr.hpp | 111 ++ .../core/documentcreateentityreference.hpp | 108 ++ .../documentcreateentityreferenceknown.hpp | 111 ++ .../documentcreateprocessinginstruction.hpp | 111 ++ .../level1/core/documentcreatetextnode.hpp | 103 ++ .../level1/core/documentgetdoctype.hpp | 109 ++ .../level1/core/documentgetdoctypenodtd.hpp | 93 ++ .../documentgetelementsbytagnamelength.hpp | 96 ++ ...ocumentgetelementsbytagnametotallength.hpp | 97 ++ .../documentgetelementsbytagnamevalue.hpp | 104 ++ .../level1/core/documentgetimplementation.hpp | 97 ++ .../level1/core/documentgetrootnode.hpp | 103 ++ ...validcharacterexceptioncreateattribute.hpp | 109 ++ ...invalidcharacterexceptioncreateelement.hpp | 109 ++ ...tinvalidcharacterexceptioncreateentref.hpp | 118 ++ ...invalidcharacterexceptioncreateentref1.hpp | 115 ++ ...umentinvalidcharacterexceptioncreatepi.hpp | 118 ++ ...mentinvalidcharacterexceptioncreatepi1.hpp | 115 ++ .../level1/core/documenttypegetdoctype.hpp | 104 ++ .../level1/core/documenttypegetentities.hpp | 131 ++ .../core/documenttypegetentitieslength.hpp | 104 ++ .../core/documenttypegetentitiestype.hpp | 106 ++ .../level1/core/documenttypegetnotations.hpp | 113 ++ .../core/documenttypegetnotationstype.hpp | 105 ++ .../domimplementationfeaturenoversion.hpp | 93 ++ .../core/domimplementationfeaturenull.hpp | 94 ++ .../core/domimplementationfeaturexml.hpp | 92 ++ .../level1/core/elementaddnewattribute.hpp | 102 ++ .../core/elementassociatedattribute.hpp | 105 ++ .../core/elementchangeattributevalue.hpp | 105 ++ .../level1/core/elementcreatenewattribute.hpp | 109 ++ .../level1/core/elementgetattributenode.hpp | 102 ++ .../core/elementgetattributenodenull.hpp | 101 ++ .../level1/core/elementgetelementempty.hpp | 108 ++ .../core/elementgetelementsbytagname.hpp | 97 ++ ...mentgetelementsbytagnameaccessnodelist.hpp | 107 ++ .../elementgetelementsbytagnamenomatch.hpp | 95 ++ ...lementgetelementsbytagnamespecialvalue.hpp | 117 ++ .../level1/core/elementgettagname.hpp | 103 ++ .../level1/core/elementinuseattributeerr.hpp | 123 ++ .../core/elementinvalidcharacterexception.hpp | 110 ++ .../level1/core/elementnormalize.hpp | 106 ++ .../level1/core/elementnotfounderr.hpp | 115 ++ .../level1/core/elementremoveattribute.hpp | 105 ++ .../elementremoveattributeaftercreate.hpp | 108 ++ .../core/elementremoveattributenode.hpp | 103 ++ ...eattributenodenomodificationallowederr.hpp | 133 ++ ...ttributenodenomodificationallowederrEE.hpp | 125 ++ ...emoveattributenomodificationallowederr.hpp | 128 ++ ...oveattributenomodificationallowederrEE.hpp | 118 ++ ...mentremoveattributerestoredefaultvalue.hpp | 105 ++ .../core/elementreplaceattributewithself.hpp | 100 ++ .../core/elementreplaceexistingattribute.hpp | 108 ++ ...elementreplaceexistingattributegevalue.hpp | 106 ++ .../core/elementretrieveallattributes.hpp | 103 ++ .../level1/core/elementretrieveattrvalue.hpp | 99 ++ .../level1/core/elementretrievetagname.hpp | 102 ++ ...tattributenodenomodificationallowederr.hpp | 127 ++ ...ttributenodenomodificationallowederrEE.hpp | 122 ++ .../core/elementsetattributenodenull.hpp | 105 ++ ...ntsetattributenomodificationallowederr.hpp | 117 ++ ...setattributenomodificationallowederrEE.hpp | 118 ++ .../level1/core/elementwrongdocumenterr.hpp | 121 ++ .../level1/core/entitygetentityname.hpp | 104 ++ .../level1/core/entitygetpublicid.hpp | 113 ++ .../level1/core/entitygetpublicidnull.hpp | 105 ++ .../level1/core/hc_attrappendchild1.hpp | 111 ++ .../level1/core/hc_attrappendchild2.hpp | 110 ++ .../level1/core/hc_attrappendchild3.hpp | 117 ++ .../level1/core/hc_attrappendchild4.hpp | 126 ++ .../level1/core/hc_attrappendchild5.hpp | 114 ++ .../level1/core/hc_attrappendchild6.hpp | 107 ++ .../level1/core/hc_attrchildnodes1.hpp | 106 ++ .../level1/core/hc_attrchildnodes2.hpp | 111 ++ .../level1/core/hc_attrclonenode1.hpp | 111 ++ .../core/hc_attrcreatedocumentfragment.hpp | 116 ++ .../level1/core/hc_attrcreatetextnode.hpp | 108 ++ .../level1/core/hc_attrcreatetextnode2.hpp | 108 ++ .../level1/core/hc_attreffectivevalue.hpp | 101 ++ .../level1/core/hc_attrfirstchild.hpp | 107 ++ .../level1/core/hc_attrgetvalue1.hpp | 100 ++ .../level1/core/hc_attrgetvalue2.hpp | 119 ++ .../level1/core/hc_attrhaschildnodes.hpp | 98 ++ .../level1/core/hc_attrinsertbefore1.hpp | 116 ++ .../level1/core/hc_attrinsertbefore2.hpp | 117 ++ .../level1/core/hc_attrinsertbefore3.hpp | 122 ++ .../level1/core/hc_attrinsertbefore4.hpp | 123 ++ .../level1/core/hc_attrinsertbefore5.hpp | 126 ++ .../level1/core/hc_attrinsertbefore6.hpp | 114 ++ .../level1/core/hc_attrinsertbefore7.hpp | 133 ++ .../level1/core/hc_attrlastchild.hpp | 107 ++ .../conformance/level1/core/hc_attrname.hpp | 105 ++ .../level1/core/hc_attrnextsiblingnull.hpp | 101 ++ .../level1/core/hc_attrnormalize.hpp | 113 ++ .../level1/core/hc_attrparentnodenull.hpp | 101 ++ .../core/hc_attrprevioussiblingnull.hpp | 101 ++ .../level1/core/hc_attrremovechild1.hpp | 110 ++ .../level1/core/hc_attrremovechild2.hpp | 109 ++ .../level1/core/hc_attrreplacechild1.hpp | 113 ++ .../level1/core/hc_attrreplacechild2.hpp | 119 ++ .../level1/core/hc_attrsetvalue1.hpp | 111 ++ .../level1/core/hc_attrsetvalue2.hpp | 114 ++ .../level1/core/hc_attrspecifiedvalue.hpp | 104 ++ .../core/hc_attrspecifiedvaluechanged.hpp | 106 ++ .../core/hc_characterdataappenddata.hpp | 107 ++ .../hc_characterdataappenddatagetdata.hpp | 106 ++ .../hc_characterdatadeletedatabegining.hpp | 104 ++ .../core/hc_characterdatadeletedataend.hpp | 106 ++ ...c_characterdatadeletedataexceedslength.hpp | 108 ++ ...haracterdatadeletedatagetlengthanddata.hpp | 114 ++ .../core/hc_characterdatadeletedatamiddle.hpp | 106 ++ .../level1/core/hc_characterdatagetdata.hpp | 100 ++ .../level1/core/hc_characterdatagetlength.hpp | 102 ++ ...ataindexsizeerrdeletedatacountnegative.hpp | 112 ++ ...ataindexsizeerrdeletedataoffsetgreater.hpp | 114 ++ ...taindexsizeerrdeletedataoffsetnegative.hpp | 112 ++ ...ataindexsizeerrinsertdataoffsetgreater.hpp | 113 ++ ...taindexsizeerrinsertdataoffsetnegative.hpp | 111 ++ ...taindexsizeerrreplacedatacountnegative.hpp | 113 ++ ...taindexsizeerrreplacedataoffsetgreater.hpp | 114 ++ ...aindexsizeerrreplacedataoffsetnegative.hpp | 113 ++ ...dataindexsizeerrsubstringcountnegative.hpp | 112 ++ ...ataindexsizeerrsubstringnegativeoffset.hpp | 112 ++ ...dataindexsizeerrsubstringoffsetgreater.hpp | 114 ++ .../hc_characterdatainsertdatabeginning.hpp | 104 ++ .../core/hc_characterdatainsertdataend.hpp | 106 ++ .../core/hc_characterdatainsertdatamiddle.hpp | 106 ++ .../hc_characterdatareplacedatabegining.hpp | 104 ++ .../core/hc_characterdatareplacedataend.hpp | 106 ++ ...acterdatareplacedataexceedslengthofarg.hpp | 107 ++ ...cterdatareplacedataexceedslengthofdata.hpp | 105 ++ .../hc_characterdatareplacedatamiddle.hpp | 106 ++ .../core/hc_characterdatasetnodevalue.hpp | 103 ++ .../hc_characterdatasubstringexceedsvalue.hpp | 104 ++ .../core/hc_characterdatasubstringvalue.hpp | 103 ++ .../level1/core/hc_commentgetcomment.hpp | 117 ++ .../core/hc_documentcreateattribute.hpp | 104 ++ .../level1/core/hc_documentcreatecomment.hpp | 102 ++ .../hc_documentcreatedocumentfragment.hpp | 106 ++ .../level1/core/hc_documentcreateelement.hpp | 103 ++ .../hc_documentcreateelementcasesensitive.hpp | 114 ++ .../level1/core/hc_documentcreatetextnode.hpp | 102 ++ .../level1/core/hc_documentgetdoctype.hpp | 113 ++ .../hc_documentgetelementsbytagnamelength.hpp | 95 ++ ...ocumentgetelementsbytagnametotallength.hpp | 197 +++ .../hc_documentgetelementsbytagnamevalue.hpp | 103 ++ .../core/hc_documentgetimplementation.hpp | 104 ++ .../level1/core/hc_documentgetrootnode.hpp | 99 ++ ...validcharacterexceptioncreateattribute.hpp | 108 ++ ...alidcharacterexceptioncreateattribute1.hpp | 101 ++ ...invalidcharacterexceptioncreateelement.hpp | 108 ++ ...nvalidcharacterexceptioncreateelement1.hpp | 101 ++ .../hc_domimplementationfeaturenoversion.hpp | 104 ++ .../core/hc_domimplementationfeaturenull.hpp | 106 ++ .../core/hc_domimplementationfeaturexml.hpp | 103 ++ .../level1/core/hc_elementaddnewattribute.hpp | 102 ++ .../core/hc_elementassociatedattribute.hpp | 102 ++ .../core/hc_elementchangeattributevalue.hpp | 104 ++ .../core/hc_elementcreatenewattribute.hpp | 109 ++ .../core/hc_elementgetattributenode.hpp | 98 ++ .../core/hc_elementgetattributenodenull.hpp | 100 ++ .../level1/core/hc_elementgetelementempty.hpp | 108 ++ .../core/hc_elementgetelementsbytagname.hpp | 96 ++ ...mentgetelementsbytagnameaccessnodelist.hpp | 119 ++ .../hc_elementgetelementsbytagnamenomatch.hpp | 94 ++ ...lementgetelementsbytagnamespecialvalue.hpp | 116 ++ .../level1/core/hc_elementgettagname.hpp | 99 ++ .../core/hc_elementinuseattributeerr.hpp | 115 ++ .../hc_elementinvalidcharacterexception.hpp | 108 ++ .../hc_elementinvalidcharacterexception1.hpp | 103 ++ .../level1/core/hc_elementnormalize.hpp | 108 ++ .../level1/core/hc_elementnormalize2.hpp | 110 ++ .../level1/core/hc_elementnotfounderr.hpp | 114 ++ .../level1/core/hc_elementremoveattribute.hpp | 98 ++ .../hc_elementremoveattributeaftercreate.hpp | 108 ++ .../core/hc_elementremoveattributenode.hpp | 103 ++ .../hc_elementreplaceattributewithself.hpp | 101 ++ .../hc_elementreplaceexistingattribute.hpp | 107 ++ ...elementreplaceexistingattributegevalue.hpp | 106 ++ .../core/hc_elementretrieveallattributes.hpp | 119 ++ .../core/hc_elementretrieveattrvalue.hpp | 98 ++ .../level1/core/hc_elementretrievetagname.hpp | 101 ++ .../core/hc_elementsetattributenodenull.hpp | 105 ++ .../core/hc_elementwrongdocumenterr.hpp | 119 ++ .../core/hc_entitiesremovenameditem1.hpp | 109 ++ .../level1/core/hc_entitiessetnameditem1.hpp | 117 ++ .../core/hc_namednodemapchildnoderange.hpp | 117 ++ .../core/hc_namednodemapgetnameditem.hpp | 104 ++ .../core/hc_namednodemapinuseattributeerr.hpp | 120 ++ .../core/hc_namednodemapnotfounderr.hpp | 114 ++ .../core/hc_namednodemapnumberofnodes.hpp | 103 ++ .../core/hc_namednodemapremovenameditem.hpp | 107 ++ .../core/hc_namednodemapreturnattrnode.hpp | 108 ++ .../core/hc_namednodemapreturnfirstitem.hpp | 125 ++ .../core/hc_namednodemapreturnlastitem.hpp | 127 ++ .../level1/core/hc_namednodemapreturnnull.hpp | 105 ++ .../core/hc_namednodemapsetnameditem.hpp | 114 ++ ...hc_namednodemapsetnameditemreturnvalue.hpp | 115 ++ .../hc_namednodemapsetnameditemthatexists.hpp | 117 ++ ...c_namednodemapsetnameditemwithnewvalue.hpp | 110 ++ .../core/hc_namednodemapwrongdocumenterr.hpp | 122 ++ .../level1/core/hc_nodeappendchild.hpp | 105 ++ .../core/hc_nodeappendchildchildexists.hpp | 136 +++ .../core/hc_nodeappendchilddocfragment.hpp | 136 +++ .../core/hc_nodeappendchildgetnodename.hpp | 106 ++ .../hc_nodeappendchildinvalidnodetype.hpp | 113 ++ ...hc_nodeappendchildnewchilddiffdocument.hpp | 118 ++ .../core/hc_nodeappendchildnodeancestor.hpp | 115 ++ .../core/hc_nodeattributenodeattribute.hpp | 102 ++ .../level1/core/hc_nodeattributenodename.hpp | 99 ++ .../level1/core/hc_nodeattributenodetype.hpp | 100 ++ .../level1/core/hc_nodeattributenodevalue.hpp | 101 ++ .../level1/core/hc_nodechildnodes.hpp | 125 ++ .../core/hc_nodechildnodesappendchild.hpp | 135 ++ .../level1/core/hc_nodechildnodesempty.hpp | 104 ++ .../core/hc_nodecloneattributescopied.hpp | 124 ++ .../core/hc_nodeclonefalsenocopytext.hpp | 105 ++ .../level1/core/hc_nodeclonegetparentnull.hpp | 101 ++ .../level1/core/hc_nodeclonenodefalse.hpp | 108 ++ .../level1/core/hc_nodeclonenodetrue.hpp | 124 ++ .../level1/core/hc_nodeclonetruecopytext.hpp | 104 ++ .../core/hc_nodecommentnodeattributes.hpp | 111 ++ .../level1/core/hc_nodecommentnodename.hpp | 111 ++ .../level1/core/hc_nodecommentnodetype.hpp | 110 ++ .../level1/core/hc_nodecommentnodevalue.hpp | 110 ++ .../core/hc_nodedocumentfragmentnodename.hpp | 97 ++ .../core/hc_nodedocumentfragmentnodetype.hpp | 97 ++ .../core/hc_nodedocumentfragmentnodevalue.hpp | 103 ++ .../core/hc_nodedocumentnodeattribute.hpp | 94 ++ .../level1/core/hc_nodedocumentnodename.hpp | 94 ++ .../level1/core/hc_nodedocumentnodetype.hpp | 93 ++ .../level1/core/hc_nodedocumentnodevalue.hpp | 94 ++ .../core/hc_nodeelementnodeattributes.hpp | 120 ++ .../level1/core/hc_nodeelementnodename.hpp | 101 ++ .../level1/core/hc_nodeelementnodetype.hpp | 95 ++ .../level1/core/hc_nodeelementnodevalue.hpp | 92 ++ .../level1/core/hc_nodegetfirstchild.hpp | 107 ++ .../level1/core/hc_nodegetfirstchildnull.hpp | 99 ++ .../level1/core/hc_nodegetlastchild.hpp | 100 ++ .../level1/core/hc_nodegetlastchildnull.hpp | 99 ++ .../level1/core/hc_nodegetnextsibling.hpp | 100 ++ .../level1/core/hc_nodegetnextsiblingnull.hpp | 100 ++ .../level1/core/hc_nodegetownerdocument.hpp | 104 ++ .../core/hc_nodegetownerdocumentnull.hpp | 93 ++ .../level1/core/hc_nodegetprevioussibling.hpp | 100 ++ .../core/hc_nodegetprevioussiblingnull.hpp | 100 ++ .../level1/core/hc_nodehaschildnodes.hpp | 98 ++ .../level1/core/hc_nodehaschildnodesfalse.hpp | 101 ++ .../level1/core/hc_nodeinsertbefore.hpp | 130 ++ .../core/hc_nodeinsertbeforedocfragment.hpp | 123 ++ .../hc_nodeinsertbeforeinvalidnodetype.hpp | 119 ++ ...c_nodeinsertbeforenewchilddiffdocument.hpp | 120 ++ .../hc_nodeinsertbeforenewchildexists.hpp | 130 ++ .../core/hc_nodeinsertbeforenodeancestor.hpp | 117 ++ .../core/hc_nodeinsertbeforenodename.hpp | 109 ++ ...hc_nodeinsertbeforerefchildnonexistent.hpp | 117 ++ .../core/hc_nodeinsertbeforerefchildnull.hpp | 112 ++ .../level1/core/hc_nodelistindexequalzero.hpp | 112 ++ .../level1/core/hc_nodelistindexgetlength.hpp | 107 ++ .../hc_nodelistindexgetlengthofemptylist.hpp | 104 ++ .../level1/core/hc_nodelistindexnotzero.hpp | 111 ++ .../core/hc_nodelistreturnfirstitem.hpp | 107 ++ .../level1/core/hc_nodelistreturnlastitem.hpp | 111 ++ .../level1/core/hc_nodelisttraverselist.hpp | 125 ++ .../level1/core/hc_nodeparentnode.hpp | 100 ++ .../level1/core/hc_nodeparentnodenull.hpp | 97 ++ .../level1/core/hc_noderemovechild.hpp | 105 ++ .../core/hc_noderemovechildgetnodename.hpp | 110 ++ .../level1/core/hc_noderemovechildnode.hpp | 134 ++ .../hc_noderemovechildoldchildnonexistent.hpp | 113 ++ .../level1/core/hc_nodereplacechild.hpp | 110 ++ .../hc_nodereplacechildinvalidnodetype.hpp | 119 ++ ...c_nodereplacechildnewchilddiffdocument.hpp | 120 ++ .../hc_nodereplacechildnewchildexists.hpp | 130 ++ .../core/hc_nodereplacechildnodeancestor.hpp | 117 ++ .../core/hc_nodereplacechildnodename.hpp | 110 ++ ...hc_nodereplacechildoldchildnonexistent.hpp | 115 ++ .../level1/core/hc_nodetextnodeattribute.hpp | 100 ++ .../level1/core/hc_nodetextnodename.hpp | 96 ++ .../level1/core/hc_nodetextnodetype.hpp | 100 ++ .../level1/core/hc_nodetextnodevalue.hpp | 101 ++ .../level1/core/hc_nodevalue01.hpp | 96 ++ .../level1/core/hc_nodevalue02.hpp | 96 ++ .../level1/core/hc_nodevalue03.hpp | 112 ++ .../level1/core/hc_nodevalue04.hpp | 103 ++ .../level1/core/hc_nodevalue05.hpp | 96 ++ .../level1/core/hc_nodevalue06.hpp | 94 ++ .../level1/core/hc_nodevalue07.hpp | 108 ++ .../level1/core/hc_nodevalue08.hpp | 108 ++ .../core/hc_notationsremovenameditem1.hpp | 109 ++ .../level1/core/hc_notationssetnameditem1.hpp | 117 ++ .../hc_textindexsizeerrnegativeoffset.hpp | 112 ++ .../hc_textindexsizeerroffsetoutofbounds.hpp | 114 ++ .../core/hc_textparseintolistofelements.hpp | 136 +++ .../level1/core/hc_textsplittextfour.hpp | 105 ++ .../level1/core/hc_textsplittextone.hpp | 108 ++ .../level1/core/hc_textsplittextthree.hpp | 107 ++ .../level1/core/hc_textsplittexttwo.hpp | 106 ++ .../level1/core/hc_textwithnomarkup.hpp | 105 ++ .../core/namednodemapchildnoderange.hpp | 106 ++ .../level1/core/namednodemapgetnameditem.hpp | 106 ++ .../core/namednodemapinuseattributeerr.hpp | 121 ++ .../level1/core/namednodemapnotfounderr.hpp | 114 ++ .../level1/core/namednodemapnumberofnodes.hpp | 103 ++ .../core/namednodemapremovenameditem.hpp | 112 ++ .../namednodemapremovenameditemgetvalue.hpp | 114 ++ ...dnodemapremovenameditemreturnnodevalue.hpp | 107 ++ .../core/namednodemapreturnattrnode.hpp | 111 ++ .../core/namednodemapreturnfirstitem.hpp | 108 ++ .../core/namednodemapreturnlastitem.hpp | 108 ++ .../level1/core/namednodemapreturnnull.hpp | 104 ++ .../level1/core/namednodemapsetnameditem.hpp | 116 ++ .../namednodemapsetnameditemreturnvalue.hpp | 115 ++ .../namednodemapsetnameditemthatexists.hpp | 118 ++ .../namednodemapsetnameditemwithnewvalue.hpp | 110 ++ .../core/namednodemapwrongdocumenterr.hpp | 122 ++ .../level1/core/nodeappendchild.hpp | 109 ++ .../core/nodeappendchildchildexists.hpp | 121 ++ .../core/nodeappendchilddocfragment.hpp | 132 ++ .../core/nodeappendchildgetnodename.hpp | 106 ++ .../core/nodeappendchildinvalidnodetype.hpp | 114 ++ .../nodeappendchildnewchilddiffdocument.hpp | 119 ++ .../core/nodeappendchildnodeancestor.hpp | 115 ++ ...odeappendchildnomodificationallowederr.hpp | 127 ++ ...eappendchildnomodificationallowederrEE.hpp | 111 ++ .../core/nodeattributenodeattribute.hpp | 103 ++ .../level1/core/nodeattributenodename.hpp | 102 ++ .../level1/core/nodeattributenodetype.hpp | 101 ++ .../level1/core/nodeattributenodevalue.hpp | 102 ++ .../core/nodecdatasectionnodeattribute.hpp | 108 ++ .../level1/core/nodecdatasectionnodename.hpp | 109 ++ .../level1/core/nodecdatasectionnodetype.hpp | 107 ++ .../level1/core/nodecdatasectionnodevalue.hpp | 110 ++ .../level1/core/nodechildnodes.hpp | 116 ++ .../level1/core/nodechildnodesappendchild.hpp | 104 ++ .../level1/core/nodechildnodesempty.hpp | 106 ++ .../level1/core/nodecloneattributescopied.hpp | 116 ++ .../level1/core/nodeclonefalsenocopytext.hpp | 106 ++ .../level1/core/nodeclonegetparentnull.hpp | 102 ++ .../level1/core/nodeclonenodefalse.hpp | 109 ++ .../level1/core/nodeclonenodetrue.hpp | 146 +++ .../level1/core/nodeclonetruecopytext.hpp | 102 ++ .../level1/core/nodecommentnodeattributes.hpp | 111 ++ .../level1/core/nodecommentnodename.hpp | 107 ++ .../level1/core/nodecommentnodetype.hpp | 107 ++ .../level1/core/nodecommentnodevalue.hpp | 107 ++ .../core/nodedocumentfragmentnodename.hpp | 98 ++ .../core/nodedocumentfragmentnodetype.hpp | 98 ++ .../core/nodedocumentfragmentnodevalue.hpp | 104 ++ .../level1/core/nodedocumentnodeattribute.hpp | 92 ++ .../level1/core/nodedocumentnodename.hpp | 95 ++ .../level1/core/nodedocumentnodetype.hpp | 94 ++ .../level1/core/nodedocumentnodevalue.hpp | 95 ++ .../level1/core/nodedocumenttypenodename.hpp | 101 ++ .../level1/core/nodedocumenttypenodetype.hpp | 94 ++ .../level1/core/nodedocumenttypenodevalue.hpp | 93 ++ .../level1/core/nodeelementnodeattributes.hpp | 114 ++ .../level1/core/nodeelementnodename.hpp | 105 ++ .../level1/core/nodeelementnodetype.hpp | 96 ++ .../level1/core/nodeelementnodevalue.hpp | 93 ++ .../level1/core/nodeentitynodeattributes.hpp | 100 ++ .../level1/core/nodeentitynodename.hpp | 99 ++ .../level1/core/nodeentitynodetype.hpp | 100 ++ .../level1/core/nodeentitynodevalue.hpp | 100 ++ .../nodeentityreferencenodeattributes.hpp | 104 ++ .../core/nodeentityreferencenodename.hpp | 109 ++ .../core/nodeentityreferencenodetype.hpp | 107 ++ .../core/nodeentityreferencenodevalue.hpp | 109 ++ .../level1/core/nodeentitysetnodevalue.hpp | 101 ++ .../level1/core/nodegetfirstchild.hpp | 102 ++ .../level1/core/nodegetfirstchildnull.hpp | 105 ++ .../level1/core/nodegetlastchild.hpp | 102 ++ .../level1/core/nodegetlastchildnull.hpp | 105 ++ .../level1/core/nodegetnextsibling.hpp | 102 ++ .../level1/core/nodegetnextsiblingnull.hpp | 101 ++ .../level1/core/nodegetownerdocument.hpp | 111 ++ .../level1/core/nodegetownerdocumentnull.hpp | 91 ++ .../level1/core/nodegetprevioussibling.hpp | 102 ++ .../core/nodegetprevioussiblingnull.hpp | 101 ++ .../level1/core/nodehaschildnodes.hpp | 99 ++ .../level1/core/nodehaschildnodesfalse.hpp | 106 ++ .../level1/core/nodeinsertbefore.hpp | 151 +++ .../core/nodeinsertbeforedocfragment.hpp | 123 ++ .../core/nodeinsertbeforeinvalidnodetype.hpp | 118 ++ .../nodeinsertbeforenewchilddiffdocument.hpp | 120 ++ .../core/nodeinsertbeforenewchildexists.hpp | 153 +++ .../core/nodeinsertbeforenodeancestor.hpp | 119 ++ .../level1/core/nodeinsertbeforenodename.hpp | 109 ++ ...deinsertbeforenomodificationallowederr.hpp | 128 ++ ...insertbeforenomodificationallowederrEE.hpp | 112 ++ .../nodeinsertbeforerefchildnonexistent.hpp | 117 ++ .../core/nodeinsertbeforerefchildnull.hpp | 112 ++ .../level1/core/nodelistindexequalzero.hpp | 103 ++ .../level1/core/nodelistindexgetlength.hpp | 100 ++ .../nodelistindexgetlengthofemptylist.hpp | 106 ++ .../level1/core/nodelistindexnotzero.hpp | 111 ++ .../level1/core/nodelistreturnfirstitem.hpp | 107 ++ .../level1/core/nodelistreturnlastitem.hpp | 109 ++ .../level1/core/nodelisttraverselist.hpp | 139 +++ .../core/nodenotationnodeattributes.hpp | 103 ++ .../level1/core/nodenotationnodename.hpp | 104 ++ .../level1/core/nodenotationnodetype.hpp | 103 ++ .../level1/core/nodenotationnodevalue.hpp | 104 ++ .../level1/core/nodeparentnode.hpp | 108 ++ .../level1/core/nodeparentnodenull.hpp | 97 ++ ...odeprocessinginstructionnodeattributes.hpp | 98 ++ .../nodeprocessinginstructionnodename.hpp | 99 ++ .../nodeprocessinginstructionnodetype.hpp | 99 ++ .../nodeprocessinginstructionnodevalue.hpp | 100 ++ .../nodeprocessinginstructionsetnodevalue.hpp | 100 ++ .../level1/core/noderemovechild.hpp | 105 ++ .../core/noderemovechildgetnodename.hpp | 112 ++ .../level1/core/noderemovechildnode.hpp | 118 ++ ...oderemovechildnomodificationallowederr.hpp | 125 ++ ...eremovechildnomodificationallowederrEE.hpp | 112 ++ .../noderemovechildoldchildnonexistent.hpp | 114 ++ .../level1/core/nodereplacechild.hpp | 110 ++ .../core/nodereplacechildinvalidnodetype.hpp | 118 ++ .../nodereplacechildnewchilddiffdocument.hpp | 120 ++ .../core/nodereplacechildnewchildexists.hpp | 148 +++ .../core/nodereplacechildnodeancestor.hpp | 119 ++ .../level1/core/nodereplacechildnodename.hpp | 115 ++ ...dereplacechildnomodificationallowederr.hpp | 126 ++ ...replacechildnomodificationallowederrEE.hpp | 113 ++ .../nodereplacechildoldchildnonexistent.hpp | 116 ++ ...desetnodevaluenomodificationallowederr.hpp | 128 ++ ...setnodevaluenomodificationallowederrEE.hpp | 107 ++ .../level1/core/nodetextnodeattribute.hpp | 101 ++ .../level1/core/nodetextnodename.hpp | 102 ++ .../level1/core/nodetextnodetype.hpp | 101 ++ .../level1/core/nodetextnodevalue.hpp | 102 ++ .../conformance/level1/core/nodevalue01.hpp | 96 ++ .../conformance/level1/core/nodevalue02.hpp | 96 ++ .../conformance/level1/core/nodevalue03.hpp | 97 ++ .../conformance/level1/core/nodevalue04.hpp | 97 ++ .../conformance/level1/core/nodevalue05.hpp | 96 ++ .../conformance/level1/core/nodevalue06.hpp | 94 ++ .../conformance/level1/core/nodevalue07.hpp | 103 ++ .../conformance/level1/core/nodevalue08.hpp | 103 ++ .../conformance/level1/core/nodevalue09.hpp | 96 ++ .../level1/core/notationgetnotationname.hpp | 102 ++ .../level1/core/notationgetpublicid.hpp | 101 ++ .../level1/core/notationgetpublicidnull.hpp | 106 ++ .../level1/core/notationgetsystemid.hpp | 105 ++ .../level1/core/notationgetsystemidnull.hpp | 102 ++ .../core/processinginstructiongetdata.hpp | 103 ++ .../core/processinginstructiongettarget.hpp | 102 ++ ...ructionsetdatanomodificationallowederr.hpp | 117 ++ ...ctionsetdatanomodificationallowederrEE.hpp | 121 ++ .../core/textindexsizeerrnegativeoffset.hpp | 113 ++ .../textindexsizeerroffsetoutofbounds.hpp | 115 ++ .../core/textparseintolistofelements.hpp | 137 +++ .../level1/core/textsplittextfour.hpp | 106 ++ .../textsplittextnomodificationallowederr.hpp | 128 ++ ...extsplittextnomodificationallowederrEE.hpp | 108 ++ .../level1/core/textsplittextone.hpp | 109 ++ .../level1/core/textsplittextthree.hpp | 108 ++ .../level1/core/textsplittexttwo.hpp | 107 ++ .../level1/core/textwithnomarkup.hpp | 106 ++ tests/DOM/dom_test_suite.hpp | 6 +- tests/DOM/main_silly.cpp | 2 +- tests/DOM/main_wide.cpp | 2 +- 531 files changed, 58550 insertions(+), 3 deletions(-) create mode 100644 tests/DOM/conformance/level1/core/alltests.hpp create mode 100644 tests/DOM/conformance/level1/core/attrcreatedocumentfragment.hpp create mode 100644 tests/DOM/conformance/level1/core/attrcreatetextnode.hpp create mode 100644 tests/DOM/conformance/level1/core/attrcreatetextnode2.hpp create mode 100644 tests/DOM/conformance/level1/core/attrdefaultvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/attreffectivevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/attrentityreplacement.hpp create mode 100644 tests/DOM/conformance/level1/core/attrname.hpp create mode 100644 tests/DOM/conformance/level1/core/attrnextsiblingnull.hpp create mode 100644 tests/DOM/conformance/level1/core/attrnotspecifiedvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/attrparentnodenull.hpp create mode 100644 tests/DOM/conformance/level1/core/attrprevioussiblingnull.hpp create mode 100644 tests/DOM/conformance/level1/core/attrremovechild1.hpp create mode 100644 tests/DOM/conformance/level1/core/attrreplacechild1.hpp create mode 100644 tests/DOM/conformance/level1/core/attrsetvaluenomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/attrsetvaluenomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/attrspecifiedvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/attrspecifiedvaluechanged.hpp create mode 100644 tests/DOM/conformance/level1/core/attrspecifiedvalueremove.hpp create mode 100644 tests/DOM/conformance/level1/core/cdatasectiongetdata.hpp create mode 100644 tests/DOM/conformance/level1/core/cdatasectionnormalize.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataappenddata.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataappenddatagetdata.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataappenddatanomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataappenddatanomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatadeletedatabegining.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatadeletedataend.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatadeletedataexceedslength.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatadeletedatagetlengthanddata.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatadeletedatamiddle.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatadeletedatanomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatadeletedatanomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatagetdata.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatagetlength.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedatacountnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedataoffsetgreater.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedataoffsetnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrinsertdataoffsetgreater.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrinsertdataoffsetnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedatacountnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedataoffsetgreater.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedataoffsetnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringcountnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringnegativeoffset.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringoffsetgreater.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatainsertdatabeginning.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatainsertdataend.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatainsertdatamiddle.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatainsertdatanomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatainsertdatanomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatareplacedatabegining.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatareplacedataend.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatareplacedataexceedslengthofarg.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatareplacedataexceedslengthofdata.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatareplacedatamiddle.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatareplacedatanomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatareplacedatanomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatasetdatanomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatasetdatanomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatasetnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatasubstringexceedsvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/characterdatasubstringvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/commentgetcomment.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreateattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreatecdatasection.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreatecomment.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreatedocumentfragment.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreateelement.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreateelementcasesensitive.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreateelementdefaultattr.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreateentityreference.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreateentityreferenceknown.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreateprocessinginstruction.hpp create mode 100644 tests/DOM/conformance/level1/core/documentcreatetextnode.hpp create mode 100644 tests/DOM/conformance/level1/core/documentgetdoctype.hpp create mode 100644 tests/DOM/conformance/level1/core/documentgetdoctypenodtd.hpp create mode 100644 tests/DOM/conformance/level1/core/documentgetelementsbytagnamelength.hpp create mode 100644 tests/DOM/conformance/level1/core/documentgetelementsbytagnametotallength.hpp create mode 100644 tests/DOM/conformance/level1/core/documentgetelementsbytagnamevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/documentgetimplementation.hpp create mode 100644 tests/DOM/conformance/level1/core/documentgetrootnode.hpp create mode 100644 tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateelement.hpp create mode 100644 tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateentref.hpp create mode 100644 tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateentref1.hpp create mode 100644 tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreatepi.hpp create mode 100644 tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreatepi1.hpp create mode 100644 tests/DOM/conformance/level1/core/documenttypegetdoctype.hpp create mode 100644 tests/DOM/conformance/level1/core/documenttypegetentities.hpp create mode 100644 tests/DOM/conformance/level1/core/documenttypegetentitieslength.hpp create mode 100644 tests/DOM/conformance/level1/core/documenttypegetentitiestype.hpp create mode 100644 tests/DOM/conformance/level1/core/documenttypegetnotations.hpp create mode 100644 tests/DOM/conformance/level1/core/documenttypegetnotationstype.hpp create mode 100644 tests/DOM/conformance/level1/core/domimplementationfeaturenoversion.hpp create mode 100644 tests/DOM/conformance/level1/core/domimplementationfeaturenull.hpp create mode 100644 tests/DOM/conformance/level1/core/domimplementationfeaturexml.hpp create mode 100644 tests/DOM/conformance/level1/core/elementaddnewattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/elementassociatedattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/elementchangeattributevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/elementcreatenewattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/elementgetattributenode.hpp create mode 100644 tests/DOM/conformance/level1/core/elementgetattributenodenull.hpp create mode 100644 tests/DOM/conformance/level1/core/elementgetelementempty.hpp create mode 100644 tests/DOM/conformance/level1/core/elementgetelementsbytagname.hpp create mode 100644 tests/DOM/conformance/level1/core/elementgetelementsbytagnameaccessnodelist.hpp create mode 100644 tests/DOM/conformance/level1/core/elementgetelementsbytagnamenomatch.hpp create mode 100644 tests/DOM/conformance/level1/core/elementgetelementsbytagnamespecialvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/elementgettagname.hpp create mode 100644 tests/DOM/conformance/level1/core/elementinuseattributeerr.hpp create mode 100644 tests/DOM/conformance/level1/core/elementinvalidcharacterexception.hpp create mode 100644 tests/DOM/conformance/level1/core/elementnormalize.hpp create mode 100644 tests/DOM/conformance/level1/core/elementnotfounderr.hpp create mode 100644 tests/DOM/conformance/level1/core/elementremoveattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/elementremoveattributeaftercreate.hpp create mode 100644 tests/DOM/conformance/level1/core/elementremoveattributenode.hpp create mode 100644 tests/DOM/conformance/level1/core/elementremoveattributenodenomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/elementremoveattributenodenomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/elementremoveattributenomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/elementremoveattributenomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/elementremoveattributerestoredefaultvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/elementreplaceattributewithself.hpp create mode 100644 tests/DOM/conformance/level1/core/elementreplaceexistingattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/elementreplaceexistingattributegevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/elementretrieveallattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/elementretrieveattrvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/elementretrievetagname.hpp create mode 100644 tests/DOM/conformance/level1/core/elementsetattributenodenomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/elementsetattributenodenomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/elementsetattributenodenull.hpp create mode 100644 tests/DOM/conformance/level1/core/elementsetattributenomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/elementsetattributenomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/elementwrongdocumenterr.hpp create mode 100644 tests/DOM/conformance/level1/core/entitygetentityname.hpp create mode 100644 tests/DOM/conformance/level1/core/entitygetpublicid.hpp create mode 100644 tests/DOM/conformance/level1/core/entitygetpublicidnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrappendchild1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrappendchild2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrappendchild3.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrappendchild4.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrappendchild5.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrappendchild6.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrchildnodes1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrchildnodes2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrclonenode1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrcreatedocumentfragment.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrcreatetextnode.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrcreatetextnode2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attreffectivevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrfirstchild.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrgetvalue1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrgetvalue2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrhaschildnodes.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrinsertbefore1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrinsertbefore2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrinsertbefore3.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrinsertbefore4.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrinsertbefore5.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrinsertbefore6.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrinsertbefore7.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrlastchild.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrname.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrnextsiblingnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrnormalize.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrparentnodenull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrprevioussiblingnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrremovechild1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrremovechild2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrreplacechild1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrreplacechild2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrsetvalue1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrsetvalue2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrspecifiedvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_attrspecifiedvaluechanged.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataappenddata.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataappenddatagetdata.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatadeletedatabegining.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatadeletedataend.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatadeletedataexceedslength.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatadeletedatagetlengthanddata.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatadeletedatamiddle.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatagetdata.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatagetlength.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatainsertdatabeginning.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatainsertdataend.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatainsertdatamiddle.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatareplacedatabegining.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatareplacedataend.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatareplacedataexceedslengthofarg.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatareplacedataexceedslengthofdata.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatareplacedatamiddle.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatasetnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatasubstringexceedsvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_characterdatasubstringvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_commentgetcomment.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentcreateattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentcreatecomment.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentcreatedocumentfragment.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentcreateelement.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentcreateelementcasesensitive.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentcreatetextnode.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentgetdoctype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnamelength.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnametotallength.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnamevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentgetimplementation.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentgetrootnode.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateelement.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_domimplementationfeaturenoversion.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_domimplementationfeaturenull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_domimplementationfeaturexml.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementaddnewattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementassociatedattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementchangeattributevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementcreatenewattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementgetattributenode.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementgetattributenodenull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementgetelementempty.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementgetelementsbytagname.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnameaccessnodelist.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnamenomatch.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnamespecialvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementgettagname.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementinuseattributeerr.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementinvalidcharacterexception.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementinvalidcharacterexception1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementnormalize.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementnormalize2.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementnotfounderr.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementremoveattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementremoveattributeaftercreate.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementremoveattributenode.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementreplaceattributewithself.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementreplaceexistingattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementreplaceexistingattributegevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementretrieveallattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementretrieveattrvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementretrievetagname.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementsetattributenodenull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_elementwrongdocumenterr.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_entitiesremovenameditem1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_entitiessetnameditem1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapchildnoderange.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapgetnameditem.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapinuseattributeerr.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapnotfounderr.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapnumberofnodes.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapremovenameditem.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapreturnattrnode.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapreturnfirstitem.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapreturnlastitem.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapreturnnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapsetnameditem.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemreturnvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemthatexists.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemwithnewvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_namednodemapwrongdocumenterr.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeappendchild.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeappendchildchildexists.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeappendchilddocfragment.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeappendchildgetnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeappendchildinvalidnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeappendchildnewchilddiffdocument.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeappendchildnodeancestor.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeattributenodeattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeattributenodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeattributenodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeattributenodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodechildnodes.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodechildnodesappendchild.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodechildnodesempty.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodecloneattributescopied.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeclonefalsenocopytext.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeclonegetparentnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeclonenodefalse.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeclonenodetrue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeclonetruecopytext.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodecommentnodeattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodecommentnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodecommentnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodecommentnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodedocumentnodeattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodedocumentnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodedocumentnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodedocumentnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeelementnodeattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeelementnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeelementnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeelementnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetfirstchild.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetfirstchildnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetlastchild.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetlastchildnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetnextsibling.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetnextsiblingnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetownerdocument.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetownerdocumentnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetprevioussibling.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodegetprevioussiblingnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodehaschildnodes.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodehaschildnodesfalse.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbefore.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbeforedocfragment.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbeforeinvalidnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbeforenewchilddiffdocument.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbeforenewchildexists.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbeforenodeancestor.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbeforenodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbeforerefchildnonexistent.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeinsertbeforerefchildnull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodelistindexequalzero.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodelistindexgetlength.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodelistindexgetlengthofemptylist.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodelistindexnotzero.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodelistreturnfirstitem.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodelistreturnlastitem.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodelisttraverselist.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeparentnode.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodeparentnodenull.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_noderemovechild.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_noderemovechildgetnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_noderemovechildnode.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_noderemovechildoldchildnonexistent.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodereplacechild.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodereplacechildinvalidnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodereplacechildnewchilddiffdocument.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodereplacechildnewchildexists.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodereplacechildnodeancestor.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodereplacechildnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodereplacechildoldchildnonexistent.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodetextnodeattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodetextnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodetextnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodetextnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodevalue01.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodevalue02.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodevalue03.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodevalue04.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodevalue05.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodevalue06.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodevalue07.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_nodevalue08.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_notationsremovenameditem1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_notationssetnameditem1.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_textindexsizeerrnegativeoffset.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_textindexsizeerroffsetoutofbounds.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_textparseintolistofelements.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_textsplittextfour.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_textsplittextone.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_textsplittextthree.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_textsplittexttwo.hpp create mode 100644 tests/DOM/conformance/level1/core/hc_textwithnomarkup.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapchildnoderange.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapgetnameditem.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapinuseattributeerr.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapnotfounderr.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapnumberofnodes.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapremovenameditem.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapremovenameditemgetvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapremovenameditemreturnnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapreturnattrnode.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapreturnfirstitem.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapreturnlastitem.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapreturnnull.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapsetnameditem.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapsetnameditemreturnvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapsetnameditemthatexists.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapsetnameditemwithnewvalue.hpp create mode 100644 tests/DOM/conformance/level1/core/namednodemapwrongdocumenterr.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchild.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchildchildexists.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchilddocfragment.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchildgetnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchildinvalidnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchildnewchilddiffdocument.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchildnodeancestor.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchildnomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeappendchildnomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeattributenodeattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeattributenodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeattributenodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeattributenodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecdatasectionnodeattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecdatasectionnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecdatasectionnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecdatasectionnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodechildnodes.hpp create mode 100644 tests/DOM/conformance/level1/core/nodechildnodesappendchild.hpp create mode 100644 tests/DOM/conformance/level1/core/nodechildnodesempty.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecloneattributescopied.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeclonefalsenocopytext.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeclonegetparentnull.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeclonenodefalse.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeclonenodetrue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeclonetruecopytext.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecommentnodeattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecommentnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecommentnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodecommentnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumentfragmentnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumentfragmentnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumentfragmentnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumentnodeattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumentnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumentnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumentnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumenttypenodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumenttypenodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodedocumenttypenodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeelementnodeattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeelementnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeelementnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeelementnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentitynodeattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentitynodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentitynodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentitynodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentityreferencenodeattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentityreferencenodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentityreferencenodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentityreferencenodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeentitysetnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetfirstchild.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetfirstchildnull.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetlastchild.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetlastchildnull.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetnextsibling.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetnextsiblingnull.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetownerdocument.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetownerdocumentnull.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetprevioussibling.hpp create mode 100644 tests/DOM/conformance/level1/core/nodegetprevioussiblingnull.hpp create mode 100644 tests/DOM/conformance/level1/core/nodehaschildnodes.hpp create mode 100644 tests/DOM/conformance/level1/core/nodehaschildnodesfalse.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbefore.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforedocfragment.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforeinvalidnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforenewchilddiffdocument.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforenewchildexists.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforenodeancestor.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforenodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforenomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforenomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforerefchildnonexistent.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeinsertbeforerefchildnull.hpp create mode 100644 tests/DOM/conformance/level1/core/nodelistindexequalzero.hpp create mode 100644 tests/DOM/conformance/level1/core/nodelistindexgetlength.hpp create mode 100644 tests/DOM/conformance/level1/core/nodelistindexgetlengthofemptylist.hpp create mode 100644 tests/DOM/conformance/level1/core/nodelistindexnotzero.hpp create mode 100644 tests/DOM/conformance/level1/core/nodelistreturnfirstitem.hpp create mode 100644 tests/DOM/conformance/level1/core/nodelistreturnlastitem.hpp create mode 100644 tests/DOM/conformance/level1/core/nodelisttraverselist.hpp create mode 100644 tests/DOM/conformance/level1/core/nodenotationnodeattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/nodenotationnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodenotationnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodenotationnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeparentnode.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeparentnodenull.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeprocessinginstructionnodeattributes.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeprocessinginstructionnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeprocessinginstructionnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeprocessinginstructionnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodeprocessinginstructionsetnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/noderemovechild.hpp create mode 100644 tests/DOM/conformance/level1/core/noderemovechildgetnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/noderemovechildnode.hpp create mode 100644 tests/DOM/conformance/level1/core/noderemovechildnomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/noderemovechildnomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/noderemovechildoldchildnonexistent.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechild.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechildinvalidnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechildnewchilddiffdocument.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechildnewchildexists.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechildnodeancestor.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechildnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechildnomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechildnomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/nodereplacechildoldchildnonexistent.hpp create mode 100644 tests/DOM/conformance/level1/core/nodesetnodevaluenomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/nodesetnodevaluenomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/nodetextnodeattribute.hpp create mode 100644 tests/DOM/conformance/level1/core/nodetextnodename.hpp create mode 100644 tests/DOM/conformance/level1/core/nodetextnodetype.hpp create mode 100644 tests/DOM/conformance/level1/core/nodetextnodevalue.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue01.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue02.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue03.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue04.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue05.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue06.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue07.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue08.hpp create mode 100644 tests/DOM/conformance/level1/core/nodevalue09.hpp create mode 100644 tests/DOM/conformance/level1/core/notationgetnotationname.hpp create mode 100644 tests/DOM/conformance/level1/core/notationgetpublicid.hpp create mode 100644 tests/DOM/conformance/level1/core/notationgetpublicidnull.hpp create mode 100644 tests/DOM/conformance/level1/core/notationgetsystemid.hpp create mode 100644 tests/DOM/conformance/level1/core/notationgetsystemidnull.hpp create mode 100644 tests/DOM/conformance/level1/core/processinginstructiongetdata.hpp create mode 100644 tests/DOM/conformance/level1/core/processinginstructiongettarget.hpp create mode 100644 tests/DOM/conformance/level1/core/processinginstructionsetdatanomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/processinginstructionsetdatanomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/textindexsizeerrnegativeoffset.hpp create mode 100644 tests/DOM/conformance/level1/core/textindexsizeerroffsetoutofbounds.hpp create mode 100644 tests/DOM/conformance/level1/core/textparseintolistofelements.hpp create mode 100644 tests/DOM/conformance/level1/core/textsplittextfour.hpp create mode 100644 tests/DOM/conformance/level1/core/textsplittextnomodificationallowederr.hpp create mode 100644 tests/DOM/conformance/level1/core/textsplittextnomodificationallowederrEE.hpp create mode 100644 tests/DOM/conformance/level1/core/textsplittextone.hpp create mode 100644 tests/DOM/conformance/level1/core/textsplittextthree.hpp create mode 100644 tests/DOM/conformance/level1/core/textsplittexttwo.hpp create mode 100644 tests/DOM/conformance/level1/core/textwithnomarkup.hpp diff --git a/tests/DOM/conformance/level1/core/alltests.hpp b/tests/DOM/conformance/level1/core/alltests.hpp new file mode 100644 index 00000000..71f9d1a9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/alltests.hpp @@ -0,0 +1,1085 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ +#ifndef test_suite_DOM_Level_1_Core_Test_Suite +#define test_suite_DOM_Level_1_Core_Test_Suite + +#include "attrcreatedocumentfragment.hpp" +#include "attrcreatetextnode.hpp" +#include "attrcreatetextnode2.hpp" +#include "attrdefaultvalue.hpp" +#include "attreffectivevalue.hpp" +#include "attrentityreplacement.hpp" +#include "attrname.hpp" +#include "attrnextsiblingnull.hpp" +#include "attrnotspecifiedvalue.hpp" +#include "attrparentnodenull.hpp" +#include "attrprevioussiblingnull.hpp" +#include "attrsetvaluenomodificationallowederr.hpp" +#include "attrsetvaluenomodificationallowederrEE.hpp" +#include "attrspecifiedvalue.hpp" +#include "attrspecifiedvaluechanged.hpp" +#include "attrspecifiedvalueremove.hpp" +#include "cdatasectiongetdata.hpp" +#include "cdatasectionnormalize.hpp" +#include "characterdataappenddata.hpp" +#include "characterdataappenddatagetdata.hpp" +#include "characterdataappenddatanomodificationallowederr.hpp" +#include "characterdataappenddatanomodificationallowederrEE.hpp" +#include "characterdatadeletedatabegining.hpp" +#include "characterdatadeletedataend.hpp" +#include "characterdatadeletedataexceedslength.hpp" +#include "characterdatadeletedatagetlengthanddata.hpp" +#include "characterdatadeletedatamiddle.hpp" +#include "characterdatadeletedatanomodificationallowederr.hpp" +#include "characterdatadeletedatanomodificationallowederrEE.hpp" +#include "characterdatagetdata.hpp" +#include "characterdatagetlength.hpp" +#include "characterdataindexsizeerrdeletedatacountnegative.hpp" +#include "characterdataindexsizeerrdeletedataoffsetgreater.hpp" +#include "characterdataindexsizeerrdeletedataoffsetnegative.hpp" +#include "characterdataindexsizeerrinsertdataoffsetgreater.hpp" +#include "characterdataindexsizeerrinsertdataoffsetnegative.hpp" +#include "characterdataindexsizeerrreplacedatacountnegative.hpp" +#include "characterdataindexsizeerrreplacedataoffsetgreater.hpp" +#include "characterdataindexsizeerrreplacedataoffsetnegative.hpp" +#include "characterdataindexsizeerrsubstringcountnegative.hpp" +#include "characterdataindexsizeerrsubstringnegativeoffset.hpp" +#include "characterdataindexsizeerrsubstringoffsetgreater.hpp" +#include "characterdatainsertdatabeginning.hpp" +#include "characterdatainsertdataend.hpp" +#include "characterdatainsertdatamiddle.hpp" +#include "characterdatainsertdatanomodificationallowederr.hpp" +#include "characterdatainsertdatanomodificationallowederrEE.hpp" +#include "characterdatareplacedatabegining.hpp" +#include "characterdatareplacedataend.hpp" +#include "characterdatareplacedataexceedslengthofarg.hpp" +#include "characterdatareplacedataexceedslengthofdata.hpp" +#include "characterdatareplacedatamiddle.hpp" +#include "characterdatareplacedatanomodificationallowederr.hpp" +#include "characterdatareplacedatanomodificationallowederrEE.hpp" +#include "characterdatasetdatanomodificationallowederr.hpp" +#include "characterdatasetdatanomodificationallowederrEE.hpp" +#include "characterdatasetnodevalue.hpp" +#include "characterdatasubstringexceedsvalue.hpp" +#include "characterdatasubstringvalue.hpp" +#include "commentgetcomment.hpp" +#include "documentcreateattribute.hpp" +#include "documentcreatecdatasection.hpp" +#include "documentcreatecomment.hpp" +#include "documentcreatedocumentfragment.hpp" +#include "documentcreateelement.hpp" +#include "documentcreateelementcasesensitive.hpp" +#include "documentcreateelementdefaultattr.hpp" +#include "documentcreateentityreference.hpp" +#include "documentcreateentityreferenceknown.hpp" +#include "documentcreateprocessinginstruction.hpp" +#include "documentcreatetextnode.hpp" +#include "documentgetdoctype.hpp" +#include "documentgetdoctypenodtd.hpp" +#include "documentgetelementsbytagnamelength.hpp" +#include "documentgetelementsbytagnametotallength.hpp" +#include "documentgetelementsbytagnamevalue.hpp" +#include "documentgetimplementation.hpp" +#include "documentgetrootnode.hpp" +#include "documentinvalidcharacterexceptioncreateattribute.hpp" +#include "documentinvalidcharacterexceptioncreateelement.hpp" +#include "documentinvalidcharacterexceptioncreateentref.hpp" +#include "documentinvalidcharacterexceptioncreateentref1.hpp" +#include "documentinvalidcharacterexceptioncreatepi.hpp" +#include "documentinvalidcharacterexceptioncreatepi1.hpp" +#include "documenttypegetdoctype.hpp" +#include "documenttypegetentities.hpp" +#include "documenttypegetentitieslength.hpp" +#include "documenttypegetentitiestype.hpp" +#include "documenttypegetnotations.hpp" +#include "documenttypegetnotationstype.hpp" +#include "domimplementationfeaturenoversion.hpp" +#include "domimplementationfeaturenull.hpp" +#include "domimplementationfeaturexml.hpp" +#include "elementaddnewattribute.hpp" +#include "elementassociatedattribute.hpp" +#include "elementchangeattributevalue.hpp" +#include "elementcreatenewattribute.hpp" +#include "elementgetattributenode.hpp" +#include "elementgetattributenodenull.hpp" +#include "elementgetelementempty.hpp" +#include "elementgetelementsbytagname.hpp" +#include "elementgetelementsbytagnameaccessnodelist.hpp" +#include "elementgetelementsbytagnamenomatch.hpp" +#include "elementgetelementsbytagnamespecialvalue.hpp" +#include "elementgettagname.hpp" +#include "elementinuseattributeerr.hpp" +#include "elementinvalidcharacterexception.hpp" +#include "elementnormalize.hpp" +#include "elementnotfounderr.hpp" +#include "elementremoveattribute.hpp" +#include "elementremoveattributeaftercreate.hpp" +#include "elementremoveattributenode.hpp" +#include "elementremoveattributenodenomodificationallowederr.hpp" +#include "elementremoveattributenodenomodificationallowederrEE.hpp" +#include "elementremoveattributenomodificationallowederr.hpp" +#include "elementremoveattributenomodificationallowederrEE.hpp" +#include "elementremoveattributerestoredefaultvalue.hpp" +#include "elementreplaceattributewithself.hpp" +#include "elementreplaceexistingattribute.hpp" +#include "elementreplaceexistingattributegevalue.hpp" +#include "elementretrieveallattributes.hpp" +#include "elementretrieveattrvalue.hpp" +#include "elementretrievetagname.hpp" +#include "elementsetattributenodenomodificationallowederr.hpp" +#include "elementsetattributenodenomodificationallowederrEE.hpp" +#include "elementsetattributenodenull.hpp" +#include "elementsetattributenomodificationallowederr.hpp" +#include "elementsetattributenomodificationallowederrEE.hpp" +#include "elementwrongdocumenterr.hpp" +#include "entitygetentityname.hpp" +#include "entitygetpublicid.hpp" +#include "entitygetpublicidnull.hpp" +#include "namednodemapchildnoderange.hpp" +#include "namednodemapgetnameditem.hpp" +#include "namednodemapinuseattributeerr.hpp" +#include "namednodemapnotfounderr.hpp" +#include "namednodemapnumberofnodes.hpp" +#include "namednodemapremovenameditem.hpp" +#include "namednodemapremovenameditemgetvalue.hpp" +#include "namednodemapremovenameditemreturnnodevalue.hpp" +#include "namednodemapreturnattrnode.hpp" +#include "namednodemapreturnfirstitem.hpp" +#include "namednodemapreturnlastitem.hpp" +#include "namednodemapreturnnull.hpp" +#include "namednodemapsetnameditem.hpp" +#include "namednodemapsetnameditemreturnvalue.hpp" +#include "namednodemapsetnameditemthatexists.hpp" +#include "namednodemapsetnameditemwithnewvalue.hpp" +#include "namednodemapwrongdocumenterr.hpp" +#include "nodeappendchild.hpp" +#include "nodeappendchildchildexists.hpp" +#include "nodeappendchilddocfragment.hpp" +#include "nodeappendchildgetnodename.hpp" +#include "nodeappendchildinvalidnodetype.hpp" +#include "nodeappendchildnewchilddiffdocument.hpp" +#include "nodeappendchildnodeancestor.hpp" +#include "nodeappendchildnomodificationallowederr.hpp" +#include "nodeappendchildnomodificationallowederrEE.hpp" +#include "nodeattributenodeattribute.hpp" +#include "nodeattributenodename.hpp" +#include "nodeattributenodetype.hpp" +#include "nodeattributenodevalue.hpp" +#include "nodecdatasectionnodeattribute.hpp" +#include "nodecdatasectionnodename.hpp" +#include "nodecdatasectionnodetype.hpp" +#include "nodecdatasectionnodevalue.hpp" +#include "nodechildnodes.hpp" +#include "nodechildnodesappendchild.hpp" +#include "nodechildnodesempty.hpp" +#include "nodecloneattributescopied.hpp" +#include "nodeclonefalsenocopytext.hpp" +#include "nodeclonegetparentnull.hpp" +#include "nodeclonenodefalse.hpp" +#include "nodeclonenodetrue.hpp" +#include "nodeclonetruecopytext.hpp" +#include "nodecommentnodeattributes.hpp" +#include "nodecommentnodename.hpp" +#include "nodecommentnodetype.hpp" +#include "nodecommentnodevalue.hpp" +#include "nodedocumentfragmentnodename.hpp" +#include "nodedocumentfragmentnodetype.hpp" +#include "nodedocumentfragmentnodevalue.hpp" +#include "nodedocumentnodeattribute.hpp" +#include "nodedocumentnodename.hpp" +#include "nodedocumentnodetype.hpp" +#include "nodedocumentnodevalue.hpp" +#include "nodedocumenttypenodename.hpp" +#include "nodedocumenttypenodetype.hpp" +#include "nodedocumenttypenodevalue.hpp" +#include "nodeelementnodeattributes.hpp" +#include "nodeelementnodename.hpp" +#include "nodeelementnodetype.hpp" +#include "nodeelementnodevalue.hpp" +#include "nodeentitynodeattributes.hpp" +#include "nodeentitynodename.hpp" +#include "nodeentitynodetype.hpp" +#include "nodeentitynodevalue.hpp" +#include "nodeentitysetnodevalue.hpp" +#include "nodeentityreferencenodeattributes.hpp" +#include "nodeentityreferencenodename.hpp" +#include "nodeentityreferencenodetype.hpp" +#include "nodeentityreferencenodevalue.hpp" +#include "nodegetfirstchild.hpp" +#include "nodegetfirstchildnull.hpp" +#include "nodegetlastchild.hpp" +#include "nodegetlastchildnull.hpp" +#include "nodegetnextsibling.hpp" +#include "nodegetnextsiblingnull.hpp" +#include "nodegetownerdocument.hpp" +#include "nodegetownerdocumentnull.hpp" +#include "nodegetprevioussibling.hpp" +#include "nodegetprevioussiblingnull.hpp" +#include "nodehaschildnodes.hpp" +#include "nodehaschildnodesfalse.hpp" +#include "nodeinsertbefore.hpp" +#include "nodeinsertbeforedocfragment.hpp" +#include "nodeinsertbeforeinvalidnodetype.hpp" +#include "nodeinsertbeforenewchilddiffdocument.hpp" +#include "nodeinsertbeforenewchildexists.hpp" +#include "nodeinsertbeforenodeancestor.hpp" +#include "nodeinsertbeforenodename.hpp" +#include "nodeinsertbeforenomodificationallowederr.hpp" +#include "nodeinsertbeforenomodificationallowederrEE.hpp" +#include "nodeinsertbeforerefchildnonexistent.hpp" +#include "nodeinsertbeforerefchildnull.hpp" +#include "nodelistindexequalzero.hpp" +#include "nodelistindexgetlength.hpp" +#include "nodelistindexgetlengthofemptylist.hpp" +#include "nodelistindexnotzero.hpp" +#include "nodelistreturnfirstitem.hpp" +#include "nodelistreturnlastitem.hpp" +#include "nodelisttraverselist.hpp" +#include "nodenotationnodeattributes.hpp" +#include "nodenotationnodename.hpp" +#include "nodenotationnodetype.hpp" +#include "nodenotationnodevalue.hpp" +#include "nodeparentnode.hpp" +#include "nodeparentnodenull.hpp" +#include "nodeprocessinginstructionnodeattributes.hpp" +#include "nodeprocessinginstructionnodename.hpp" +#include "nodeprocessinginstructionnodetype.hpp" +#include "nodeprocessinginstructionnodevalue.hpp" +#include "nodeprocessinginstructionsetnodevalue.hpp" +#include "noderemovechild.hpp" +#include "noderemovechildgetnodename.hpp" +#include "noderemovechildnode.hpp" +#include "noderemovechildnomodificationallowederr.hpp" +#include "noderemovechildnomodificationallowederrEE.hpp" +#include "noderemovechildoldchildnonexistent.hpp" +#include "nodereplacechild.hpp" +#include "nodereplacechildinvalidnodetype.hpp" +#include "nodereplacechildnewchilddiffdocument.hpp" +#include "nodereplacechildnewchildexists.hpp" +#include "nodereplacechildnodeancestor.hpp" +#include "nodereplacechildnodename.hpp" +#include "nodereplacechildnomodificationallowederr.hpp" +#include "nodereplacechildnomodificationallowederrEE.hpp" +#include "nodereplacechildoldchildnonexistent.hpp" +#include "nodesetnodevaluenomodificationallowederr.hpp" +#include "nodesetnodevaluenomodificationallowederrEE.hpp" +#include "nodetextnodeattribute.hpp" +#include "nodetextnodename.hpp" +#include "nodetextnodetype.hpp" +#include "nodetextnodevalue.hpp" +#include "notationgetnotationname.hpp" +#include "notationgetpublicid.hpp" +#include "notationgetpublicidnull.hpp" +#include "notationgetsystemid.hpp" +#include "notationgetsystemidnull.hpp" +#include "processinginstructiongetdata.hpp" +#include "processinginstructiongettarget.hpp" +#include "processinginstructionsetdatanomodificationallowederr.hpp" +#include "processinginstructionsetdatanomodificationallowederrEE.hpp" +#include "textindexsizeerrnegativeoffset.hpp" +#include "textindexsizeerroffsetoutofbounds.hpp" +#include "textparseintolistofelements.hpp" +#include "textsplittextfour.hpp" +#include "textsplittextnomodificationallowederr.hpp" +#include "textsplittextnomodificationallowederrEE.hpp" +#include "textsplittextone.hpp" +#include "textsplittextthree.hpp" +#include "textsplittexttwo.hpp" +#include "textwithnomarkup.hpp" +#include "nodevalue01.hpp" +#include "nodevalue02.hpp" +#include "nodevalue03.hpp" +#include "nodevalue04.hpp" +#include "nodevalue05.hpp" +#include "nodevalue06.hpp" +#include "nodevalue07.hpp" +#include "nodevalue08.hpp" +#include "nodevalue09.hpp" +#include "hc_attrcreatedocumentfragment.hpp" +#include "hc_attrcreatetextnode.hpp" +#include "hc_attrcreatetextnode2.hpp" +#include "hc_attreffectivevalue.hpp" +#include "hc_attrname.hpp" +#include "hc_attrnextsiblingnull.hpp" +#include "hc_attrparentnodenull.hpp" +#include "hc_attrprevioussiblingnull.hpp" +#include "hc_attrspecifiedvalue.hpp" +#include "hc_attrspecifiedvaluechanged.hpp" +#include "hc_characterdataappenddata.hpp" +#include "hc_characterdataappenddatagetdata.hpp" +#include "hc_characterdatadeletedatabegining.hpp" +#include "hc_characterdatadeletedataend.hpp" +#include "hc_characterdatadeletedataexceedslength.hpp" +#include "hc_characterdatadeletedatagetlengthanddata.hpp" +#include "hc_characterdatadeletedatamiddle.hpp" +#include "hc_characterdatagetdata.hpp" +#include "hc_characterdatagetlength.hpp" +#include "hc_characterdataindexsizeerrdeletedatacountnegative.hpp" +#include "hc_characterdataindexsizeerrdeletedataoffsetgreater.hpp" +#include "hc_characterdataindexsizeerrdeletedataoffsetnegative.hpp" +#include "hc_characterdataindexsizeerrinsertdataoffsetgreater.hpp" +#include "hc_characterdataindexsizeerrinsertdataoffsetnegative.hpp" +#include "hc_characterdataindexsizeerrreplacedatacountnegative.hpp" +#include "hc_characterdataindexsizeerrreplacedataoffsetgreater.hpp" +#include "hc_characterdataindexsizeerrreplacedataoffsetnegative.hpp" +#include "hc_characterdataindexsizeerrsubstringcountnegative.hpp" +#include "hc_characterdataindexsizeerrsubstringnegativeoffset.hpp" +#include "hc_characterdataindexsizeerrsubstringoffsetgreater.hpp" +#include "hc_characterdatainsertdatabeginning.hpp" +#include "hc_characterdatainsertdataend.hpp" +#include "hc_characterdatainsertdatamiddle.hpp" +#include "hc_characterdatareplacedatabegining.hpp" +#include "hc_characterdatareplacedataend.hpp" +#include "hc_characterdatareplacedataexceedslengthofarg.hpp" +#include "hc_characterdatareplacedataexceedslengthofdata.hpp" +#include "hc_characterdatareplacedatamiddle.hpp" +#include "hc_characterdatasetnodevalue.hpp" +#include "hc_characterdatasubstringexceedsvalue.hpp" +#include "hc_characterdatasubstringvalue.hpp" +#include "hc_commentgetcomment.hpp" +#include "hc_documentcreateattribute.hpp" +#include "hc_documentcreatecomment.hpp" +#include "hc_documentcreatedocumentfragment.hpp" +#include "hc_documentcreateelement.hpp" +#include "hc_documentcreateelementcasesensitive.hpp" +#include "hc_documentcreatetextnode.hpp" +#include "hc_documentgetdoctype.hpp" +#include "hc_documentgetelementsbytagnamelength.hpp" +#include "hc_documentgetelementsbytagnametotallength.hpp" +#include "hc_documentgetelementsbytagnamevalue.hpp" +#include "hc_documentgetimplementation.hpp" +#include "hc_documentgetrootnode.hpp" +#include "hc_documentinvalidcharacterexceptioncreateattribute.hpp" +#include "hc_documentinvalidcharacterexceptioncreateattribute1.hpp" +#include "hc_documentinvalidcharacterexceptioncreateelement.hpp" +#include "hc_documentinvalidcharacterexceptioncreateelement1.hpp" +#include "hc_domimplementationfeaturenoversion.hpp" +#include "hc_domimplementationfeaturenull.hpp" +#include "hc_domimplementationfeaturexml.hpp" +#include "hc_elementaddnewattribute.hpp" +#include "hc_elementassociatedattribute.hpp" +#include "hc_elementchangeattributevalue.hpp" +#include "hc_elementcreatenewattribute.hpp" +#include "hc_elementgetattributenode.hpp" +#include "hc_elementgetattributenodenull.hpp" +#include "hc_elementgetelementempty.hpp" +#include "hc_elementgetelementsbytagname.hpp" +#include "hc_elementgetelementsbytagnameaccessnodelist.hpp" +#include "hc_elementgetelementsbytagnamenomatch.hpp" +#include "hc_elementgetelementsbytagnamespecialvalue.hpp" +#include "hc_elementgettagname.hpp" +#include "hc_elementinuseattributeerr.hpp" +#include "hc_elementinvalidcharacterexception.hpp" +#include "hc_elementinvalidcharacterexception1.hpp" +#include "hc_elementnormalize.hpp" +#include "hc_elementnormalize2.hpp" +#include "hc_elementnotfounderr.hpp" +#include "hc_elementremoveattribute.hpp" +#include "hc_elementremoveattributeaftercreate.hpp" +#include "hc_elementremoveattributenode.hpp" +#include "hc_elementreplaceattributewithself.hpp" +#include "hc_elementreplaceexistingattribute.hpp" +#include "hc_elementreplaceexistingattributegevalue.hpp" +#include "hc_elementretrieveallattributes.hpp" +#include "hc_elementretrieveattrvalue.hpp" +#include "hc_elementretrievetagname.hpp" +#include "hc_elementsetattributenodenull.hpp" +#include "hc_elementwrongdocumenterr.hpp" +#include "hc_entitiesremovenameditem1.hpp" +#include "hc_entitiessetnameditem1.hpp" +#include "hc_namednodemapchildnoderange.hpp" +#include "hc_namednodemapgetnameditem.hpp" +#include "hc_namednodemapinuseattributeerr.hpp" +#include "hc_namednodemapnotfounderr.hpp" +#include "hc_namednodemapnumberofnodes.hpp" +#include "hc_namednodemapremovenameditem.hpp" +#include "hc_namednodemapreturnattrnode.hpp" +#include "hc_namednodemapreturnfirstitem.hpp" +#include "hc_namednodemapreturnlastitem.hpp" +#include "hc_namednodemapreturnnull.hpp" +#include "hc_namednodemapsetnameditem.hpp" +#include "hc_namednodemapsetnameditemreturnvalue.hpp" +#include "hc_namednodemapsetnameditemthatexists.hpp" +#include "hc_namednodemapsetnameditemwithnewvalue.hpp" +#include "hc_namednodemapwrongdocumenterr.hpp" +#include "hc_nodeappendchild.hpp" +#include "hc_nodeappendchildchildexists.hpp" +#include "hc_nodeappendchilddocfragment.hpp" +#include "hc_nodeappendchildgetnodename.hpp" +#include "hc_nodeappendchildinvalidnodetype.hpp" +#include "hc_nodeappendchildnewchilddiffdocument.hpp" +#include "hc_nodeappendchildnodeancestor.hpp" +#include "hc_nodeattributenodeattribute.hpp" +#include "hc_nodeattributenodename.hpp" +#include "hc_nodeattributenodetype.hpp" +#include "hc_nodeattributenodevalue.hpp" +#include "hc_nodechildnodes.hpp" +#include "hc_nodechildnodesappendchild.hpp" +#include "hc_nodechildnodesempty.hpp" +#include "hc_nodecloneattributescopied.hpp" +#include "hc_nodeclonefalsenocopytext.hpp" +#include "hc_nodeclonegetparentnull.hpp" +#include "hc_nodeclonenodefalse.hpp" +#include "hc_nodeclonenodetrue.hpp" +#include "hc_nodeclonetruecopytext.hpp" +#include "hc_nodecommentnodeattributes.hpp" +#include "hc_nodecommentnodename.hpp" +#include "hc_nodecommentnodetype.hpp" +#include "hc_nodecommentnodevalue.hpp" +#include "hc_nodedocumentfragmentnodename.hpp" +#include "hc_nodedocumentfragmentnodetype.hpp" +#include "hc_nodedocumentfragmentnodevalue.hpp" +#include "hc_nodedocumentnodeattribute.hpp" +#include "hc_nodedocumentnodename.hpp" +#include "hc_nodedocumentnodetype.hpp" +#include "hc_nodedocumentnodevalue.hpp" +#include "hc_nodeelementnodeattributes.hpp" +#include "hc_nodeelementnodename.hpp" +#include "hc_nodeelementnodetype.hpp" +#include "hc_nodeelementnodevalue.hpp" +#include "hc_nodegetfirstchild.hpp" +#include "hc_nodegetfirstchildnull.hpp" +#include "hc_nodegetlastchild.hpp" +#include "hc_nodegetlastchildnull.hpp" +#include "hc_nodegetnextsibling.hpp" +#include "hc_nodegetnextsiblingnull.hpp" +#include "hc_nodegetownerdocument.hpp" +#include "hc_nodegetownerdocumentnull.hpp" +#include "hc_nodegetprevioussibling.hpp" +#include "hc_nodegetprevioussiblingnull.hpp" +#include "hc_nodehaschildnodes.hpp" +#include "hc_nodehaschildnodesfalse.hpp" +#include "hc_nodeinsertbefore.hpp" +#include "hc_nodeinsertbeforedocfragment.hpp" +#include "hc_nodeinsertbeforeinvalidnodetype.hpp" +#include "hc_nodeinsertbeforenewchilddiffdocument.hpp" +#include "hc_nodeinsertbeforenewchildexists.hpp" +#include "hc_nodeinsertbeforenodeancestor.hpp" +#include "hc_nodeinsertbeforenodename.hpp" +#include "hc_nodeinsertbeforerefchildnonexistent.hpp" +#include "hc_nodeinsertbeforerefchildnull.hpp" +#include "hc_nodelistindexequalzero.hpp" +#include "hc_nodelistindexgetlength.hpp" +#include "hc_nodelistindexgetlengthofemptylist.hpp" +#include "hc_nodelistindexnotzero.hpp" +#include "hc_nodelistreturnfirstitem.hpp" +#include "hc_nodelistreturnlastitem.hpp" +#include "hc_nodelisttraverselist.hpp" +#include "hc_nodeparentnode.hpp" +#include "hc_nodeparentnodenull.hpp" +#include "hc_noderemovechild.hpp" +#include "hc_noderemovechildgetnodename.hpp" +#include "hc_noderemovechildnode.hpp" +#include "hc_noderemovechildoldchildnonexistent.hpp" +#include "hc_nodereplacechild.hpp" +#include "hc_nodereplacechildinvalidnodetype.hpp" +#include "hc_nodereplacechildnewchilddiffdocument.hpp" +#include "hc_nodereplacechildnewchildexists.hpp" +#include "hc_nodereplacechildnodeancestor.hpp" +#include "hc_nodereplacechildnodename.hpp" +#include "hc_nodereplacechildoldchildnonexistent.hpp" +#include "hc_nodetextnodeattribute.hpp" +#include "hc_nodetextnodename.hpp" +#include "hc_nodetextnodetype.hpp" +#include "hc_nodetextnodevalue.hpp" +#include "hc_nodevalue01.hpp" +#include "hc_nodevalue02.hpp" +#include "hc_nodevalue03.hpp" +#include "hc_nodevalue04.hpp" +#include "hc_nodevalue05.hpp" +#include "hc_nodevalue06.hpp" +#include "hc_nodevalue07.hpp" +#include "hc_nodevalue08.hpp" +#include "hc_notationsremovenameditem1.hpp" +#include "hc_notationssetnameditem1.hpp" +#include "hc_textindexsizeerrnegativeoffset.hpp" +#include "hc_textindexsizeerroffsetoutofbounds.hpp" +#include "hc_textparseintolistofelements.hpp" +#include "hc_textsplittextfour.hpp" +#include "hc_textsplittextone.hpp" +#include "hc_textsplittextthree.hpp" +#include "hc_textsplittexttwo.hpp" +#include "hc_textwithnomarkup.hpp" +#include "hc_attrappendchild1.hpp" +#include "hc_attrappendchild2.hpp" +#include "hc_attrappendchild3.hpp" +#include "hc_attrappendchild4.hpp" +#include "hc_attrappendchild5.hpp" +#include "hc_attrappendchild6.hpp" +#include "hc_attrchildnodes1.hpp" +#include "hc_attrchildnodes2.hpp" +#include "hc_attrclonenode1.hpp" +#include "hc_attrfirstchild.hpp" +#include "hc_attrgetvalue1.hpp" +#include "hc_attrgetvalue2.hpp" +#include "hc_attrhaschildnodes.hpp" +#include "hc_attrinsertbefore1.hpp" +#include "hc_attrinsertbefore2.hpp" +#include "hc_attrinsertbefore3.hpp" +#include "hc_attrinsertbefore4.hpp" +#include "hc_attrinsertbefore5.hpp" +#include "hc_attrinsertbefore6.hpp" +#include "hc_attrinsertbefore7.hpp" +#include "hc_attrlastchild.hpp" +#include "hc_attrnormalize.hpp" +#include "hc_attrremovechild1.hpp" +#include "hc_attrremovechild2.hpp" +#include "hc_attrreplacechild1.hpp" +#include "hc_attrreplacechild2.hpp" +#include "hc_attrsetvalue1.hpp" +#include "hc_attrsetvalue2.hpp" +#include "attrremovechild1.hpp" +#include "attrreplacechild1.hpp" + +template +TestSuite* DOM_Level_1_Core_Test_Suite() +{ + TestSuite* suiteOfTests = new TestSuite; + suiteOfTests->addTest(new TestCaller >("attrcreatedocumentfragment::test", &attrcreatedocumentfragment::runTest)); + suiteOfTests->addTest(new TestCaller >("attrcreatetextnode::test", &attrcreatetextnode::runTest)); + suiteOfTests->addTest(new TestCaller >("attrcreatetextnode2::test", &attrcreatetextnode2::runTest)); + suiteOfTests->addTest(new TestCaller >("attrdefaultvalue::test", &attrdefaultvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("attreffectivevalue::test", &attreffectivevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("attrentityreplacement::test", &attrentityreplacement::runTest)); + suiteOfTests->addTest(new TestCaller >("attrname::test", &attrname::runTest)); + suiteOfTests->addTest(new TestCaller >("attrnextsiblingnull::test", &attrnextsiblingnull::runTest)); + suiteOfTests->addTest(new TestCaller >("attrnotspecifiedvalue::test", &attrnotspecifiedvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("attrparentnodenull::test", &attrparentnodenull::runTest)); + suiteOfTests->addTest(new TestCaller >("attrprevioussiblingnull::test", &attrprevioussiblingnull::runTest)); + suiteOfTests->addTest(new TestCaller >("attrsetvaluenomodificationallowederr::test", &attrsetvaluenomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("attrsetvaluenomodificationallowederrEE::test", &attrsetvaluenomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("attrspecifiedvalue::test", &attrspecifiedvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("attrspecifiedvaluechanged::test", &attrspecifiedvaluechanged::runTest)); + suiteOfTests->addTest(new TestCaller >("attrspecifiedvalueremove::test", &attrspecifiedvalueremove::runTest)); + suiteOfTests->addTest(new TestCaller >("cdatasectiongetdata::test", &cdatasectiongetdata::runTest)); + suiteOfTests->addTest(new TestCaller >("cdatasectionnormalize::test", &cdatasectionnormalize::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataappenddata::test", &characterdataappenddata::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataappenddatagetdata::test", &characterdataappenddatagetdata::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataappenddatanomodificationallowederr::test", &characterdataappenddatanomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataappenddatanomodificationallowederrEE::test", &characterdataappenddatanomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatadeletedatabegining::test", &characterdatadeletedatabegining::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatadeletedataend::test", &characterdatadeletedataend::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatadeletedataexceedslength::test", &characterdatadeletedataexceedslength::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatadeletedatagetlengthanddata::test", &characterdatadeletedatagetlengthanddata::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatadeletedatamiddle::test", &characterdatadeletedatamiddle::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatadeletedatanomodificationallowederr::test", &characterdatadeletedatanomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatadeletedatanomodificationallowederrEE::test", &characterdatadeletedatanomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatagetdata::test", &characterdatagetdata::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatagetlength::test", &characterdatagetlength::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrdeletedatacountnegative::test", &characterdataindexsizeerrdeletedatacountnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrdeletedataoffsetgreater::test", &characterdataindexsizeerrdeletedataoffsetgreater::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrdeletedataoffsetnegative::test", &characterdataindexsizeerrdeletedataoffsetnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrinsertdataoffsetgreater::test", &characterdataindexsizeerrinsertdataoffsetgreater::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrinsertdataoffsetnegative::test", &characterdataindexsizeerrinsertdataoffsetnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrreplacedatacountnegative::test", &characterdataindexsizeerrreplacedatacountnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrreplacedataoffsetgreater::test", &characterdataindexsizeerrreplacedataoffsetgreater::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrreplacedataoffsetnegative::test", &characterdataindexsizeerrreplacedataoffsetnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrsubstringcountnegative::test", &characterdataindexsizeerrsubstringcountnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrsubstringnegativeoffset::test", &characterdataindexsizeerrsubstringnegativeoffset::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdataindexsizeerrsubstringoffsetgreater::test", &characterdataindexsizeerrsubstringoffsetgreater::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatainsertdatabeginning::test", &characterdatainsertdatabeginning::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatainsertdataend::test", &characterdatainsertdataend::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatainsertdatamiddle::test", &characterdatainsertdatamiddle::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatainsertdatanomodificationallowederr::test", &characterdatainsertdatanomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatainsertdatanomodificationallowederrEE::test", &characterdatainsertdatanomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatareplacedatabegining::test", &characterdatareplacedatabegining::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatareplacedataend::test", &characterdatareplacedataend::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatareplacedataexceedslengthofarg::test", &characterdatareplacedataexceedslengthofarg::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatareplacedataexceedslengthofdata::test", &characterdatareplacedataexceedslengthofdata::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatareplacedatamiddle::test", &characterdatareplacedatamiddle::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatareplacedatanomodificationallowederr::test", &characterdatareplacedatanomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatareplacedatanomodificationallowederrEE::test", &characterdatareplacedatanomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatasetdatanomodificationallowederr::test", &characterdatasetdatanomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatasetdatanomodificationallowederrEE::test", &characterdatasetdatanomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatasetnodevalue::test", &characterdatasetnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatasubstringexceedsvalue::test", &characterdatasubstringexceedsvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("characterdatasubstringvalue::test", &characterdatasubstringvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("commentgetcomment::test", &commentgetcomment::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreateattribute::test", &documentcreateattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreatecdatasection::test", &documentcreatecdatasection::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreatecomment::test", &documentcreatecomment::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreatedocumentfragment::test", &documentcreatedocumentfragment::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreateelement::test", &documentcreateelement::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreateelementcasesensitive::test", &documentcreateelementcasesensitive::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreateelementdefaultattr::test", &documentcreateelementdefaultattr::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreateentityreference::test", &documentcreateentityreference::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreateentityreferenceknown::test", &documentcreateentityreferenceknown::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreateprocessinginstruction::test", &documentcreateprocessinginstruction::runTest)); + suiteOfTests->addTest(new TestCaller >("documentcreatetextnode::test", &documentcreatetextnode::runTest)); + suiteOfTests->addTest(new TestCaller >("documentgetdoctype::test", &documentgetdoctype::runTest)); + suiteOfTests->addTest(new TestCaller >("documentgetdoctypenodtd::test", &documentgetdoctypenodtd::runTest)); + suiteOfTests->addTest(new TestCaller >("documentgetelementsbytagnamelength::test", &documentgetelementsbytagnamelength::runTest)); + suiteOfTests->addTest(new TestCaller >("documentgetelementsbytagnametotallength::test", &documentgetelementsbytagnametotallength::runTest)); + suiteOfTests->addTest(new TestCaller >("documentgetelementsbytagnamevalue::test", &documentgetelementsbytagnamevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("documentgetimplementation::test", &documentgetimplementation::runTest)); + suiteOfTests->addTest(new TestCaller >("documentgetrootnode::test", &documentgetrootnode::runTest)); + suiteOfTests->addTest(new TestCaller >("documentinvalidcharacterexceptioncreateattribute::test", &documentinvalidcharacterexceptioncreateattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("documentinvalidcharacterexceptioncreateelement::test", &documentinvalidcharacterexceptioncreateelement::runTest)); + suiteOfTests->addTest(new TestCaller >("documentinvalidcharacterexceptioncreateentref::test", &documentinvalidcharacterexceptioncreateentref::runTest)); + suiteOfTests->addTest(new TestCaller >("documentinvalidcharacterexceptioncreateentref1::test", &documentinvalidcharacterexceptioncreateentref1::runTest)); + suiteOfTests->addTest(new TestCaller >("documentinvalidcharacterexceptioncreatepi::test", &documentinvalidcharacterexceptioncreatepi::runTest)); + suiteOfTests->addTest(new TestCaller >("documentinvalidcharacterexceptioncreatepi1::test", &documentinvalidcharacterexceptioncreatepi1::runTest)); + suiteOfTests->addTest(new TestCaller >("documenttypegetdoctype::test", &documenttypegetdoctype::runTest)); + suiteOfTests->addTest(new TestCaller >("documenttypegetentities::test", &documenttypegetentities::runTest)); + suiteOfTests->addTest(new TestCaller >("documenttypegetentitieslength::test", &documenttypegetentitieslength::runTest)); + suiteOfTests->addTest(new TestCaller >("documenttypegetentitiestype::test", &documenttypegetentitiestype::runTest)); + suiteOfTests->addTest(new TestCaller >("documenttypegetnotations::test", &documenttypegetnotations::runTest)); + suiteOfTests->addTest(new TestCaller >("documenttypegetnotationstype::test", &documenttypegetnotationstype::runTest)); + suiteOfTests->addTest(new TestCaller >("domimplementationfeaturenoversion::test", &domimplementationfeaturenoversion::runTest)); + suiteOfTests->addTest(new TestCaller >("domimplementationfeaturenull::test", &domimplementationfeaturenull::runTest)); + suiteOfTests->addTest(new TestCaller >("domimplementationfeaturexml::test", &domimplementationfeaturexml::runTest)); + suiteOfTests->addTest(new TestCaller >("elementaddnewattribute::test", &elementaddnewattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("elementassociatedattribute::test", &elementassociatedattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("elementchangeattributevalue::test", &elementchangeattributevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("elementcreatenewattribute::test", &elementcreatenewattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("elementgetattributenode::test", &elementgetattributenode::runTest)); + suiteOfTests->addTest(new TestCaller >("elementgetattributenodenull::test", &elementgetattributenodenull::runTest)); + suiteOfTests->addTest(new TestCaller >("elementgetelementempty::test", &elementgetelementempty::runTest)); + suiteOfTests->addTest(new TestCaller >("elementgetelementsbytagname::test", &elementgetelementsbytagname::runTest)); + suiteOfTests->addTest(new TestCaller >("elementgetelementsbytagnameaccessnodelist::test", &elementgetelementsbytagnameaccessnodelist::runTest)); + suiteOfTests->addTest(new TestCaller >("elementgetelementsbytagnamenomatch::test", &elementgetelementsbytagnamenomatch::runTest)); + suiteOfTests->addTest(new TestCaller >("elementgetelementsbytagnamespecialvalue::test", &elementgetelementsbytagnamespecialvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("elementgettagname::test", &elementgettagname::runTest)); + suiteOfTests->addTest(new TestCaller >("elementinuseattributeerr::test", &elementinuseattributeerr::runTest)); + suiteOfTests->addTest(new TestCaller >("elementinvalidcharacterexception::test", &elementinvalidcharacterexception::runTest)); + suiteOfTests->addTest(new TestCaller >("elementnormalize::test", &elementnormalize::runTest)); + suiteOfTests->addTest(new TestCaller >("elementnotfounderr::test", &elementnotfounderr::runTest)); + suiteOfTests->addTest(new TestCaller >("elementremoveattribute::test", &elementremoveattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("elementremoveattributeaftercreate::test", &elementremoveattributeaftercreate::runTest)); + suiteOfTests->addTest(new TestCaller >("elementremoveattributenode::test", &elementremoveattributenode::runTest)); + suiteOfTests->addTest(new TestCaller >("elementremoveattributenodenomodificationallowederr::test", &elementremoveattributenodenomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("elementremoveattributenodenomodificationallowederrEE::test", &elementremoveattributenodenomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("elementremoveattributenomodificationallowederr::test", &elementremoveattributenomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("elementremoveattributenomodificationallowederrEE::test", &elementremoveattributenomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("elementremoveattributerestoredefaultvalue::test", &elementremoveattributerestoredefaultvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("elementreplaceattributewithself::test", &elementreplaceattributewithself::runTest)); + suiteOfTests->addTest(new TestCaller >("elementreplaceexistingattribute::test", &elementreplaceexistingattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("elementreplaceexistingattributegevalue::test", &elementreplaceexistingattributegevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("elementretrieveallattributes::test", &elementretrieveallattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("elementretrieveattrvalue::test", &elementretrieveattrvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("elementretrievetagname::test", &elementretrievetagname::runTest)); + suiteOfTests->addTest(new TestCaller >("elementsetattributenodenomodificationallowederr::test", &elementsetattributenodenomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("elementsetattributenodenomodificationallowederrEE::test", &elementsetattributenodenomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("elementsetattributenodenull::test", &elementsetattributenodenull::runTest)); + suiteOfTests->addTest(new TestCaller >("elementsetattributenomodificationallowederr::test", &elementsetattributenomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("elementsetattributenomodificationallowederrEE::test", &elementsetattributenomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("elementwrongdocumenterr::test", &elementwrongdocumenterr::runTest)); + suiteOfTests->addTest(new TestCaller >("entitygetentityname::test", &entitygetentityname::runTest)); + suiteOfTests->addTest(new TestCaller >("entitygetpublicid::test", &entitygetpublicid::runTest)); + suiteOfTests->addTest(new TestCaller >("entitygetpublicidnull::test", &entitygetpublicidnull::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapchildnoderange::test", &namednodemapchildnoderange::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapgetnameditem::test", &namednodemapgetnameditem::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapinuseattributeerr::test", &namednodemapinuseattributeerr::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapnotfounderr::test", &namednodemapnotfounderr::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapnumberofnodes::test", &namednodemapnumberofnodes::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapremovenameditem::test", &namednodemapremovenameditem::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapremovenameditemgetvalue::test", &namednodemapremovenameditemgetvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapremovenameditemreturnnodevalue::test", &namednodemapremovenameditemreturnnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapreturnattrnode::test", &namednodemapreturnattrnode::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapreturnfirstitem::test", &namednodemapreturnfirstitem::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapreturnlastitem::test", &namednodemapreturnlastitem::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapreturnnull::test", &namednodemapreturnnull::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapsetnameditem::test", &namednodemapsetnameditem::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapsetnameditemreturnvalue::test", &namednodemapsetnameditemreturnvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapsetnameditemthatexists::test", &namednodemapsetnameditemthatexists::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapsetnameditemwithnewvalue::test", &namednodemapsetnameditemwithnewvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("namednodemapwrongdocumenterr::test", &namednodemapwrongdocumenterr::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchild::test", &nodeappendchild::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchildchildexists::test", &nodeappendchildchildexists::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchilddocfragment::test", &nodeappendchilddocfragment::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchildgetnodename::test", &nodeappendchildgetnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchildinvalidnodetype::test", &nodeappendchildinvalidnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchildnewchilddiffdocument::test", &nodeappendchildnewchilddiffdocument::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchildnodeancestor::test", &nodeappendchildnodeancestor::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchildnomodificationallowederr::test", &nodeappendchildnomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeappendchildnomodificationallowederrEE::test", &nodeappendchildnomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeattributenodeattribute::test", &nodeattributenodeattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeattributenodename::test", &nodeattributenodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeattributenodetype::test", &nodeattributenodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeattributenodevalue::test", &nodeattributenodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecdatasectionnodeattribute::test", &nodecdatasectionnodeattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecdatasectionnodename::test", &nodecdatasectionnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecdatasectionnodetype::test", &nodecdatasectionnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecdatasectionnodevalue::test", &nodecdatasectionnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodechildnodes::test", &nodechildnodes::runTest)); + suiteOfTests->addTest(new TestCaller >("nodechildnodesappendchild::test", &nodechildnodesappendchild::runTest)); + suiteOfTests->addTest(new TestCaller >("nodechildnodesempty::test", &nodechildnodesempty::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecloneattributescopied::test", &nodecloneattributescopied::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeclonefalsenocopytext::test", &nodeclonefalsenocopytext::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeclonegetparentnull::test", &nodeclonegetparentnull::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeclonenodefalse::test", &nodeclonenodefalse::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeclonenodetrue::test", &nodeclonenodetrue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeclonetruecopytext::test", &nodeclonetruecopytext::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecommentnodeattributes::test", &nodecommentnodeattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecommentnodename::test", &nodecommentnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecommentnodetype::test", &nodecommentnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodecommentnodevalue::test", &nodecommentnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumentfragmentnodename::test", &nodedocumentfragmentnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumentfragmentnodetype::test", &nodedocumentfragmentnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumentfragmentnodevalue::test", &nodedocumentfragmentnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumentnodeattribute::test", &nodedocumentnodeattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumentnodename::test", &nodedocumentnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumentnodetype::test", &nodedocumentnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumentnodevalue::test", &nodedocumentnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumenttypenodename::test", &nodedocumenttypenodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumenttypenodetype::test", &nodedocumenttypenodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodedocumenttypenodevalue::test", &nodedocumenttypenodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeelementnodeattributes::test", &nodeelementnodeattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeelementnodename::test", &nodeelementnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeelementnodetype::test", &nodeelementnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeelementnodevalue::test", &nodeelementnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentitynodeattributes::test", &nodeentitynodeattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentitynodename::test", &nodeentitynodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentitynodetype::test", &nodeentitynodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentitynodevalue::test", &nodeentitynodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentitysetnodevalue::test", &nodeentitysetnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentityreferencenodeattributes::test", &nodeentityreferencenodeattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentityreferencenodename::test", &nodeentityreferencenodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentityreferencenodetype::test", &nodeentityreferencenodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeentityreferencenodevalue::test", &nodeentityreferencenodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetfirstchild::test", &nodegetfirstchild::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetfirstchildnull::test", &nodegetfirstchildnull::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetlastchild::test", &nodegetlastchild::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetlastchildnull::test", &nodegetlastchildnull::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetnextsibling::test", &nodegetnextsibling::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetnextsiblingnull::test", &nodegetnextsiblingnull::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetownerdocument::test", &nodegetownerdocument::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetownerdocumentnull::test", &nodegetownerdocumentnull::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetprevioussibling::test", &nodegetprevioussibling::runTest)); + suiteOfTests->addTest(new TestCaller >("nodegetprevioussiblingnull::test", &nodegetprevioussiblingnull::runTest)); + suiteOfTests->addTest(new TestCaller >("nodehaschildnodes::test", &nodehaschildnodes::runTest)); + suiteOfTests->addTest(new TestCaller >("nodehaschildnodesfalse::test", &nodehaschildnodesfalse::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbefore::test", &nodeinsertbefore::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforedocfragment::test", &nodeinsertbeforedocfragment::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforeinvalidnodetype::test", &nodeinsertbeforeinvalidnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforenewchilddiffdocument::test", &nodeinsertbeforenewchilddiffdocument::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforenewchildexists::test", &nodeinsertbeforenewchildexists::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforenodeancestor::test", &nodeinsertbeforenodeancestor::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforenodename::test", &nodeinsertbeforenodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforenomodificationallowederr::test", &nodeinsertbeforenomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforenomodificationallowederrEE::test", &nodeinsertbeforenomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforerefchildnonexistent::test", &nodeinsertbeforerefchildnonexistent::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeinsertbeforerefchildnull::test", &nodeinsertbeforerefchildnull::runTest)); + suiteOfTests->addTest(new TestCaller >("nodelistindexequalzero::test", &nodelistindexequalzero::runTest)); + suiteOfTests->addTest(new TestCaller >("nodelistindexgetlength::test", &nodelistindexgetlength::runTest)); + suiteOfTests->addTest(new TestCaller >("nodelistindexgetlengthofemptylist::test", &nodelistindexgetlengthofemptylist::runTest)); + suiteOfTests->addTest(new TestCaller >("nodelistindexnotzero::test", &nodelistindexnotzero::runTest)); + suiteOfTests->addTest(new TestCaller >("nodelistreturnfirstitem::test", &nodelistreturnfirstitem::runTest)); + suiteOfTests->addTest(new TestCaller >("nodelistreturnlastitem::test", &nodelistreturnlastitem::runTest)); + suiteOfTests->addTest(new TestCaller >("nodelisttraverselist::test", &nodelisttraverselist::runTest)); + suiteOfTests->addTest(new TestCaller >("nodenotationnodeattributes::test", &nodenotationnodeattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("nodenotationnodename::test", &nodenotationnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodenotationnodetype::test", &nodenotationnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodenotationnodevalue::test", &nodenotationnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeparentnode::test", &nodeparentnode::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeparentnodenull::test", &nodeparentnodenull::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeprocessinginstructionnodeattributes::test", &nodeprocessinginstructionnodeattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeprocessinginstructionnodename::test", &nodeprocessinginstructionnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeprocessinginstructionnodetype::test", &nodeprocessinginstructionnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeprocessinginstructionnodevalue::test", &nodeprocessinginstructionnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("nodeprocessinginstructionsetnodevalue::test", &nodeprocessinginstructionsetnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("noderemovechild::test", &noderemovechild::runTest)); + suiteOfTests->addTest(new TestCaller >("noderemovechildgetnodename::test", &noderemovechildgetnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("noderemovechildnode::test", &noderemovechildnode::runTest)); + suiteOfTests->addTest(new TestCaller >("noderemovechildnomodificationallowederr::test", &noderemovechildnomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("noderemovechildnomodificationallowederrEE::test", &noderemovechildnomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("noderemovechildoldchildnonexistent::test", &noderemovechildoldchildnonexistent::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechild::test", &nodereplacechild::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechildinvalidnodetype::test", &nodereplacechildinvalidnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechildnewchilddiffdocument::test", &nodereplacechildnewchilddiffdocument::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechildnewchildexists::test", &nodereplacechildnewchildexists::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechildnodeancestor::test", &nodereplacechildnodeancestor::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechildnodename::test", &nodereplacechildnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechildnomodificationallowederr::test", &nodereplacechildnomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechildnomodificationallowederrEE::test", &nodereplacechildnomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("nodereplacechildoldchildnonexistent::test", &nodereplacechildoldchildnonexistent::runTest)); + suiteOfTests->addTest(new TestCaller >("nodesetnodevaluenomodificationallowederr::test", &nodesetnodevaluenomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("nodesetnodevaluenomodificationallowederrEE::test", &nodesetnodevaluenomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("nodetextnodeattribute::test", &nodetextnodeattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("nodetextnodename::test", &nodetextnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("nodetextnodetype::test", &nodetextnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("nodetextnodevalue::test", &nodetextnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("notationgetnotationname::test", ¬ationgetnotationname::runTest)); + suiteOfTests->addTest(new TestCaller >("notationgetpublicid::test", ¬ationgetpublicid::runTest)); + suiteOfTests->addTest(new TestCaller >("notationgetpublicidnull::test", ¬ationgetpublicidnull::runTest)); + suiteOfTests->addTest(new TestCaller >("notationgetsystemid::test", ¬ationgetsystemid::runTest)); + suiteOfTests->addTest(new TestCaller >("notationgetsystemidnull::test", ¬ationgetsystemidnull::runTest)); + suiteOfTests->addTest(new TestCaller >("processinginstructiongetdata::test", &processinginstructiongetdata::runTest)); + suiteOfTests->addTest(new TestCaller >("processinginstructiongettarget::test", &processinginstructiongettarget::runTest)); + suiteOfTests->addTest(new TestCaller >("processinginstructionsetdatanomodificationallowederr::test", &processinginstructionsetdatanomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("processinginstructionsetdatanomodificationallowederrEE::test", &processinginstructionsetdatanomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("textindexsizeerrnegativeoffset::test", &textindexsizeerrnegativeoffset::runTest)); + suiteOfTests->addTest(new TestCaller >("textindexsizeerroffsetoutofbounds::test", &textindexsizeerroffsetoutofbounds::runTest)); + suiteOfTests->addTest(new TestCaller >("textparseintolistofelements::test", &textparseintolistofelements::runTest)); + suiteOfTests->addTest(new TestCaller >("textsplittextfour::test", &textsplittextfour::runTest)); + suiteOfTests->addTest(new TestCaller >("textsplittextnomodificationallowederr::test", &textsplittextnomodificationallowederr::runTest)); + suiteOfTests->addTest(new TestCaller >("textsplittextnomodificationallowederrEE::test", &textsplittextnomodificationallowederrEE::runTest)); + suiteOfTests->addTest(new TestCaller >("textsplittextone::test", &textsplittextone::runTest)); + suiteOfTests->addTest(new TestCaller >("textsplittextthree::test", &textsplittextthree::runTest)); + suiteOfTests->addTest(new TestCaller >("textsplittexttwo::test", &textsplittexttwo::runTest)); + suiteOfTests->addTest(new TestCaller >("textwithnomarkup::test", &textwithnomarkup::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue01::test", &nodevalue01::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue02::test", &nodevalue02::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue03::test", &nodevalue03::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue04::test", &nodevalue04::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue05::test", &nodevalue05::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue06::test", &nodevalue06::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue07::test", &nodevalue07::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue08::test", &nodevalue08::runTest)); + suiteOfTests->addTest(new TestCaller >("nodevalue09::test", &nodevalue09::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrcreatedocumentfragment::test", &hc_attrcreatedocumentfragment::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrcreatetextnode::test", &hc_attrcreatetextnode::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrcreatetextnode2::test", &hc_attrcreatetextnode2::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attreffectivevalue::test", &hc_attreffectivevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrname::test", &hc_attrname::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrnextsiblingnull::test", &hc_attrnextsiblingnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrparentnodenull::test", &hc_attrparentnodenull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrprevioussiblingnull::test", &hc_attrprevioussiblingnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrspecifiedvalue::test", &hc_attrspecifiedvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrspecifiedvaluechanged::test", &hc_attrspecifiedvaluechanged::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataappenddata::test", &hc_characterdataappenddata::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataappenddatagetdata::test", &hc_characterdataappenddatagetdata::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatadeletedatabegining::test", &hc_characterdatadeletedatabegining::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatadeletedataend::test", &hc_characterdatadeletedataend::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatadeletedataexceedslength::test", &hc_characterdatadeletedataexceedslength::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatadeletedatagetlengthanddata::test", &hc_characterdatadeletedatagetlengthanddata::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatadeletedatamiddle::test", &hc_characterdatadeletedatamiddle::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatagetdata::test", &hc_characterdatagetdata::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatagetlength::test", &hc_characterdatagetlength::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrdeletedatacountnegative::test", &hc_characterdataindexsizeerrdeletedatacountnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrdeletedataoffsetgreater::test", &hc_characterdataindexsizeerrdeletedataoffsetgreater::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrdeletedataoffsetnegative::test", &hc_characterdataindexsizeerrdeletedataoffsetnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrinsertdataoffsetgreater::test", &hc_characterdataindexsizeerrinsertdataoffsetgreater::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrinsertdataoffsetnegative::test", &hc_characterdataindexsizeerrinsertdataoffsetnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrreplacedatacountnegative::test", &hc_characterdataindexsizeerrreplacedatacountnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrreplacedataoffsetgreater::test", &hc_characterdataindexsizeerrreplacedataoffsetgreater::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrreplacedataoffsetnegative::test", &hc_characterdataindexsizeerrreplacedataoffsetnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrsubstringcountnegative::test", &hc_characterdataindexsizeerrsubstringcountnegative::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrsubstringnegativeoffset::test", &hc_characterdataindexsizeerrsubstringnegativeoffset::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdataindexsizeerrsubstringoffsetgreater::test", &hc_characterdataindexsizeerrsubstringoffsetgreater::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatainsertdatabeginning::test", &hc_characterdatainsertdatabeginning::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatainsertdataend::test", &hc_characterdatainsertdataend::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatainsertdatamiddle::test", &hc_characterdatainsertdatamiddle::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatareplacedatabegining::test", &hc_characterdatareplacedatabegining::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatareplacedataend::test", &hc_characterdatareplacedataend::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatareplacedataexceedslengthofarg::test", &hc_characterdatareplacedataexceedslengthofarg::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatareplacedataexceedslengthofdata::test", &hc_characterdatareplacedataexceedslengthofdata::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatareplacedatamiddle::test", &hc_characterdatareplacedatamiddle::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatasetnodevalue::test", &hc_characterdatasetnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatasubstringexceedsvalue::test", &hc_characterdatasubstringexceedsvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_characterdatasubstringvalue::test", &hc_characterdatasubstringvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_commentgetcomment::test", &hc_commentgetcomment::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentcreateattribute::test", &hc_documentcreateattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentcreatecomment::test", &hc_documentcreatecomment::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentcreatedocumentfragment::test", &hc_documentcreatedocumentfragment::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentcreateelement::test", &hc_documentcreateelement::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentcreateelementcasesensitive::test", &hc_documentcreateelementcasesensitive::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentcreatetextnode::test", &hc_documentcreatetextnode::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentgetdoctype::test", &hc_documentgetdoctype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentgetelementsbytagnamelength::test", &hc_documentgetelementsbytagnamelength::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentgetelementsbytagnametotallength::test", &hc_documentgetelementsbytagnametotallength::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentgetelementsbytagnamevalue::test", &hc_documentgetelementsbytagnamevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentgetimplementation::test", &hc_documentgetimplementation::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentgetrootnode::test", &hc_documentgetrootnode::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentinvalidcharacterexceptioncreateattribute::test", &hc_documentinvalidcharacterexceptioncreateattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentinvalidcharacterexceptioncreateattribute1::test", &hc_documentinvalidcharacterexceptioncreateattribute1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentinvalidcharacterexceptioncreateelement::test", &hc_documentinvalidcharacterexceptioncreateelement::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_documentinvalidcharacterexceptioncreateelement1::test", &hc_documentinvalidcharacterexceptioncreateelement1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_domimplementationfeaturenoversion::test", &hc_domimplementationfeaturenoversion::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_domimplementationfeaturenull::test", &hc_domimplementationfeaturenull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_domimplementationfeaturexml::test", &hc_domimplementationfeaturexml::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementaddnewattribute::test", &hc_elementaddnewattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementassociatedattribute::test", &hc_elementassociatedattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementchangeattributevalue::test", &hc_elementchangeattributevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementcreatenewattribute::test", &hc_elementcreatenewattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementgetattributenode::test", &hc_elementgetattributenode::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementgetattributenodenull::test", &hc_elementgetattributenodenull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementgetelementempty::test", &hc_elementgetelementempty::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementgetelementsbytagname::test", &hc_elementgetelementsbytagname::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementgetelementsbytagnameaccessnodelist::test", &hc_elementgetelementsbytagnameaccessnodelist::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementgetelementsbytagnamenomatch::test", &hc_elementgetelementsbytagnamenomatch::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementgetelementsbytagnamespecialvalue::test", &hc_elementgetelementsbytagnamespecialvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementgettagname::test", &hc_elementgettagname::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementinuseattributeerr::test", &hc_elementinuseattributeerr::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementinvalidcharacterexception::test", &hc_elementinvalidcharacterexception::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementinvalidcharacterexception1::test", &hc_elementinvalidcharacterexception1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementnormalize::test", &hc_elementnormalize::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementnormalize2::test", &hc_elementnormalize2::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementnotfounderr::test", &hc_elementnotfounderr::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementremoveattribute::test", &hc_elementremoveattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementremoveattributeaftercreate::test", &hc_elementremoveattributeaftercreate::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementremoveattributenode::test", &hc_elementremoveattributenode::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementreplaceattributewithself::test", &hc_elementreplaceattributewithself::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementreplaceexistingattribute::test", &hc_elementreplaceexistingattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementreplaceexistingattributegevalue::test", &hc_elementreplaceexistingattributegevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementretrieveallattributes::test", &hc_elementretrieveallattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementretrieveattrvalue::test", &hc_elementretrieveattrvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementretrievetagname::test", &hc_elementretrievetagname::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementsetattributenodenull::test", &hc_elementsetattributenodenull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_elementwrongdocumenterr::test", &hc_elementwrongdocumenterr::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_entitiesremovenameditem1::test", &hc_entitiesremovenameditem1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_entitiessetnameditem1::test", &hc_entitiessetnameditem1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapchildnoderange::test", &hc_namednodemapchildnoderange::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapgetnameditem::test", &hc_namednodemapgetnameditem::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapinuseattributeerr::test", &hc_namednodemapinuseattributeerr::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapnotfounderr::test", &hc_namednodemapnotfounderr::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapnumberofnodes::test", &hc_namednodemapnumberofnodes::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapremovenameditem::test", &hc_namednodemapremovenameditem::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapreturnattrnode::test", &hc_namednodemapreturnattrnode::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapreturnfirstitem::test", &hc_namednodemapreturnfirstitem::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapreturnlastitem::test", &hc_namednodemapreturnlastitem::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapreturnnull::test", &hc_namednodemapreturnnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapsetnameditem::test", &hc_namednodemapsetnameditem::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapsetnameditemreturnvalue::test", &hc_namednodemapsetnameditemreturnvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapsetnameditemthatexists::test", &hc_namednodemapsetnameditemthatexists::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapsetnameditemwithnewvalue::test", &hc_namednodemapsetnameditemwithnewvalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_namednodemapwrongdocumenterr::test", &hc_namednodemapwrongdocumenterr::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeappendchild::test", &hc_nodeappendchild::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeappendchildchildexists::test", &hc_nodeappendchildchildexists::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeappendchilddocfragment::test", &hc_nodeappendchilddocfragment::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeappendchildgetnodename::test", &hc_nodeappendchildgetnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeappendchildinvalidnodetype::test", &hc_nodeappendchildinvalidnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeappendchildnewchilddiffdocument::test", &hc_nodeappendchildnewchilddiffdocument::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeappendchildnodeancestor::test", &hc_nodeappendchildnodeancestor::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeattributenodeattribute::test", &hc_nodeattributenodeattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeattributenodename::test", &hc_nodeattributenodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeattributenodetype::test", &hc_nodeattributenodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeattributenodevalue::test", &hc_nodeattributenodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodechildnodes::test", &hc_nodechildnodes::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodechildnodesappendchild::test", &hc_nodechildnodesappendchild::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodechildnodesempty::test", &hc_nodechildnodesempty::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodecloneattributescopied::test", &hc_nodecloneattributescopied::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeclonefalsenocopytext::test", &hc_nodeclonefalsenocopytext::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeclonegetparentnull::test", &hc_nodeclonegetparentnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeclonenodefalse::test", &hc_nodeclonenodefalse::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeclonenodetrue::test", &hc_nodeclonenodetrue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeclonetruecopytext::test", &hc_nodeclonetruecopytext::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodecommentnodeattributes::test", &hc_nodecommentnodeattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodecommentnodename::test", &hc_nodecommentnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodecommentnodetype::test", &hc_nodecommentnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodecommentnodevalue::test", &hc_nodecommentnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodedocumentfragmentnodename::test", &hc_nodedocumentfragmentnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodedocumentfragmentnodetype::test", &hc_nodedocumentfragmentnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodedocumentfragmentnodevalue::test", &hc_nodedocumentfragmentnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodedocumentnodeattribute::test", &hc_nodedocumentnodeattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodedocumentnodename::test", &hc_nodedocumentnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodedocumentnodetype::test", &hc_nodedocumentnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodedocumentnodevalue::test", &hc_nodedocumentnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeelementnodeattributes::test", &hc_nodeelementnodeattributes::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeelementnodename::test", &hc_nodeelementnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeelementnodetype::test", &hc_nodeelementnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeelementnodevalue::test", &hc_nodeelementnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetfirstchild::test", &hc_nodegetfirstchild::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetfirstchildnull::test", &hc_nodegetfirstchildnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetlastchild::test", &hc_nodegetlastchild::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetlastchildnull::test", &hc_nodegetlastchildnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetnextsibling::test", &hc_nodegetnextsibling::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetnextsiblingnull::test", &hc_nodegetnextsiblingnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetownerdocument::test", &hc_nodegetownerdocument::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetownerdocumentnull::test", &hc_nodegetownerdocumentnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetprevioussibling::test", &hc_nodegetprevioussibling::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodegetprevioussiblingnull::test", &hc_nodegetprevioussiblingnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodehaschildnodes::test", &hc_nodehaschildnodes::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodehaschildnodesfalse::test", &hc_nodehaschildnodesfalse::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbefore::test", &hc_nodeinsertbefore::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbeforedocfragment::test", &hc_nodeinsertbeforedocfragment::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbeforeinvalidnodetype::test", &hc_nodeinsertbeforeinvalidnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbeforenewchilddiffdocument::test", &hc_nodeinsertbeforenewchilddiffdocument::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbeforenewchildexists::test", &hc_nodeinsertbeforenewchildexists::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbeforenodeancestor::test", &hc_nodeinsertbeforenodeancestor::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbeforenodename::test", &hc_nodeinsertbeforenodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbeforerefchildnonexistent::test", &hc_nodeinsertbeforerefchildnonexistent::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeinsertbeforerefchildnull::test", &hc_nodeinsertbeforerefchildnull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodelistindexequalzero::test", &hc_nodelistindexequalzero::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodelistindexgetlength::test", &hc_nodelistindexgetlength::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodelistindexgetlengthofemptylist::test", &hc_nodelistindexgetlengthofemptylist::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodelistindexnotzero::test", &hc_nodelistindexnotzero::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodelistreturnfirstitem::test", &hc_nodelistreturnfirstitem::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodelistreturnlastitem::test", &hc_nodelistreturnlastitem::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodelisttraverselist::test", &hc_nodelisttraverselist::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeparentnode::test", &hc_nodeparentnode::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodeparentnodenull::test", &hc_nodeparentnodenull::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_noderemovechild::test", &hc_noderemovechild::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_noderemovechildgetnodename::test", &hc_noderemovechildgetnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_noderemovechildnode::test", &hc_noderemovechildnode::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_noderemovechildoldchildnonexistent::test", &hc_noderemovechildoldchildnonexistent::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodereplacechild::test", &hc_nodereplacechild::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodereplacechildinvalidnodetype::test", &hc_nodereplacechildinvalidnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodereplacechildnewchilddiffdocument::test", &hc_nodereplacechildnewchilddiffdocument::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodereplacechildnewchildexists::test", &hc_nodereplacechildnewchildexists::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodereplacechildnodeancestor::test", &hc_nodereplacechildnodeancestor::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodereplacechildnodename::test", &hc_nodereplacechildnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodereplacechildoldchildnonexistent::test", &hc_nodereplacechildoldchildnonexistent::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodetextnodeattribute::test", &hc_nodetextnodeattribute::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodetextnodename::test", &hc_nodetextnodename::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodetextnodetype::test", &hc_nodetextnodetype::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodetextnodevalue::test", &hc_nodetextnodevalue::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodevalue01::test", &hc_nodevalue01::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodevalue02::test", &hc_nodevalue02::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodevalue03::test", &hc_nodevalue03::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodevalue04::test", &hc_nodevalue04::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodevalue05::test", &hc_nodevalue05::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodevalue06::test", &hc_nodevalue06::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodevalue07::test", &hc_nodevalue07::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_nodevalue08::test", &hc_nodevalue08::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_notationsremovenameditem1::test", &hc_notationsremovenameditem1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_notationssetnameditem1::test", &hc_notationssetnameditem1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_textindexsizeerrnegativeoffset::test", &hc_textindexsizeerrnegativeoffset::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_textindexsizeerroffsetoutofbounds::test", &hc_textindexsizeerroffsetoutofbounds::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_textparseintolistofelements::test", &hc_textparseintolistofelements::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_textsplittextfour::test", &hc_textsplittextfour::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_textsplittextone::test", &hc_textsplittextone::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_textsplittextthree::test", &hc_textsplittextthree::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_textsplittexttwo::test", &hc_textsplittexttwo::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_textwithnomarkup::test", &hc_textwithnomarkup::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrappendchild1::test", &hc_attrappendchild1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrappendchild2::test", &hc_attrappendchild2::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrappendchild3::test", &hc_attrappendchild3::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrappendchild4::test", &hc_attrappendchild4::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrappendchild5::test", &hc_attrappendchild5::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrappendchild6::test", &hc_attrappendchild6::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrchildnodes1::test", &hc_attrchildnodes1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrchildnodes2::test", &hc_attrchildnodes2::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrclonenode1::test", &hc_attrclonenode1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrfirstchild::test", &hc_attrfirstchild::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrgetvalue1::test", &hc_attrgetvalue1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrgetvalue2::test", &hc_attrgetvalue2::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrhaschildnodes::test", &hc_attrhaschildnodes::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrinsertbefore1::test", &hc_attrinsertbefore1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrinsertbefore2::test", &hc_attrinsertbefore2::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrinsertbefore3::test", &hc_attrinsertbefore3::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrinsertbefore4::test", &hc_attrinsertbefore4::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrinsertbefore5::test", &hc_attrinsertbefore5::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrinsertbefore6::test", &hc_attrinsertbefore6::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrinsertbefore7::test", &hc_attrinsertbefore7::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrlastchild::test", &hc_attrlastchild::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrnormalize::test", &hc_attrnormalize::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrremovechild1::test", &hc_attrremovechild1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrremovechild2::test", &hc_attrremovechild2::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrreplacechild1::test", &hc_attrreplacechild1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrreplacechild2::test", &hc_attrreplacechild2::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrsetvalue1::test", &hc_attrsetvalue1::runTest)); + suiteOfTests->addTest(new TestCaller >("hc_attrsetvalue2::test", &hc_attrsetvalue2::runTest)); + suiteOfTests->addTest(new TestCaller >("attrremovechild1::test", &attrremovechild1::runTest)); + suiteOfTests->addTest(new TestCaller >("attrreplacechild1::test", &attrreplacechild1::runTest)); + + return suiteOfTests; +} + +#endif diff --git a/tests/DOM/conformance/level1/core/attrcreatedocumentfragment.hpp b/tests/DOM/conformance/level1/core/attrcreatedocumentfragment.hpp new file mode 100644 index 00000000..bd7b7119 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrcreatedocumentfragment.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrcreatedocumentfragment +#define test_attrcreatedocumentfragment + +#include "dom_conf_test.hpp" + +/** + * Attr nodes may be associated with Element nodes contained within a DocumentFragment. + * Create a new DocumentFragment and add a newly created Element node(with one attribute). + * Once the element is added, its attribute should be available as an attribute associated + * with an Element within a DocumentFragment. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ + +template +class attrcreatedocumentfragment : public DOMTestCase +{ + public: + attrcreatedocumentfragment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment docFragment; + Element newOne; + Node domesticNode; + NamedNodeMap domesticAttr; + Attr attrs; + String attrName; + Node appendedChild; + doc = (Document) load("staff", true); + docFragment = doc.createDocumentFragment(); + newOne = doc.createElement(SA::construct_from_utf8("newElement")); + newOne.setAttribute(SA::construct_from_utf8("newdomestic"), SA::construct_from_utf8("Yes")); + appendedChild = docFragment.appendChild(newOne); + domesticNode = docFragment.getFirstChild(); + domesticAttr = domesticNode.getAttributes(); + attrs = (Attr) domesticAttr.item(0); + attrName = attrs.getName(); + assertEquals("newdomestic", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrcreatedocumentfragment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrcreatetextnode.hpp b/tests/DOM/conformance/level1/core/attrcreatetextnode.hpp new file mode 100644 index 00000000..d6384b7f --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrcreatetextnode.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrcreatetextnode +#define test_attrcreatetextnode + +#include "dom_conf_test.hpp" + +/** + * The "setValue()" method for an attribute creates a + * Text node with the unparsed content of the string. + * Retrieve the attribute named "street" from the last + * child of of the fourth employee and assign the "Y&ent1;" + * string to its value attribute. This value is not yet + * parsed and therefore should still be the same upon + * retrieval. This test uses the "getNamedItem(name)" method + * from the NamedNodeMap interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html +*/ + +template +class attrcreatetextnode : public DOMTestCase +{ + public: + attrcreatetextnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String value; + doc = (Document) load("staff", true); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(3); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + streetAttr.setValue(SA::construct_from_utf8("Y&ent1;")); + value = streetAttr.getValue(); + assertEquals("Y&ent1;", value); + value = streetAttr.getNodeValue(); + assertEquals("Y&ent1;", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrcreatetextnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrcreatetextnode2.hpp b/tests/DOM/conformance/level1/core/attrcreatetextnode2.hpp new file mode 100644 index 00000000..c79ccf5f --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrcreatetextnode2.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrcreatetextnode2 +#define test_attrcreatetextnode2 + +#include "dom_conf_test.hpp" + +/** + * The "setNodeValue()" method for an attribute creates a + * Text node with the unparsed content of the string. + * Retrieve the attribute named "street" from the last + * child of of the fourth employee and assign the "Y&ent1;" + * string to its value attribute. This value is not yet + * parsed and therefore should still be the same upon + * retrieval. This test uses the "getNamedItem(name)" method + * from the NamedNodeMap interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html +*/ + +template +class attrcreatetextnode2 : public DOMTestCase +{ + public: + attrcreatetextnode2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String value; + doc = (Document) load("staff", true); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(3); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + streetAttr.setNodeValue(SA::construct_from_utf8("Y&ent1;")); + value = streetAttr.getValue(); + assertEquals("Y&ent1;", value); + value = streetAttr.getNodeValue(); + assertEquals("Y&ent1;", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrcreatetextnode2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrdefaultvalue.hpp b/tests/DOM/conformance/level1/core/attrdefaultvalue.hpp new file mode 100644 index 00000000..e761a389 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrdefaultvalue.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrdefaultvalue +#define test_attrdefaultvalue + +#include "dom_conf_test.hpp" + +/** + * If there is not an explicit value assigned to an attribute + * and there is a declaration for this attribute and that + * declaration includes a default value, then that default + * value is the attributes default value. + * Retrieve the attribute named "street" from the last + * child of of the first employee and examine its + * value. That value should be the value given the + * attribute in the DTD file. The test uses the + * "getNamedItem(name)" method from the NamedNodeMap + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class attrdefaultvalue : public DOMTestCase +{ + public: + attrdefaultvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String value; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + skipIfNull(streetAttr); + value = streetAttr.getNodeValue(); + assertEquals("Yes", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrdefaultvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attreffectivevalue.hpp b/tests/DOM/conformance/level1/core/attreffectivevalue.hpp new file mode 100644 index 00000000..40bb6f04 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attreffectivevalue.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attreffectivevalue +#define test_attreffectivevalue + +#include "dom_conf_test.hpp" + +/** + * If an Attr is explicitly assigned any value, then that value is the attributes effective value. + * Retrieve the attribute named "domestic" from the last child of of the first employee + * and examine its nodeValue attribute. This test uses the "getNamedItem(name)" method + * from the NamedNodeMap interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +*/ + +template +class attreffectivevalue : public DOMTestCase +{ + public: + attreffectivevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + String value; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic")); + value = domesticAttr.getNodeValue(); + assertEquals("Yes", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attreffectivevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrentityreplacement.hpp b/tests/DOM/conformance/level1/core/attrentityreplacement.hpp new file mode 100644 index 00000000..c36d7289 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrentityreplacement.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrentityreplacement +#define test_attrentityreplacement + +#include "dom_conf_test.hpp" + +/** + * The "getValue()" method will return the value of the + * attribute as a string. The general entity references + * are replaced with their values. + * Retrieve the attribute named "street" from the last + * child of of the fourth employee and examine the string + * returned by the "getValue()" method. The value should + * be set to "Yes" after the EntityReference is + * replaced with its value. This test uses the + * "getNamedItem(name)" method from the NamedNodeMap + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ + +template +class attrentityreplacement : public DOMTestCase +{ + public: + attrentityreplacement(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String value; + doc = (Document) load("staff", true); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(3); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + value = streetAttr.getValue(); + assertEquals("Yes", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrentityreplacement"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrname.hpp b/tests/DOM/conformance/level1/core/attrname.hpp new file mode 100644 index 00000000..c1f9ed25 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrname.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrname +#define test_attrname + +#include "dom_conf_test.hpp" + +/** + * The getNodeName() method of an Attribute node. + * Retrieve the attribute named street from the last + * child of of the second employee and examine its + * NodeName. This test uses the getNamedItem(name) method from the NamedNodeMap + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403 +*/ + +template +class attrname : public DOMTestCase +{ + public: + attrname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String name; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(1); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + name = streetAttr.getNodeName(); + assertEquals("street", name); + name = streetAttr.getName(); + assertEquals("street", name); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrnextsiblingnull.hpp b/tests/DOM/conformance/level1/core/attrnextsiblingnull.hpp new file mode 100644 index 00000000..97dbb247 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrnextsiblingnull.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrnextsiblingnull +#define test_attrnextsiblingnull + +#include "dom_conf_test.hpp" + +/** + * The "getNextSibling()" method for an Attr node should return null. + * Retrieve the attribute named "domestic" from the last child of of the + * first employee and examine its NextSibling node. This test uses the + * "getNamedItem(name)" method from the NamedNodeMap interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ + +template +class attrnextsiblingnull : public DOMTestCase +{ + public: + attrnextsiblingnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + Node s; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic")); + s = domesticAttr.getNextSibling(); + assertNull(s); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrnextsiblingnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrnotspecifiedvalue.hpp b/tests/DOM/conformance/level1/core/attrnotspecifiedvalue.hpp new file mode 100644 index 00000000..5af9e07a --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrnotspecifiedvalue.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrnotspecifiedvalue +#define test_attrnotspecifiedvalue + +#include "dom_conf_test.hpp" + +/** + * The "getSpecified()" method for an Attr node should + * be set to false if the attribute was not explicitly given + * a value. + * Retrieve the attribute named "street" from the last + * child of of the first employee and examine the value + * returned by the "getSpecified()" method. This test uses + * the "getNamedItem(name)" method from the NamedNodeMap + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class attrnotspecifiedvalue : public DOMTestCase +{ + public: + attrnotspecifiedvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + boolean state; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + skipIfNull(streetAttr); + state = streetAttr.getSpecified(); + assertFalse(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrnotspecifiedvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrparentnodenull.hpp b/tests/DOM/conformance/level1/core/attrparentnodenull.hpp new file mode 100644 index 00000000..05483ee4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrparentnodenull.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrparentnodenull +#define test_attrparentnodenull + +#include "dom_conf_test.hpp" + +/** + * The "getParentNode()" method for an Attr node should return null. Retrieve + * the attribute named "domestic" from the last child of the first employee + * and examine its parentNode attribute. This test also uses the "getNamedItem(name)" + * method from the NamedNodeMap interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ + +template +class attrparentnodenull : public DOMTestCase +{ + public: + attrparentnodenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + Node s; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic")); + s = domesticAttr.getParentNode(); + assertNull(s); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrparentnodenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrprevioussiblingnull.hpp b/tests/DOM/conformance/level1/core/attrprevioussiblingnull.hpp new file mode 100644 index 00000000..db21b240 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrprevioussiblingnull.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrprevioussiblingnull +#define test_attrprevioussiblingnull + +#include "dom_conf_test.hpp" + +/** + * The "getPreviousSibling()" method for an Attr node should return null. + * Retrieve the attribute named "domestic" from the last child of of the + * first employee and examine its PreviousSibling node. This test uses the + * "getNamedItem(name)" method from the NamedNodeMap interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ + +template +class attrprevioussiblingnull : public DOMTestCase +{ + public: + attrprevioussiblingnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + Node s; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic")); + s = domesticAttr.getPreviousSibling(); + assertNull(s); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrprevioussiblingnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrremovechild1.hpp b/tests/DOM/conformance/level1/core/attrremovechild1.hpp new file mode 100644 index 00000000..9efbdcaa --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrremovechild1.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrremovechild1 +#define test_attrremovechild1 + +#include "dom_conf_test.hpp" + +/** + * Removing a child node from an attribute in an entity reference + * should result in an NO_MODIFICATION_ALLOWED_ERR DOMException. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +*/ + +template +class attrremovechild1 : public DOMTestCase +{ + public: + attrremovechild1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + EntityReference entRef; + Element entElement; + Node attrNode; + Text textNode; + Node removedNode; + doc = (Document) load("staff", true); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + attrNode = entElement.getAttributeNode(SA::construct_from_utf8("domestic")); + textNode = (Text) attrNode.getFirstChild(); + assertNotNull(textNode); + + { + boolean success = false; + try { + removedNode = attrNode.removeChild(textNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrremovechild1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrreplacechild1.hpp b/tests/DOM/conformance/level1/core/attrreplacechild1.hpp new file mode 100644 index 00000000..f98e6860 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrreplacechild1.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrreplacechild1 +#define test_attrreplacechild1 + +#include "dom_conf_test.hpp" + +/** + * Replacing a child node from an attribute in an entity reference + * should result in an NO_MODIFICATION_ALLOWED_ERR DOMException. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +*/ + +template +class attrreplacechild1 : public DOMTestCase +{ + public: + attrreplacechild1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + EntityReference entRef; + Element entElement; + Node attrNode; + Text textNode; + Node removedNode; + Node newChild; + doc = (Document) load("staff", true); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + attrNode = entElement.getAttributeNode(SA::construct_from_utf8("domestic")); + textNode = (Text) attrNode.getFirstChild(); + assertNotNull(textNode); + newChild = doc.createTextNode(SA::construct_from_utf8("Yesterday")); + + { + boolean success = false; + try { + removedNode = attrNode.replaceChild(newChild, textNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrreplacechild1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrsetvaluenomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/attrsetvaluenomodificationallowederr.hpp new file mode 100644 index 00000000..ac28c142 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrsetvaluenomodificationallowederr.hpp @@ -0,0 +1,138 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrsetvaluenomodificationallowederr +#define test_attrsetvaluenomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "setValue()" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the "domestic" attribute + * from the entity reference and execute the "setValue()" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#ID-221662474 +* @see http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-221662474')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ + +template +class attrsetvaluenomodificationallowederr : public DOMTestCase +{ + public: + attrsetvaluenomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + NodeList genList; + Node gen; + NodeList gList; + Node g; + NamedNodeMap attrList; + Attr attrNode; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + assertNotNull(gender); + genList = gender.getChildNodes(); + gen = genList.item(0); + assertNotNull(gen); + gList = gen.getChildNodes(); + g = gList.item(0); + assertNotNull(g); + attrList = g.getAttributes(); + assertNotNull(attrList); + attrNode = (Attr) attrList.getNamedItem(SA::construct_from_utf8("domestic")); + assertNotNull(attrNode); + + { + boolean success = false; + try { + attrNode.setValue(SA::construct_from_utf8("newvalue")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + { + boolean success = false; + try { + attrNode.setNodeValue(SA::construct_from_utf8("newvalue2")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrsetvaluenomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrsetvaluenomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/attrsetvaluenomodificationallowederrEE.hpp new file mode 100644 index 00000000..79aad9c6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrsetvaluenomodificationallowederrEE.hpp @@ -0,0 +1,134 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrsetvaluenomodificationallowederrEE +#define test_attrsetvaluenomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "setValue()" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * Create an entity reference using document.createEntityReference() + * Get the "domestic" attribute from the entity + * reference and execute the "setValue()" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#ID-221662474 +* @see http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core#xpointer(id('ID-221662474')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrsetvaluenomodificationallowederr.xml +*/ + +template +class attrsetvaluenomodificationallowederrEE : public DOMTestCase +{ + public: + attrsetvaluenomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + EntityReference entRef; + Element entElement; + NamedNodeMap attrList; + Node attrNode; + Node gender; + NodeList genderList; + Node appendedChild; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + assertNotNull(gender); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + appendedChild = gender.appendChild(entRef); + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + attrList = entElement.getAttributes(); + attrNode = attrList.getNamedItem(SA::construct_from_utf8("domestic")); + + { + boolean success = false; + try { + ((Attr) /*Node */attrNode).setValue(SA::construct_from_utf8("newvalue")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + { + boolean success = false; + try { + attrNode.setNodeValue(SA::construct_from_utf8("newvalue2")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrsetvaluenomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrspecifiedvalue.hpp b/tests/DOM/conformance/level1/core/attrspecifiedvalue.hpp new file mode 100644 index 00000000..0ba6ad8a --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrspecifiedvalue.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrspecifiedvalue +#define test_attrspecifiedvalue + +#include "dom_conf_test.hpp" + +/** + * The "getSpecified()" method for an Attr node should + * be set to true if the attribute was explicitly given + * a value. + * Retrieve the attribute named "domestic" from the last + * child of of the first employee and examine the value + * returned by the "getSpecified()" method. This test uses + * the "getNamedItem(name)" method from the NamedNodeMap + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 +*/ + +template +class attrspecifiedvalue : public DOMTestCase +{ + public: + attrspecifiedvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + boolean state; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic")); + state = domesticAttr.getSpecified(); + assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrspecifiedvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrspecifiedvaluechanged.hpp b/tests/DOM/conformance/level1/core/attrspecifiedvaluechanged.hpp new file mode 100644 index 00000000..0b379d6c --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrspecifiedvaluechanged.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrspecifiedvaluechanged +#define test_attrspecifiedvaluechanged + +#include "dom_conf_test.hpp" + +/** + * The "getSpecified()" method for an Attr node should return true if the + * value of the attribute is changed. + * Retrieve the attribute named "street" from the last + * child of of the THIRD employee and change its + * value to "Yes"(which is the default DTD value). This + * should cause the "getSpecified()" method to be true. + * This test uses the "setAttribute(name,value)" method + * from the Element interface and the "getNamedItem(name)" + * method from the NamedNodeMap interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 +*/ + +template +class attrspecifiedvaluechanged : public DOMTestCase +{ + public: + attrspecifiedvaluechanged(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + boolean state; + doc = (Document) load("staff", true); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(2); + ((Element) /*Node */testNode).setAttribute(SA::construct_from_utf8("street"), SA::construct_from_utf8("Yes")); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + state = streetAttr.getSpecified(); + assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrspecifiedvaluechanged"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/attrspecifiedvalueremove.hpp b/tests/DOM/conformance/level1/core/attrspecifiedvalueremove.hpp new file mode 100644 index 00000000..01e73131 --- /dev/null +++ b/tests/DOM/conformance/level1/core/attrspecifiedvalueremove.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_attrspecifiedvalueremove +#define test_attrspecifiedvalueremove + +#include "dom_conf_test.hpp" + +/** + * To respecify the attribute to its default value from + * the DTD, the attribute must be deleted. This will then + * make a new attribute available with the "getSpecified()" + * method value set to false. + * Retrieve the attribute named "street" from the last + * child of of the THIRD employee and delete it. This + * should then create a new attribute with its default + * value and also cause the "getSpecified()" method to + * return false. + * This test uses the "removeAttribute(name)" method + * from the Element interface and the "getNamedItem(name)" + * method from the NamedNodeMap interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class attrspecifiedvalueremove : public DOMTestCase +{ + public: + attrspecifiedvalueremove(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + boolean state; + doc = (Document) load("staff", true); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = addressList.item(2); + ((Element) /*Node */testNode).removeAttribute(SA::construct_from_utf8("street")); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + assertNotNull(streetAttr); + state = streetAttr.getSpecified(); + assertFalse(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attrspecifiedvalueremove"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/cdatasectiongetdata.hpp b/tests/DOM/conformance/level1/core/cdatasectiongetdata.hpp new file mode 100644 index 00000000..0f8c6472 --- /dev/null +++ b/tests/DOM/conformance/level1/core/cdatasectiongetdata.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_cdatasectiongetdata +#define test_cdatasectiongetdata + +#include "dom_conf_test.hpp" + +/** + * Retrieve the last CDATASection node located inside the + * second child of the second employee and examine its + * content. Since the CDATASection interface inherits + * from the CharacterData interface(via the Text node), + * the "getData()" method can be used to access the + * CDATA content. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +*/ + +template +class cdatasectiongetdata : public DOMTestCase +{ + public: + cdatasectiongetdata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList nameList; + Node child; + Node lastChild; + String data; + int nodeType; + doc = (Document) load("staff", false); + nameList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + child = nameList.item(1); + lastChild = child.getLastChild(); + nodeType = (int) lastChild.getNodeType(); + assertEquals(4, nodeType); + data = ((CharacterData) /*Node */lastChild).getData(); + assertEquals("This is an adjacent CDATASection with a reference to a tab &tab;", data); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/cdatasectiongetdata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/cdatasectionnormalize.hpp b/tests/DOM/conformance/level1/core/cdatasectionnormalize.hpp new file mode 100644 index 00000000..185629ba --- /dev/null +++ b/tests/DOM/conformance/level1/core/cdatasectionnormalize.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_cdatasectionnormalize +#define test_cdatasectionnormalize + +#include "dom_conf_test.hpp" + +/** + * Adjacent CDATASection nodes cannot be merged together by + * use of the "normalize()" method from the Element interface. + * Retrieve second child of the second employee and invoke + * the "normalize()" method. The Element under contains + * two CDATASection nodes that should not be merged together + * by the "normalize()" method. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083 +*/ + +template +class cdatasectionnormalize : public DOMTestCase +{ + public: + cdatasectionnormalize(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList nameList; + Element lChild; + NodeList childNodes; + CDATASection cdataN; + String data; + doc = (Document) load("staff", true); + nameList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + lChild = (Element) nameList.item(1); + lChild.normalize(); + childNodes = lChild.getChildNodes(); + cdataN = (CDATASection) childNodes.item(1); + assertNotNull(cdataN); + data = cdataN.getData(); + assertEquals("This is a CDATASection with EntityReference number 2 &ent2;", data); + cdataN = (CDATASection) childNodes.item(3); + assertNotNull(cdataN); + data = cdataN.getData(); + assertEquals("This is an adjacent CDATASection with a reference to a tab &tab;", data); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/cdatasectionnormalize"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataappenddata.hpp b/tests/DOM/conformance/level1/core/characterdataappenddata.hpp new file mode 100644 index 00000000..7d62ddb0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataappenddata.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataappenddata +#define test_characterdataappenddata + +#include "dom_conf_test.hpp" + +/** + * The "appendData(arg)" method appends a string to the end + * of the character data of the node. + * + * Retrieve the character data from the second child + * of the first employee. The appendData(arg) method is + * called with arg=", Esquire". The method should append + * the specified data to the already existing character + * data. The new value return by the "getLength()" method + * should be 24. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +*/ + +template +class characterdataappenddata : public DOMTestCase +{ + public: + characterdataappenddata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childValue; + int childLength; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.appendData(SA::construct_from_utf8(", Esquire")); + childValue = child.getData(); + childLength = SA::length(childValue); + assertEquals(24, childLength); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataappenddatagetdata.hpp b/tests/DOM/conformance/level1/core/characterdataappenddatagetdata.hpp new file mode 100644 index 00000000..7cfd8e05 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataappenddatagetdata.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataappenddatagetdata +#define test_characterdataappenddatagetdata + +#include "dom_conf_test.hpp" + +/** + * On successful invocation of the "appendData(arg)" + * method the "getData()" method provides access to the + * concatentation of data and the specified string. + * + * Retrieve the character data from the second child + * of the first employee. The appendData(arg) method is + * called with arg=", Esquire". The method should append + * the specified data to the already existing character + * data. The new value return by the "getData()" method + * should be "Margaret Martin, Esquire". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +*/ + +template +class characterdataappenddatagetdata : public DOMTestCase +{ + public: + characterdataappenddatagetdata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.appendData(SA::construct_from_utf8(", Esquire")); + childData = child.getData(); + assertEquals("Margaret Martin, Esquire", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatagetdata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataappenddatanomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/characterdataappenddatanomodificationallowederr.hpp new file mode 100644 index 00000000..7202952c --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataappenddatanomodificationallowederr.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataappenddatanomodificationallowederr +#define test_characterdataappenddatanomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "appendData(arg)" method raises a NO_MODIFICATION_ALLOWED_ERR + * DOMException if the node is readonly. + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "appendData(arg)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-32791A2F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +*/ + +template +class characterdataappenddatanomodificationallowederr : public DOMTestCase +{ + public: + characterdataappenddatanomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entElement; + Node entElementContent; + Node entReference; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = genderNode.getFirstChild(); + assertNotNull(entReference); + nodeType = (int) entReference.getNodeType(); + + if (equals(1, nodeType)) { + entReference = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entReference); + } + entElement = entReference.getFirstChild(); + assertNotNull(entElement); + entElementContent = entElement.getFirstChild(); + assertNotNull(entElementContent); + + { + boolean success = false; + try { + ((CharacterData) /*Node */entElementContent).appendData(SA::construct_from_utf8("newString")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatanomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataappenddatanomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/characterdataappenddatanomodificationallowederrEE.hpp new file mode 100644 index 00000000..9f8cc02a --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataappenddatanomodificationallowederrEE.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataappenddatanomodificationallowederrEE +#define test_characterdataappenddatanomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * Create an ent3 entity reference and call appendData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-32791A2F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatanomodificationallowederr.xml +*/ + +template +class characterdataappenddatanomodificationallowederrEE : public DOMTestCase +{ + public: + characterdataappenddatanomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entText; + EntityReference entReference; + Node appendedChild; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = doc.createEntityReference(SA::construct_from_utf8("ent3")); + assertNotNull(entReference); + appendedChild = genderNode.appendChild(entReference); + entText = entReference.getFirstChild(); + assertNotNull(entText); + + { + boolean success = false; + try { + ((CharacterData) /*Node */entText).appendData(SA::construct_from_utf8("newString")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataappenddatanomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatadeletedatabegining.hpp b/tests/DOM/conformance/level1/core/characterdatadeletedatabegining.hpp new file mode 100644 index 00000000..260a54d9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatadeletedatabegining.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatadeletedatabegining +#define test_characterdatadeletedatabegining + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method removes a range of + * characters from the node. Delete data at the beginning + * of the character data. + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=0 and count=16. + * The method should delete the characters from position + * 0 thru position 16. The new value of the character data + * should be "Dallas, Texas 98551". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class characterdatadeletedatabegining : public DOMTestCase +{ + public: + characterdatadeletedatabegining(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(0, 16); + childData = child.getData(); + assertEquals("Dallas, Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatabegining"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatadeletedataend.hpp b/tests/DOM/conformance/level1/core/characterdatadeletedataend.hpp new file mode 100644 index 00000000..bd712232 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatadeletedataend.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatadeletedataend +#define test_characterdatadeletedataend + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method removes a range of + * characters from the node. Delete data at the end + * of the character data. + * + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=30 and count=5. + * The method should delete the characters from position + * 30 thru position 35. The new value of the character data + * should be "1230 North Ave. Dallas, Texas". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class characterdatadeletedataend : public DOMTestCase +{ + public: + characterdatadeletedataend(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(30, 5); + childData = child.getData(); + assertEquals("1230 North Ave. Dallas, Texas ", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedataend"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatadeletedataexceedslength.hpp b/tests/DOM/conformance/level1/core/characterdatadeletedataexceedslength.hpp new file mode 100644 index 00000000..c79769aa --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatadeletedataexceedslength.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatadeletedataexceedslength +#define test_characterdatadeletedataexceedslength + +#include "dom_conf_test.hpp" + +/** + * If the sum of the offset and count used in the + * "deleteData(offset,count) method is greater than the + * length of the character data then all the characters + * from the offset to the end of the data are deleted. + * + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=4 and count=50. + * The method should delete the characters from position 4 + * to the end of the data since the offset+count(50+4) + * is greater than the length of the character data(35). + * The new value of the character data should be "1230". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class characterdatadeletedataexceedslength : public DOMTestCase +{ + public: + characterdatadeletedataexceedslength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(4, 50); + childData = child.getData(); + assertEquals("1230", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedataexceedslength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatadeletedatagetlengthanddata.hpp b/tests/DOM/conformance/level1/core/characterdatadeletedatagetlengthanddata.hpp new file mode 100644 index 00000000..ec62cb70 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatadeletedatagetlengthanddata.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatadeletedatagetlengthanddata +#define test_characterdatadeletedatagetlengthanddata + +#include "dom_conf_test.hpp" + +/** + * On successful invocation of the "deleteData(offset,count)" + * method, the "getData()" and "getLength()" methods reflect + * the changes. + * + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=30 and count=5. + * The method should delete the characters from position + * 30 thru position 35. The new value of the character data + * should be "1230 North Ave. Dallas, Texas" which is + * returned by the "getData()" method and "getLength()" + * method should return 30". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class characterdatadeletedatagetlengthanddata : public DOMTestCase +{ + public: + characterdatadeletedatagetlengthanddata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + int childLength; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(30, 5); + childData = child.getData(); + assertEquals("1230 North Ave. Dallas, Texas ", childData); + childLength = (int) child.getLength(); + assertEquals(30, childLength); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatagetlengthanddata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatadeletedatamiddle.hpp b/tests/DOM/conformance/level1/core/characterdatadeletedatamiddle.hpp new file mode 100644 index 00000000..a22e1ae6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatadeletedatamiddle.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatadeletedatamiddle +#define test_characterdatadeletedatamiddle + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method removes a range of + * characters from the node. Delete data in the middle + * of the character data. + * + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=16 and count=8. + * The method should delete the characters from position + * 16 thru position 24. The new value of the character data + * should be "1230 North Ave. Texas 98551". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class characterdatadeletedatamiddle : public DOMTestCase +{ + public: + characterdatadeletedatamiddle(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(16, 8); + childData = child.getData(); + assertEquals("1230 North Ave. Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatamiddle"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatadeletedatanomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/characterdatadeletedatanomodificationallowederr.hpp new file mode 100644 index 00000000..8327ab64 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatadeletedatanomodificationallowederr.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatadeletedatanomodificationallowederr +#define test_characterdatadeletedatanomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method raises a NO_MODIFICATION_ALLOWED_ERR + * DOMException if the node is readonly. + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "deleteData(offset,count)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class characterdatadeletedatanomodificationallowederr : public DOMTestCase +{ + public: + characterdatadeletedatanomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entElement; + Node entElementContent; + int nodeType; + Node entReference; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = genderNode.getFirstChild(); + assertNotNull(entReference); + nodeType = (int) entReference.getNodeType(); + + if (equals(3, nodeType)) { + entReference = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entReference); + } + entElement = entReference.getFirstChild(); + assertNotNull(entElement); + entElementContent = entElement.getFirstChild(); + assertNotNull(entElementContent); + + { + boolean success = false; + try { + ((CharacterData) /*Node */entElementContent).deleteData(1, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatanomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatadeletedatanomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/characterdatadeletedatanomodificationallowederrEE.hpp new file mode 100644 index 00000000..f605ff5f --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatadeletedatanomodificationallowederrEE.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatadeletedatanomodificationallowederrEE +#define test_characterdatadeletedatanomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * Create an ent3 entity reference and call deleteData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatanomodificationallowederr.xml +*/ + +template +class characterdatadeletedatanomodificationallowederrEE : public DOMTestCase +{ + public: + characterdatadeletedatanomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entText; + EntityReference entReference; + Node appendedChild; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = doc.createEntityReference(SA::construct_from_utf8("ent3")); + assertNotNull(entReference); + appendedChild = genderNode.appendChild(entReference); + entText = entReference.getFirstChild(); + assertNotNull(entText); + + { + boolean success = false; + try { + ((CharacterData) /*Node */entText).deleteData(1, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatadeletedatanomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatagetdata.hpp b/tests/DOM/conformance/level1/core/characterdatagetdata.hpp new file mode 100644 index 00000000..8ab02395 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatagetdata.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatagetdata +#define test_characterdatagetdata + +#include "dom_conf_test.hpp" + +/** + * The "getData()" method retrieves the character data + * currently stored in the node. + * Retrieve the character data from the second child + * of the first employee and invoke the "getData()" + * method. The method returns the character data + * string. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +*/ + +template +class characterdatagetdata : public DOMTestCase +{ + public: + characterdatagetdata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + childData = child.getData(); + assertEquals("Margaret Martin", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatagetdata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatagetlength.hpp b/tests/DOM/conformance/level1/core/characterdatagetlength.hpp new file mode 100644 index 00000000..d4be2e7e --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatagetlength.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatagetlength +#define test_characterdatagetlength + +#include "dom_conf_test.hpp" + +/** + * The "getLength()" method returns the number of characters + * stored in this nodes data. + * Retrieve the character data from the second + * child of the first employee and examine the + * value returned by the getLength() method. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C +*/ + +template +class characterdatagetlength : public DOMTestCase +{ + public: + characterdatagetlength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childValue; + int childLength; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + childValue = child.getData(); + childLength = SA::length(childValue); + assertEquals(15, childLength); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatagetlength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedatacountnegative.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedatacountnegative.hpp new file mode 100644 index 00000000..d4581c04 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedatacountnegative.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrdeletedatacountnegative +#define test_characterdataindexsizeerrdeletedatacountnegative + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified count + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "deleteData(offset,count)" + * method with offset=10 and count=-3. It should raise the + * desired exception since the count is negative. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class characterdataindexsizeerrdeletedatacountnegative : public DOMTestCase +{ + public: + characterdataindexsizeerrdeletedatacountnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.deleteData(10, -3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrdeletedatacountnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedataoffsetgreater.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedataoffsetgreater.hpp new file mode 100644 index 00000000..347490ea --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedataoffsetgreater.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrdeletedataoffsetgreater +#define test_characterdataindexsizeerrdeletedataoffsetgreater + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is greater that the number of characters in the string. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "deleteData(offset,count)" + * method with offset=40 and count=3. It should raise the + * desired exception since the offset is greater than the + * number of characters in the string. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class characterdataindexsizeerrdeletedataoffsetgreater : public DOMTestCase +{ + public: + characterdataindexsizeerrdeletedataoffsetgreater(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.deleteData(40, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrdeletedataoffsetgreater"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedataoffsetnegative.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedataoffsetnegative.hpp new file mode 100644 index 00000000..0973ad51 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrdeletedataoffsetnegative.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrdeletedataoffsetnegative +#define test_characterdataindexsizeerrdeletedataoffsetnegative + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "deleteData(offset,count)" + * method with offset=-5 and count=3. It should raise the + * desired exception since the offset is negative. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class characterdataindexsizeerrdeletedataoffsetnegative : public DOMTestCase +{ + public: + characterdataindexsizeerrdeletedataoffsetnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.deleteData(-5, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrdeletedataoffsetnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrinsertdataoffsetgreater.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrinsertdataoffsetgreater.hpp new file mode 100644 index 00000000..d2e931f0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrinsertdataoffsetgreater.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrinsertdataoffsetgreater +#define test_characterdataindexsizeerrinsertdataoffsetgreater + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is greater than the number of characters in the string. + * + * Retrieve the character data of the last child of the + * first employee and invoke its insertData"(offset,arg)" + * method with offset=40 and arg="ABC". It should raise + * the desired exception since the offset is greater than + * the number of characters in the string. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class characterdataindexsizeerrinsertdataoffsetgreater : public DOMTestCase +{ + public: + characterdataindexsizeerrinsertdataoffsetgreater(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.insertData(40, SA::construct_from_utf8("ABC")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrinsertdataoffsetgreater"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrinsertdataoffsetnegative.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrinsertdataoffsetnegative.hpp new file mode 100644 index 00000000..b5dbf885 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrinsertdataoffsetnegative.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrinsertdataoffsetnegative +#define test_characterdataindexsizeerrinsertdataoffsetnegative + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its insertData"(offset,arg)" + * method with offset=-5 and arg="ABC". It should raise + * the desired exception since the offset is negative. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class characterdataindexsizeerrinsertdataoffsetnegative : public DOMTestCase +{ + public: + characterdataindexsizeerrinsertdataoffsetnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.insertData(-5, SA::construct_from_utf8("ABC")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrinsertdataoffsetnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedatacountnegative.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedatacountnegative.hpp new file mode 100644 index 00000000..126d5f0f --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedatacountnegative.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrreplacedatacountnegative +#define test_characterdataindexsizeerrreplacedatacountnegative + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified count + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its + * "replaceData(offset,count,arg) method with offset=10 + * and count=-3 and arg="ABC". It should raise the + * desired exception since the count is negative. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class characterdataindexsizeerrreplacedatacountnegative : public DOMTestCase +{ + public: + characterdataindexsizeerrreplacedatacountnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.replaceData(10, -3, SA::construct_from_utf8("ABC")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrreplacedatacountnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedataoffsetgreater.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedataoffsetgreater.hpp new file mode 100644 index 00000000..cf575f27 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedataoffsetgreater.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrreplacedataoffsetgreater +#define test_characterdataindexsizeerrreplacedataoffsetgreater + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is greater than the length of the string. + * + * Retrieve the character data of the last child of the + * first employee and invoke its + * "replaceData(offset,count,arg) method with offset=40 + * and count=3 and arg="ABC". It should raise the + * desired exception since the offset is greater than the + * length of the string. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class characterdataindexsizeerrreplacedataoffsetgreater : public DOMTestCase +{ + public: + characterdataindexsizeerrreplacedataoffsetgreater(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.replaceData(40, 3, SA::construct_from_utf8("ABC")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrreplacedataoffsetgreater"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedataoffsetnegative.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedataoffsetnegative.hpp new file mode 100644 index 00000000..db87faf4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrreplacedataoffsetnegative.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrreplacedataoffsetnegative +#define test_characterdataindexsizeerrreplacedataoffsetnegative + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its + * "replaceData(offset,count,arg) method with offset=-5 + * and count=3 and arg="ABC". It should raise the + * desired exception since the offset is negative. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class characterdataindexsizeerrreplacedataoffsetnegative : public DOMTestCase +{ + public: + characterdataindexsizeerrreplacedataoffsetnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.replaceData(-5, 3, SA::construct_from_utf8("ABC")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrreplacedataoffsetnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringcountnegative.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringcountnegative.hpp new file mode 100644 index 00000000..11567635 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringcountnegative.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrsubstringcountnegative +#define test_characterdataindexsizeerrsubstringcountnegative + +#include "dom_conf_test.hpp" + +/** + * The "substringData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified count + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "substringData(offset,count) + * method with offset=10 and count=-3. It should raise the + * desired exception since the count is negative. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class characterdataindexsizeerrsubstringcountnegative : public DOMTestCase +{ + public: + characterdataindexsizeerrsubstringcountnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String badSubstring; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + badSubstring = child.substringData(10, -3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrsubstringcountnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringnegativeoffset.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringnegativeoffset.hpp new file mode 100644 index 00000000..7de822d4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringnegativeoffset.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrsubstringnegativeoffset +#define test_characterdataindexsizeerrsubstringnegativeoffset + +#include "dom_conf_test.hpp" + +/** + * The "substringData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "substringData(offset,count) + * method with offset=-5 and count=3. It should raise the + * desired exception since the offset is negative. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class characterdataindexsizeerrsubstringnegativeoffset : public DOMTestCase +{ + public: + characterdataindexsizeerrsubstringnegativeoffset(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String badString; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + badString = child.substringData(-5, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrsubstringnegativeoffset"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringoffsetgreater.hpp b/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringoffsetgreater.hpp new file mode 100644 index 00000000..8b4fb6a2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdataindexsizeerrsubstringoffsetgreater.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdataindexsizeerrsubstringoffsetgreater +#define test_characterdataindexsizeerrsubstringoffsetgreater + +#include "dom_conf_test.hpp" + +/** + * The "substringData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is greater than the number of characters in the string. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "substringData(offset,count) + * method with offset=40 and count=3. It should raise the + * desired exception since the offsets value is greater + * than the length. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class characterdataindexsizeerrsubstringoffsetgreater : public DOMTestCase +{ + public: + characterdataindexsizeerrsubstringoffsetgreater(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String badString; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + badString = child.substringData(40, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrsubstringoffsetgreater"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatainsertdatabeginning.hpp b/tests/DOM/conformance/level1/core/characterdatainsertdatabeginning.hpp new file mode 100644 index 00000000..1d19489e --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatainsertdatabeginning.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatainsertdatabeginning +#define test_characterdatainsertdatabeginning + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method will insert a string + * at the specified character offset. Insert the data at + * the beginning of the character data. + * Retrieve the character data from the second child of + * the first employee. The "insertData(offset,arg)" + * method is then called with offset=0 and arg="Mss.". + * The method should insert the string "Mss." at position 0. + * The new value of the character data should be + * "Mss. Margaret Martin". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ + +template +class characterdatainsertdatabeginning : public DOMTestCase +{ + public: + characterdatainsertdatabeginning(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.insertData(0, SA::construct_from_utf8("Mss. ")); + childData = child.getData(); + assertEquals("Mss. Margaret Martin", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatabeginning"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatainsertdataend.hpp b/tests/DOM/conformance/level1/core/characterdatainsertdataend.hpp new file mode 100644 index 00000000..00ecbfc8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatainsertdataend.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatainsertdataend +#define test_characterdatainsertdataend + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method will insert a string + * at the specified character offset. Insert the data at + * the end of the character data. + * + * Retrieve the character data from the second child of + * the first employee. The "insertData(offset,arg)" + * method is then called with offset=15 and arg=", Esquire". + * The method should insert the string ", Esquire" at + * position 15. The new value of the character data should + * be "Margaret Martin, Esquire". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ + +template +class characterdatainsertdataend : public DOMTestCase +{ + public: + characterdatainsertdataend(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.insertData(15, SA::construct_from_utf8(", Esquire")); + childData = child.getData(); + assertEquals("Margaret Martin, Esquire", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdataend"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatainsertdatamiddle.hpp b/tests/DOM/conformance/level1/core/characterdatainsertdatamiddle.hpp new file mode 100644 index 00000000..724ce831 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatainsertdatamiddle.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatainsertdatamiddle +#define test_characterdatainsertdatamiddle + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method will insert a string + * at the specified character offset. Insert the data in + * the middle of the character data. + * + * Retrieve the character data from the second child of + * the first employee. The "insertData(offset,arg)" + * method is then called with offset=9 and arg="Ann". + * The method should insert the string "Ann" at position 9. + * The new value of the character data should be + * "Margaret Ann Martin". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ + +template +class characterdatainsertdatamiddle : public DOMTestCase +{ + public: + characterdatainsertdatamiddle(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.insertData(9, SA::construct_from_utf8("Ann ")); + childData = child.getData(); + assertEquals("Margaret Ann Martin", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatamiddle"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatainsertdatanomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/characterdatainsertdatanomodificationallowederr.hpp new file mode 100644 index 00000000..cc85b186 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatainsertdatanomodificationallowederr.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatainsertdatanomodificationallowederr +#define test_characterdatainsertdatanomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method raises a NO_MODIFICATION_ALLOWED_ERR + * DOMException if the node is readonly. + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "insertData(offset,arg)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-3EDB695F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ + +template +class characterdatainsertdatanomodificationallowederr : public DOMTestCase +{ + public: + characterdatainsertdatanomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entElement; + int nodeType; + Node entElementContent; + Node entReference; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = genderNode.getFirstChild(); + assertNotNull(entReference); + nodeType = (int) entReference.getNodeType(); + + if (equals(1, nodeType)) { + entReference = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entReference); + } + entElement = entReference.getFirstChild(); + assertNotNull(entElement); + entElementContent = entElement.getFirstChild(); + assertNotNull(entElementContent); + + { + boolean success = false; + try { + ((CharacterData) /*Node */entElementContent).insertData(1, SA::construct_from_utf8("newArg")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatanomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatainsertdatanomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/characterdatainsertdatanomodificationallowederrEE.hpp new file mode 100644 index 00000000..943cd2a8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatainsertdatanomodificationallowederrEE.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatainsertdatanomodificationallowederrEE +#define test_characterdatainsertdatanomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * Create an ent3 entity reference and call insertData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-3EDB695F')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatanomodificationallowederr.xml +*/ + +template +class characterdatainsertdatanomodificationallowederrEE : public DOMTestCase +{ + public: + characterdatainsertdatanomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + CharacterData entText; + EntityReference entReference; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = doc.createEntityReference(SA::construct_from_utf8("ent3")); + assertNotNull(entReference); + entText = (CharacterData) entReference.getFirstChild(); + assertNotNull(entText); + + { + boolean success = false; + try { + entText.insertData(1, SA::construct_from_utf8("newArg")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatainsertdatanomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatareplacedatabegining.hpp b/tests/DOM/conformance/level1/core/characterdatareplacedatabegining.hpp new file mode 100644 index 00000000..50a02051 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatareplacedatabegining.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatareplacedatabegining +#define test_characterdatareplacedatabegining + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method replaces the + * characters starting at the specified offset with the + * specified string. Test for replacement in the + * middle of the data. + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=5 and count=5 and + * arg="South". The method should replace characters five + * thru 9 of the character data with "South". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class characterdatareplacedatabegining : public DOMTestCase +{ + public: + characterdatareplacedatabegining(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(0, 4, SA::construct_from_utf8("2500")); + childData = child.getData(); + assertEquals("2500 North Ave. Dallas, Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatabegining"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatareplacedataend.hpp b/tests/DOM/conformance/level1/core/characterdatareplacedataend.hpp new file mode 100644 index 00000000..a70bc538 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatareplacedataend.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatareplacedataend +#define test_characterdatareplacedataend + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method replaces the + * characters starting at the specified offset with the + * specified string. Test for replacement at the + * end of the data. + * + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=30 and count=5 and + * arg="98665". The method should replace characters 30 + * thru 34 of the character data with "98665". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class characterdatareplacedataend : public DOMTestCase +{ + public: + characterdatareplacedataend(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(30, 5, SA::construct_from_utf8("98665")); + childData = child.getData(); + assertEquals("1230 North Ave. Dallas, Texas 98665", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedataend"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatareplacedataexceedslengthofarg.hpp b/tests/DOM/conformance/level1/core/characterdatareplacedataexceedslengthofarg.hpp new file mode 100644 index 00000000..3bc2eac5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatareplacedataexceedslengthofarg.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatareplacedataexceedslengthofarg +#define test_characterdatareplacedataexceedslengthofarg + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method replaces the + * characters starting at the specified offset with the + * specified string. Test the situation where the length + * of the arg string is greater than the specified offset. + * + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=0 and count=4 and + * arg="260030". The method should replace characters one + * thru four with "260030". Note that the length of the + * specified string is greater that the specified offset. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class characterdatareplacedataexceedslengthofarg : public DOMTestCase +{ + public: + characterdatareplacedataexceedslengthofarg(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(0, 4, SA::construct_from_utf8("260030")); + childData = child.getData(); + assertEquals("260030 North Ave. Dallas, Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedataexceedslengthofarg"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatareplacedataexceedslengthofdata.hpp b/tests/DOM/conformance/level1/core/characterdatareplacedataexceedslengthofdata.hpp new file mode 100644 index 00000000..ab12d257 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatareplacedataexceedslengthofdata.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatareplacedataexceedslengthofdata +#define test_characterdatareplacedataexceedslengthofdata + +#include "dom_conf_test.hpp" + +/** + * If the sum of the offset and count exceeds the length then + * all the characters to the end of the data are replaced. + * + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=0 and count=50 and + * arg="2600". The method should replace all the characters + * with "2600". This is because the sum of the offset and + * count exceeds the length of the character data. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class characterdatareplacedataexceedslengthofdata : public DOMTestCase +{ + public: + characterdatareplacedataexceedslengthofdata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(0, 50, SA::construct_from_utf8("2600")); + childData = child.getData(); + assertEquals("2600", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedataexceedslengthofdata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatareplacedatamiddle.hpp b/tests/DOM/conformance/level1/core/characterdatareplacedatamiddle.hpp new file mode 100644 index 00000000..053676de --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatareplacedatamiddle.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatareplacedatamiddle +#define test_characterdatareplacedatamiddle + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method replaces the + * characters starting at the specified offset with the + * specified string. Test for replacement in the + * middle of the data. + * + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=5 and count=5 and + * arg="South". The method should replace characters five + * thru 9 of the character data with "South". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class characterdatareplacedatamiddle : public DOMTestCase +{ + public: + characterdatareplacedatamiddle(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(5, 5, SA::construct_from_utf8("South")); + childData = child.getData(); + assertEquals("1230 South Ave. Dallas, Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatamiddle"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatareplacedatanomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/characterdatareplacedatanomodificationallowederr.hpp new file mode 100644 index 00000000..1789ab0e --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatareplacedatanomodificationallowederr.hpp @@ -0,0 +1,126 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatareplacedatanomodificationallowederr +#define test_characterdatareplacedatanomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method raises a NO_MODIFICATION_ALLOWED_ERR + * DOMException if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "replaceData(offset,count,arg)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class characterdatareplacedatanomodificationallowederr : public DOMTestCase +{ + public: + characterdatareplacedatanomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entElement; + Node entElementContent; + Node entReference; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = genderNode.getFirstChild(); + assertNotNull(entReference); + nodeType = (int) entReference.getNodeType(); + + if (equals(1, nodeType)) { + entReference = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entReference); + } + entElement = entReference.getFirstChild(); + assertNotNull(entElement); + entElementContent = entElement.getFirstChild(); + assertNotNull(entElementContent); + + { + boolean success = false; + try { + ((CharacterData) /*Node */entElementContent).replaceData(1, 3, SA::construct_from_utf8("newArg")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatareplacedatanomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/characterdatareplacedatanomodificationallowederrEE.hpp new file mode 100644 index 00000000..45ba786d --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatareplacedatanomodificationallowederrEE.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatareplacedatanomodificationallowederrEE +#define test_characterdatareplacedatanomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * Create an ent3 entity reference and call replaceData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederr.xml +*/ + +template +class characterdatareplacedatanomodificationallowederrEE : public DOMTestCase +{ + public: + characterdatareplacedatanomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + CharacterData entText; + EntityReference entReference; + Node appendedNode; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = doc.createEntityReference(SA::construct_from_utf8("ent3")); + assertNotNull(entReference); + appendedNode = genderNode.appendChild(entReference); + entText = (CharacterData) entReference.getFirstChild(); + assertNotNull(entText); + + { + boolean success = false; + try { + entText.replaceData(1, 3, SA::construct_from_utf8("newArg")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatasetdatanomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/characterdatasetdatanomodificationallowederr.hpp new file mode 100644 index 00000000..d3739c89 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatasetdatanomodificationallowederr.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatasetdatanomodificationallowederr +#define test_characterdatasetdatanomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "setData(data)" method raises a NO_MODIFICATION_ALLOWED_ERR + * DOMException if the node is readonly. + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "setData(data)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-72AB8359')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +*/ + +template +class characterdatasetdatanomodificationallowederr : public DOMTestCase +{ + public: + characterdatasetdatanomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entElement; + Node entElementContent; + Node entReference; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entReference = genderNode.getFirstChild(); + assertNotNull(entReference); + nodeType = (int) entReference.getNodeType(); + + if (equals(1, nodeType)) { + entReference = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entReference); + } + entElement = entReference.getFirstChild(); + assertNotNull(entElement); + entElementContent = entElement.getFirstChild(); + assertNotNull(entElementContent); + + { + boolean success = false; + try { + ((CharacterData) /*Node */entElementContent).setData(SA::construct_from_utf8("newData")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetdatanomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatasetdatanomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/characterdatasetdatanomodificationallowederrEE.hpp new file mode 100644 index 00000000..bb28bba4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatasetdatanomodificationallowederrEE.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatasetdatanomodificationallowederrEE +#define test_characterdatasetdatanomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * Create an ent3 entity reference and call setData on a text child, should thrown a NO_MODIFICATION_ALLOWED_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-72AB8359')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetdatanomodificationallowederr.xml +*/ + +template +class characterdatasetdatanomodificationallowederrEE : public DOMTestCase +{ + public: + characterdatasetdatanomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entText; + EntityReference entReference; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(4); + entReference = doc.createEntityReference(SA::construct_from_utf8("ent3")); + assertNotNull(entReference); + entText = entReference.getFirstChild(); + assertNotNull(entText); + + { + boolean success = false; + try { + ((CharacterData) /*Node */entText).setData(SA::construct_from_utf8("newData")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetdatanomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatasetnodevalue.hpp b/tests/DOM/conformance/level1/core/characterdatasetnodevalue.hpp new file mode 100644 index 00000000..abef5f12 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatasetnodevalue.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatasetnodevalue +#define test_characterdatasetnodevalue + +#include "dom_conf_test.hpp" + +/** + * The "setNodeValue()" method changes the character data + * currently stored in the node. + * Retrieve the character data from the second child + * of the first employee and invoke the "setNodeValue()" + * method, call "getData()" and compare. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +*/ + +template +class characterdatasetnodevalue : public DOMTestCase +{ + public: + characterdatasetnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + String childValue; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.setNodeValue(SA::construct_from_utf8("Marilyn Martin")); + childData = child.getData(); + assertEquals("Marilyn Martin", childData); + childValue = child.getNodeValue(); + assertEquals("Marilyn Martin", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasetnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatasubstringexceedsvalue.hpp b/tests/DOM/conformance/level1/core/characterdatasubstringexceedsvalue.hpp new file mode 100644 index 00000000..3e1bc356 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatasubstringexceedsvalue.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatasubstringexceedsvalue +#define test_characterdatasubstringexceedsvalue + +#include "dom_conf_test.hpp" + +/** + * If the sum of the "offset" and "count" exceeds the + * "length" then the "substringData(offset,count)" method + * returns all the characters to the end of the data. + * + * Retrieve the character data from the second child + * of the first employee and access part of the data + * by using the substringData(offset,count) method + * with offset=9 and count=10. The method should return + * the substring "Martin" since offset+count > length + * (19 > 15). +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +*/ + +template +class characterdatasubstringexceedsvalue : public DOMTestCase +{ + public: + characterdatasubstringexceedsvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String substring; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + substring = child.substringData(9, 10); + assertEquals("Martin", substring); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasubstringexceedsvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/characterdatasubstringvalue.hpp b/tests/DOM/conformance/level1/core/characterdatasubstringvalue.hpp new file mode 100644 index 00000000..9d8f33f7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/characterdatasubstringvalue.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_characterdatasubstringvalue +#define test_characterdatasubstringvalue + +#include "dom_conf_test.hpp" + +/** + * The "substringData(offset,count)" method returns the + * specified string. + * + * Retrieve the character data from the second child + * of the first employee and access part of the data + * by using the substringData(offset,count) method. The + * method should return the specified substring starting + * at position "offset" and extract "count" characters. + * The method should return the string "Margaret". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +*/ + +template +class characterdatasubstringvalue : public DOMTestCase +{ + public: + characterdatasubstringvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String substring; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + substring = child.substringData(0, 8); + assertEquals("Margaret", substring); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatasubstringvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/commentgetcomment.hpp b/tests/DOM/conformance/level1/core/commentgetcomment.hpp new file mode 100644 index 00000000..815f7787 --- /dev/null +++ b/tests/DOM/conformance/level1/core/commentgetcomment.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_commentgetcomment +#define test_commentgetcomment + +#include "dom_conf_test.hpp" + +/** + * A comment is all the characters between the starting + * '' + * Retrieve the nodes of the DOM document. Search for a + * comment node and the content is its value. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class commentgetcomment : public DOMTestCase +{ + public: + commentgetcomment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node child; + String childName; + String childValue; + int commentCount = 0; + int childType; + doc = (Document) load("staff", false); + elementList = doc.getChildNodes(); + for (int indexN65623 = 0; indexN65623 != elementList.getLength(); indexN65623++) { + child = (Node) elementList.item(indexN65623); + childType = (int) child.getNodeType(); + + if (equals(8, childType)) { + childName = child.getNodeName(); + assertEquals("#comment", childName); + childValue = child.getNodeValue(); + assertEquals(" This is comment number 1.", childValue); + commentCount = commentCount + 1; + } + } + assertEquals(1, commentCount); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/commentgetcomment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreateattribute.hpp b/tests/DOM/conformance/level1/core/documentcreateattribute.hpp new file mode 100644 index 00000000..9fcc0ea9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreateattribute.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreateattribute +#define test_documentcreateattribute + +#include "dom_conf_test.hpp" + +/** + * The "createAttribute(name)" method creates an Attribute + * node of the given name. + * + * Retrieve the entire DOM document and invoke its + * "createAttribute(name)" method. It should create a + * new Attribute node with the given name. The name, value + * and type of the newly created object are retrieved and + * output. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +*/ + +template +class documentcreateattribute : public DOMTestCase +{ + public: + documentcreateattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr newAttrNode; + String attrValue; + String attrName; + int attrType; + doc = (Document) load("staff", true); + newAttrNode = doc.createAttribute(SA::construct_from_utf8("district")); + attrValue = newAttrNode.getNodeValue(); + assertEquals("", attrValue); + attrName = newAttrNode.getNodeName(); + assertEquals("district", attrName); + attrType = (int) newAttrNode.getNodeType(); + assertEquals(2, attrType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreatecdatasection.hpp b/tests/DOM/conformance/level1/core/documentcreatecdatasection.hpp new file mode 100644 index 00000000..43f0b895 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreatecdatasection.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreatecdatasection +#define test_documentcreatecdatasection + +#include "dom_conf_test.hpp" + +/** + * The "createCDATASection(data)" method creates a new + * CDATASection node whose value is the specified string. + * Retrieve the entire DOM document and invoke its + * "createCDATASection(data)" method. It should create a + * new CDATASection node whose "data" is the specified + * string. The content, name and type are retrieved and + * output. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D26C0AF8 +*/ + +template +class documentcreatecdatasection : public DOMTestCase +{ + public: + documentcreatecdatasection(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + CDATASection newCDATASectionNode; + String newCDATASectionValue; + String newCDATASectionName; + int newCDATASectionType; + doc = (Document) load("staff", true); + newCDATASectionNode = doc.createCDATASection(SA::construct_from_utf8("This is a new CDATASection node")); + newCDATASectionValue = newCDATASectionNode.getNodeValue(); + assertEquals("This is a new CDATASection node", newCDATASectionValue); + newCDATASectionName = newCDATASectionNode.getNodeName(); + assertEquals("#cdata-section", newCDATASectionName); + newCDATASectionType = (int) newCDATASectionNode.getNodeType(); + assertEquals(4, newCDATASectionType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreatecdatasection"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreatecomment.hpp b/tests/DOM/conformance/level1/core/documentcreatecomment.hpp new file mode 100644 index 00000000..8cd02145 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreatecomment.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreatecomment +#define test_documentcreatecomment + +#include "dom_conf_test.hpp" + +/** + * The "createComment(data)" method creates a new Comment + * node given the specified string. + * Retrieve the entire DOM document and invoke its + * "createComment(data)" method. It should create a new + * Comment node whose "data" is the specified string. + * The content, name and type are retrieved and output. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328 +*/ + +template +class documentcreatecomment : public DOMTestCase +{ + public: + documentcreatecomment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Comment newCommentNode; + String newCommentValue; + String newCommentName; + int newCommentType; + doc = (Document) load("staff", true); + newCommentNode = doc.createComment(SA::construct_from_utf8("This is a new Comment node")); + newCommentValue = newCommentNode.getNodeValue(); + assertEquals("This is a new Comment node", newCommentValue); + newCommentName = newCommentNode.getNodeName(); + assertEquals("#comment", newCommentName); + newCommentType = (int) newCommentNode.getNodeType(); + assertEquals(8, newCommentType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreatecomment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreatedocumentfragment.hpp b/tests/DOM/conformance/level1/core/documentcreatedocumentfragment.hpp new file mode 100644 index 00000000..285ad330 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreatedocumentfragment.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreatedocumentfragment +#define test_documentcreatedocumentfragment + +#include "dom_conf_test.hpp" + +/** + * The "createDocumentFragment()" method creates an empty + * DocumentFragment object. + * Retrieve the entire DOM document and invoke its + * "createDocumentFragment()" method. The content, name, + * type and value of the newly created object are output. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5 +*/ + +template +class documentcreatedocumentfragment : public DOMTestCase +{ + public: + documentcreatedocumentfragment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment newDocFragment; + NodeList children; + int length; + String newDocFragmentName; + int newDocFragmentType; + String newDocFragmentValue; + doc = (Document) load("staff", true); + newDocFragment = doc.createDocumentFragment(); + children = newDocFragment.getChildNodes(); + length = (int) children.getLength(); + assertEquals(0, length); + newDocFragmentName = newDocFragment.getNodeName(); + assertEquals("#document-fragment", newDocFragmentName); + newDocFragmentType = (int) newDocFragment.getNodeType(); + assertEquals(11, newDocFragmentType); + newDocFragmentValue = newDocFragment.getNodeValue(); + assertNull(newDocFragmentValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreatedocumentfragment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreateelement.hpp b/tests/DOM/conformance/level1/core/documentcreateelement.hpp new file mode 100644 index 00000000..160d7d1a --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreateelement.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreateelement +#define test_documentcreateelement + +#include "dom_conf_test.hpp" + +/** + * The "createElement(tagName)" method creates an Element + * of the type specified. + * Retrieve the entire DOM document and invoke its + * "createElement(tagName)" method with tagName="address". + * The method should create an instance of an Element node + * whose tagName is "address". The NodeName, NodeType + * and NodeValue are returned. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +*/ + +template +class documentcreateelement : public DOMTestCase +{ + public: + documentcreateelement(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element newElement; + String newElementName; + int newElementType; + String newElementValue; + doc = (Document) load("staff", true); + newElement = doc.createElement(SA::construct_from_utf8("address")); + newElementName = newElement.getNodeName(); + assertEquals("address", newElementName); + newElementType = (int) newElement.getNodeType(); + assertEquals(1, newElementType); + newElementValue = newElement.getNodeValue(); + assertNull(newElementValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateelement"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreateelementcasesensitive.hpp b/tests/DOM/conformance/level1/core/documentcreateelementcasesensitive.hpp new file mode 100644 index 00000000..1ea085ad --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreateelementcasesensitive.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreateelementcasesensitive +#define test_documentcreateelementcasesensitive + +#include "dom_conf_test.hpp" + +/** + * The tagName parameter in the "createElement(tagName)" + * method is case-sensitive for XML documents. + * Retrieve the entire DOM document and invoke its + * "createElement(tagName)" method twice. Once for tagName + * equal to "address" and once for tagName equal to "ADDRESS" + * Each call should create a distinct Element node. The + * newly created Elements are then assigned attributes + * that are retrieved. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +*/ + +template +class documentcreateelementcasesensitive : public DOMTestCase +{ + public: + documentcreateelementcasesensitive(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element newElement1; + Element newElement2; + String attribute1; + String attribute2; + doc = (Document) load("staff", true); + newElement1 = doc.createElement(SA::construct_from_utf8("ADDRESS")); + newElement2 = doc.createElement(SA::construct_from_utf8("address")); + newElement1.setAttribute(SA::construct_from_utf8("district"), SA::construct_from_utf8("Fort Worth")); + newElement2.setAttribute(SA::construct_from_utf8("county"), SA::construct_from_utf8("Dallas")); + attribute1 = newElement1.getAttribute(SA::construct_from_utf8("district")); + attribute2 = newElement2.getAttribute(SA::construct_from_utf8("county")); + assertEquals("Fort Worth", attribute1); + assertEquals("Dallas", attribute2); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateelementcasesensitive"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreateelementdefaultattr.hpp b/tests/DOM/conformance/level1/core/documentcreateelementdefaultattr.hpp new file mode 100644 index 00000000..bf282f49 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreateelementdefaultattr.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreateelementdefaultattr +#define test_documentcreateelementdefaultattr + +#include "dom_conf_test.hpp" + +/** + * The "createElement(tagName)" method creates an Element + * of the type specified. In addition, if there are known attributes + * with default values, Attr nodes representing them are automatically + * created and attached to the element. + * Retrieve the entire DOM document and invoke its + * "createElement(tagName)" method with tagName="address". + * The method should create an instance of an Element node + * whose tagName is "address". The tagName "address" has an + * attribute with default values, therefore the newly created element + * will have them. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class documentcreateelementdefaultattr : public DOMTestCase +{ + public: + documentcreateelementdefaultattr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element newElement; + NamedNodeMap defaultAttr; + Node child; + String name; + String value; + doc = (Document) load("staff", true); + newElement = doc.createElement(SA::construct_from_utf8("address")); + defaultAttr = newElement.getAttributes(); + child = defaultAttr.item(0); + assertNotNull(child); + name = child.getNodeName(); + assertEquals("street", name); + value = child.getNodeValue(); + assertEquals("Yes", value); + assertSize(1, defaultAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateelementdefaultattr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreateentityreference.hpp b/tests/DOM/conformance/level1/core/documentcreateentityreference.hpp new file mode 100644 index 00000000..3cea28a1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreateentityreference.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreateentityreference +#define test_documentcreateentityreference + +#include "dom_conf_test.hpp" + +/** + * The "createEntityReference(name)" method creates an + * EntityReferrence node. + * + * Retrieve the entire DOM document and invoke its + * "createEntityReference(name)" method. It should create + * a new EntityReference node for the Entity with the + * given name. The name, value and type are retrieved and + * output. +* @author NIST +* @author Mary Brady +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class documentcreateentityreference : public DOMTestCase +{ + public: + documentcreateentityreference(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + EntityReference newEntRefNode; + String entRefValue; + String entRefName; + int entRefType; + doc = (Document) load("staff", true); + newEntRefNode = doc.createEntityReference(SA::construct_from_utf8("ent1")); + assertNotNull(newEntRefNode); + entRefValue = newEntRefNode.getNodeValue(); + assertNull(entRefValue); + entRefName = newEntRefNode.getNodeName(); + assertEquals("ent1", entRefName); + entRefType = (int) newEntRefNode.getNodeType(); + assertEquals(5, entRefType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateentityreference"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreateentityreferenceknown.hpp b/tests/DOM/conformance/level1/core/documentcreateentityreferenceknown.hpp new file mode 100644 index 00000000..35f7d283 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreateentityreferenceknown.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreateentityreferenceknown +#define test_documentcreateentityreferenceknown + +#include "dom_conf_test.hpp" + +/** + * The "createEntityReference(name)" method creates an + * EntityReference node. In addition, if the referenced entity + * is known, the child list of the "EntityReference" node + * is the same as the corresponding "Entity" node. + * + * Retrieve the entire DOM document and invoke its + * "createEntityReference(name)" method. It should create + * a new EntityReference node for the Entity with the + * given name. The referenced entity is known, therefore the child + * list of the "EntityReference" node is the same as the corresponding + * "Entity" node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE +*/ + +template +class documentcreateentityreferenceknown : public DOMTestCase +{ + public: + documentcreateentityreferenceknown(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + EntityReference newEntRefNode; + NodeList newEntRefList; + Node child; + String name; + String value; + doc = (Document) load("staff", true); + newEntRefNode = doc.createEntityReference(SA::construct_from_utf8("ent3")); + assertNotNull(newEntRefNode); + newEntRefList = newEntRefNode.getChildNodes(); + assertSize(1, newEntRefList); + child = newEntRefNode.getFirstChild(); + name = child.getNodeName(); + assertEquals("#text", name); + value = child.getNodeValue(); + assertEquals("Texas", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateentityreferenceknown"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreateprocessinginstruction.hpp b/tests/DOM/conformance/level1/core/documentcreateprocessinginstruction.hpp new file mode 100644 index 00000000..75c84540 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreateprocessinginstruction.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreateprocessinginstruction +#define test_documentcreateprocessinginstruction + +#include "dom_conf_test.hpp" + +/** + * The "createProcessingInstruction(target,data)" method + * creates a new ProcessingInstruction node with the + * specified name and data string. + * + * Retrieve the entire DOM document and invoke its + * "createProcessingInstruction(target,data)" method. + * It should create a new PI node with the specified target + * and data. The target, data and type are retrieved and + * output. +* @author NIST +* @author Mary Brady +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core# +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2001Apr/0020.html +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class documentcreateprocessinginstruction : public DOMTestCase +{ + public: + documentcreateprocessinginstruction(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + ProcessingInstruction newPINode; + String piValue; + String piName; + int piType; + doc = (Document) load("staff", true); + newPINode = doc.createProcessingInstruction(SA::construct_from_utf8("TESTPI"), SA::construct_from_utf8("This is a new PI node")); + assertNotNull(newPINode); + piName = newPINode.getNodeName(); + assertEquals("TESTPI", piName); + piValue = newPINode.getNodeValue(); + assertEquals("This is a new PI node", piValue); + piType = (int) newPINode.getNodeType(); + assertEquals(7, piType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreateprocessinginstruction"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentcreatetextnode.hpp b/tests/DOM/conformance/level1/core/documentcreatetextnode.hpp new file mode 100644 index 00000000..6226acde --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentcreatetextnode.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentcreatetextnode +#define test_documentcreatetextnode + +#include "dom_conf_test.hpp" + +/** + * The "createTextNode(data)" method creates a Text node + * given the specfied string. + * Retrieve the entire DOM document and invoke its + * "createTextNode(data)" method. It should create a + * new Text node whose "data" is the specified string. + * The NodeName and NodeType are also checked. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1975348127 +*/ + +template +class documentcreatetextnode : public DOMTestCase +{ + public: + documentcreatetextnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Text newTextNode; + String newTextName; + String newTextValue; + int newTextType; + doc = (Document) load("staff", true); + newTextNode = doc.createTextNode(SA::construct_from_utf8("This is a new Text node")); + newTextValue = newTextNode.getNodeValue(); + assertEquals("This is a new Text node", newTextValue); + newTextName = newTextNode.getNodeName(); + assertEquals("#text", newTextName); + newTextType = (int) newTextNode.getNodeType(); + assertEquals(3, newTextType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentcreatetextnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentgetdoctype.hpp b/tests/DOM/conformance/level1/core/documentgetdoctype.hpp new file mode 100644 index 00000000..91758a65 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentgetdoctype.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentgetdoctype +#define test_documentgetdoctype + +#include "dom_conf_test.hpp" + +/** + * The "getDoctype()" method returns the Document + * Type Declaration associated with this document. + * Retrieve the entire DOM document and invoke its + * "getDoctype()" method. The name of the document + * type should be returned. The "getName()" method + * should be equal to "staff" or "svg". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class documentgetdoctype : public DOMTestCase +{ + public: + documentgetdoctype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + String docTypeName; + String nodeValue; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + docTypeName = docType.getName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", docTypeName); + } else { + assertEquals("staff", docTypeName); + } + + nodeValue = docType.getNodeValue(); + assertNull(nodeValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetdoctype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentgetdoctypenodtd.hpp b/tests/DOM/conformance/level1/core/documentgetdoctypenodtd.hpp new file mode 100644 index 00000000..17c87a0f --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentgetdoctypenodtd.hpp @@ -0,0 +1,93 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentgetdoctypenodtd +#define test_documentgetdoctypenodtd + +#include "dom_conf_test.hpp" + +/** + * The "getDoctype()" method returns null for XML documents + * without a document type declaration. + * Retrieve the XML document without a DTD and invoke the + * "getDoctype()" method. It should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +*/ + +template +class documentgetdoctypenodtd : public DOMTestCase +{ + public: + documentgetdoctypenodtd(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_nodtdstaff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + doc = (Document) load("hc_nodtdstaff", false); + docType = doc.getDoctype(); + assertNull(docType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetdoctypenodtd"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentgetelementsbytagnamelength.hpp b/tests/DOM/conformance/level1/core/documentgetelementsbytagnamelength.hpp new file mode 100644 index 00000000..9f6eeb1b --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentgetelementsbytagnamelength.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentgetelementsbytagnamelength +#define test_documentgetelementsbytagnamelength + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(tagName)" method returns a + * NodeList of all the Elements with a given tagName. + * + * Retrieve the entire DOM document and invoke its + * "getElementsByTagName(tagName)" method with tagName + * equal to "name". The method should return a NodeList + * that contains 5 elements. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +*/ + +template +class documentgetelementsbytagnamelength : public DOMTestCase +{ + public: + documentgetelementsbytagnamelength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList nameList; + doc = (Document) load("staff", false); + nameList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + assertSize(5, nameList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetelementsbytagnamelength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentgetelementsbytagnametotallength.hpp b/tests/DOM/conformance/level1/core/documentgetelementsbytagnametotallength.hpp new file mode 100644 index 00000000..f7ea78f0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentgetelementsbytagnametotallength.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentgetelementsbytagnametotallength +#define test_documentgetelementsbytagnametotallength + +#include "dom_conf_test.hpp" + +/** + * Retrieve the entire DOM document, invoke + * getElementsByTagName("*") and check the length of the NodeList. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +*/ + +template +class documentgetelementsbytagnametotallength : public DOMTestCase +{ + public: + documentgetelementsbytagnametotallength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList nameList; + doc = (Document) load("staff", false); + nameList = doc.getElementsByTagName(SA::construct_from_utf8("*")); + + if (("image/svg+xml" == getContentType())) { + assertSize(39, nameList); + } else { + assertSize(37, nameList); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetelementsbytagnametotallength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentgetelementsbytagnamevalue.hpp b/tests/DOM/conformance/level1/core/documentgetelementsbytagnamevalue.hpp new file mode 100644 index 00000000..0b31ef27 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentgetelementsbytagnamevalue.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentgetelementsbytagnamevalue +#define test_documentgetelementsbytagnamevalue + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(tagName)" method returns a + * NodeList of all the Elements with a given tagName + * in a pre-order traversal of the tree. + * + * Retrieve the entire DOM document and invoke its + * "getElementsByTagName(tagName)" method with tagName + * equal to "name". The method should return a NodeList + * that contains 5 elements. The FOURTH item in the + * list is retrieved and output. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +*/ + +template +class documentgetelementsbytagnamevalue : public DOMTestCase +{ + public: + documentgetelementsbytagnamevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList nameList; + Node nameNode; + Node firstChild; + String childValue; + doc = (Document) load("staff", false); + nameList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = nameList.item(3); + firstChild = nameNode.getFirstChild(); + childValue = firstChild.getNodeValue(); + assertEquals("Jeny Oconnor", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetelementsbytagnamevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentgetimplementation.hpp b/tests/DOM/conformance/level1/core/documentgetimplementation.hpp new file mode 100644 index 00000000..70010a16 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentgetimplementation.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentgetimplementation +#define test_documentgetimplementation + +#include "dom_conf_test.hpp" + +/** + * The "getImplementation()" method returns the + * DOMImplementation object that handles this document. + * Retrieve the entire DOM document and invoke its + * "getImplementation()" method. It should return a + * DOMImplementation whose "hasFeature("XML","1.0") + * method returns the boolean value "true". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1B793EBA +*/ + +template +class documentgetimplementation : public DOMTestCase +{ + public: + documentgetimplementation(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DOMImplementation docImpl; + boolean state; + doc = (Document) load("staff", false); + docImpl = doc.getImplementation(); + state = docImpl.hasFeature(SA::construct_from_utf8("XML"), SA::construct_from_utf8("1.0")); +assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetimplementation"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentgetrootnode.hpp b/tests/DOM/conformance/level1/core/documentgetrootnode.hpp new file mode 100644 index 00000000..1f9753f2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentgetrootnode.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentgetrootnode +#define test_documentgetrootnode + +#include "dom_conf_test.hpp" + +/** + * The "getDocumentElement()" method provides direct access + * to the child node that is the root element of the document. + * Retrieve the entire DOM document and invoke its + * "getDocumentElement()" method. It should return an + * Element node whose NodeName is "staff" (or "svg"). +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-87CD092 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class documentgetrootnode : public DOMTestCase +{ + public: + documentgetrootnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element root; + String rootName; + doc = (Document) load("staff", false); + root = doc.getDocumentElement(); + rootName = root.getNodeName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", rootName); + } else { + assertEquals("staff", rootName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetrootnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateattribute.hpp b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateattribute.hpp new file mode 100644 index 00000000..ccb5981a --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateattribute.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentinvalidcharacterexceptioncreateattribute +#define test_documentinvalidcharacterexceptioncreateattribute + +#include "dom_conf_test.hpp" + +/** + * The "createAttribute(tagName)" method raises an + * INVALID_CHARACTER_ERR DOMException if the specified + * tagName contains an invalid character. + * + * Retrieve the entire DOM document and invoke its + * "createAttribute(tagName)" method with the tagName equal + * to the string "invalid^Name". Due to the invalid + * character the desired EXCEPTION should be raised. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class documentinvalidcharacterexceptioncreateattribute : public DOMTestCase +{ + public: + documentinvalidcharacterexceptioncreateattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr createdAttr; + doc = (Document) load("staff", true); + + { + boolean success = false; + try { + createdAttr = doc.createAttribute(SA::construct_from_utf8("invalid^Name")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateelement.hpp b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateelement.hpp new file mode 100644 index 00000000..5326d60a --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateelement.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentinvalidcharacterexceptioncreateelement +#define test_documentinvalidcharacterexceptioncreateelement + +#include "dom_conf_test.hpp" + +/** + * The "createElement(tagName)" method raises an + * INVALID_CHARACTER_ERR DOMException if the specified + * tagName contains an invalid character. + * + * Retrieve the entire DOM document and invoke its + * "createElement(tagName)" method with the tagName equal + * to the string "invalid^Name". Due to the invalid + * character the desired EXCEPTION should be raised. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class documentinvalidcharacterexceptioncreateelement : public DOMTestCase +{ + public: + documentinvalidcharacterexceptioncreateelement(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element badElement; + doc = (Document) load("staff", true); + + { + boolean success = false; + try { + badElement = doc.createElement(SA::construct_from_utf8("invalid^Name")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateelement"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateentref.hpp b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateentref.hpp new file mode 100644 index 00000000..345981f3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateentref.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentinvalidcharacterexceptioncreateentref +#define test_documentinvalidcharacterexceptioncreateentref + +#include "dom_conf_test.hpp" + +/** + * The "createEntityReference(tagName)" method raises an + * INVALID_CHARACTER_ERR DOMException if the specified + * tagName contains an invalid character. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-392B75AE')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class documentinvalidcharacterexceptioncreateentref : public DOMTestCase +{ + public: + documentinvalidcharacterexceptioncreateentref(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + EntityReference badEntityRef; + doc = (Document) load("hc_staff", true); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + badEntityRef = doc.createEntityReference(SA::construct_from_utf8("foo")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + + { + boolean success = false; + try { + badEntityRef = doc.createEntityReference(SA::construct_from_utf8("invalid^Name")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } +} + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateentref1.hpp b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateentref1.hpp new file mode 100644 index 00000000..d0ebea4c --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreateentref1.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentinvalidcharacterexceptioncreateentref1 +#define test_documentinvalidcharacterexceptioncreateentref1 + +#include "dom_conf_test.hpp" + +/** + * Creating an entity reference with an empty name should cause an INVALID_CHARACTER_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-392B75AE')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ + +template +class documentinvalidcharacterexceptioncreateentref1 : public DOMTestCase +{ + public: + documentinvalidcharacterexceptioncreateentref1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + EntityReference badEntityRef; + doc = (Document) load("hc_staff", true); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + badEntityRef = doc.createEntityReference(SA::construct_from_utf8("foo")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + + { + boolean success = false; + try { + badEntityRef = doc.createEntityReference(SA::construct_from_utf8("")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } +} + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreatepi.hpp b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreatepi.hpp new file mode 100644 index 00000000..5db00156 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreatepi.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentinvalidcharacterexceptioncreatepi +#define test_documentinvalidcharacterexceptioncreatepi + +#include "dom_conf_test.hpp" + +/** + * The "createProcessingInstruction(target,data) method + * raises an INVALID_CHARACTER_ERR DOMException if the + * specified tagName contains an invalid character. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class documentinvalidcharacterexceptioncreatepi : public DOMTestCase +{ + public: + documentinvalidcharacterexceptioncreatepi(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + ProcessingInstruction badPI; + doc = (Document) load("hc_staff", true); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + badPI = doc.createProcessingInstruction(SA::construct_from_utf8("foo"), SA::construct_from_utf8("data")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + + { + boolean success = false; + try { + badPI = doc.createProcessingInstruction(SA::construct_from_utf8("invalid^Name"), SA::construct_from_utf8("data")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } +} + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreatepi1.hpp b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreatepi1.hpp new file mode 100644 index 00000000..f63b533f --- /dev/null +++ b/tests/DOM/conformance/level1/core/documentinvalidcharacterexceptioncreatepi1.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documentinvalidcharacterexceptioncreatepi1 +#define test_documentinvalidcharacterexceptioncreatepi1 + +#include "dom_conf_test.hpp" + +/** + * Creating a processing instruction with an empty target should cause an INVALID_CHARACTER_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ + +template +class documentinvalidcharacterexceptioncreatepi1 : public DOMTestCase +{ + public: + documentinvalidcharacterexceptioncreatepi1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + ProcessingInstruction badPI; + doc = (Document) load("hc_staff", true); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + badPI = doc.createProcessingInstruction(SA::construct_from_utf8("foo"), SA::construct_from_utf8("data")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + + { + boolean success = false; + try { + badPI = doc.createProcessingInstruction(SA::construct_from_utf8(""), SA::construct_from_utf8("data")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } +} + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documenttypegetdoctype.hpp b/tests/DOM/conformance/level1/core/documenttypegetdoctype.hpp new file mode 100644 index 00000000..974efdba --- /dev/null +++ b/tests/DOM/conformance/level1/core/documenttypegetdoctype.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documenttypegetdoctype +#define test_documenttypegetdoctype + +#include "dom_conf_test.hpp" + +/** + * The "getName()" method contains the name of the DTD. + * + * Retrieve the Document Type for this document and examine + * the string returned by the "getName()" method. + * It should be set to "staff". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1844763134 +*/ + +template +class documenttypegetdoctype : public DOMTestCase +{ + public: + documenttypegetdoctype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + String name; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + name = docType.getName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", name); + } else { + assertEquals("staff", name); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetdoctype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documenttypegetentities.hpp b/tests/DOM/conformance/level1/core/documenttypegetentities.hpp new file mode 100644 index 00000000..4cd55056 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documenttypegetentities.hpp @@ -0,0 +1,131 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documenttypegetentities +#define test_documenttypegetentities + +#include "dom_conf_test.hpp" + +/** + * The "getEntities()" method is a NamedNodeMap that contains + * the general entities for this document. + * + * Retrieve the Document Type for this document and create + * a NamedNodeMap of all its entities. The entire map is + * traversed and the names of the entities are retrieved. + * There should be 5 entities. Duplicates should be ignored. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630 +*/ + +template +class documenttypegetentities : public DOMTestCase +{ + public: + documenttypegetentities(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entityList; + String name; + std::vector expectedResult; + expectedResult.push_back(SA::construct_from_utf8("ent1")); + expectedResult.push_back(SA::construct_from_utf8("ent2")); + expectedResult.push_back(SA::construct_from_utf8("ent3")); + expectedResult.push_back(SA::construct_from_utf8("ent4")); + expectedResult.push_back(SA::construct_from_utf8("ent5")); + + std::vector expectedResultSVG; + expectedResultSVG.push_back(SA::construct_from_utf8("ent1")); + expectedResultSVG.push_back(SA::construct_from_utf8("ent2")); + expectedResultSVG.push_back(SA::construct_from_utf8("ent3")); + expectedResultSVG.push_back(SA::construct_from_utf8("ent4")); + expectedResultSVG.push_back(SA::construct_from_utf8("ent5")); + expectedResultSVG.push_back(SA::construct_from_utf8("svgunit")); + expectedResultSVG.push_back(SA::construct_from_utf8("svgtest")); + + std::vector nameList; + + Node entity; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entityList = docType.getEntities(); + assertNotNull(entityList); + for (int indexN65659 = 0; indexN65659 != entityList.getLength(); indexN65659++) { + entity = (Node) entityList.item(indexN65659); + name = entity.getNodeName(); + nameList.push_back(name); + } + + if (("image/svg+xml" == getContentType())) { + assertEquals(expectedResultSVG, nameList); + } else { + assertEquals(expectedResult, nameList); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetentities"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documenttypegetentitieslength.hpp b/tests/DOM/conformance/level1/core/documenttypegetentitieslength.hpp new file mode 100644 index 00000000..f6d8cc09 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documenttypegetentitieslength.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documenttypegetentitieslength +#define test_documenttypegetentitieslength + +#include "dom_conf_test.hpp" + +/** + * Duplicate entities are to be discarded. + * Retrieve the Document Type for this document and create + * a NamedNodeMap of all its entities. The entity named + * "ent1" is defined twice and therefore that last + * occurrance should be discarded. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630 +*/ + +template +class documenttypegetentitieslength : public DOMTestCase +{ + public: + documenttypegetentitieslength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entityList; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entityList = docType.getEntities(); + assertNotNull(entityList); + + if (("image/svg+xml" == getContentType())) { + assertSize(7, entityList); + } else { + assertSize(5, entityList); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetentitieslength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documenttypegetentitiestype.hpp b/tests/DOM/conformance/level1/core/documenttypegetentitiestype.hpp new file mode 100644 index 00000000..9b55226b --- /dev/null +++ b/tests/DOM/conformance/level1/core/documenttypegetentitiestype.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documenttypegetentitiestype +#define test_documenttypegetentitiestype + +#include "dom_conf_test.hpp" + +/** + * Every node in the map returned by the "getEntities()" + * method implements the Entity interface. + * + * Retrieve the Document Type for this document and create + * a NamedNodeMap of all its entities. Traverse the + * entire list and examine the NodeType of each node + * in the list. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630 +*/ + +template +class documenttypegetentitiestype : public DOMTestCase +{ + public: + documenttypegetentitiestype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entityList; + Node entity; + int entityType; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entityList = docType.getEntities(); + assertNotNull(entityList); + for (int indexN65609 = 0; indexN65609 != entityList.getLength(); indexN65609++) { + entity = (Node) entityList.item(indexN65609); + entityType = (int) entity.getNodeType(); + assertEquals(6, entityType); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetentitiestype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documenttypegetnotations.hpp b/tests/DOM/conformance/level1/core/documenttypegetnotations.hpp new file mode 100644 index 00000000..b60492a1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/documenttypegetnotations.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documenttypegetnotations +#define test_documenttypegetnotations + +#include "dom_conf_test.hpp" + +/** + * The "getNotations()" method creates a NamedNodeMap that + * contains all the notations declared in the DTD. + * + * Retrieve the Document Type for this document and create + * a NamedNodeMap object of all the notations. There + * should be two items in the list (notation1 and notation2). +* @author NIST +* @author Mary Brady +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF +*/ + +template +class documenttypegetnotations : public DOMTestCase +{ + public: + documenttypegetnotations(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notationList; + Node notation; + String notationName; + std::vector actual; + + std::vector expected; + expected.push_back(SA::construct_from_utf8("notation1")); + expected.push_back(SA::construct_from_utf8("notation2")); + + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notationList = docType.getNotations(); + assertNotNull(notationList); + for (int indexN65627 = 0; indexN65627 != notationList.getLength(); indexN65627++) { + notation = (Node) notationList.item(indexN65627); + notationName = notation.getNodeName(); + actual.push_back(notationName); + } + assertEquals(expected, actual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetnotations"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/documenttypegetnotationstype.hpp b/tests/DOM/conformance/level1/core/documenttypegetnotationstype.hpp new file mode 100644 index 00000000..a6a81aec --- /dev/null +++ b/tests/DOM/conformance/level1/core/documenttypegetnotationstype.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_documenttypegetnotationstype +#define test_documenttypegetnotationstype + +#include "dom_conf_test.hpp" + +/** + * Every node in the map returned by the "getNotations()" + * method implements the Notation interface. + * + * Retrieve the Document Type for this document and create + * a NamedNodeMap object of all the notations. Traverse + * the entire list and examine the NodeType of each node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF +*/ + +template +class documenttypegetnotationstype : public DOMTestCase +{ + public: + documenttypegetnotationstype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notationList; + Node notation; + int notationType; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notationList = docType.getNotations(); + assertNotNull(notationList); + for (int indexN65609 = 0; indexN65609 != notationList.getLength(); indexN65609++) { + notation = (Node) notationList.item(indexN65609); + notationType = (int) notation.getNodeType(); + assertEquals(12, notationType); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetnotationstype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/domimplementationfeaturenoversion.hpp b/tests/DOM/conformance/level1/core/domimplementationfeaturenoversion.hpp new file mode 100644 index 00000000..7122149d --- /dev/null +++ b/tests/DOM/conformance/level1/core/domimplementationfeaturenoversion.hpp @@ -0,0 +1,93 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_domimplementationfeaturenoversion +#define test_domimplementationfeaturenoversion + +#include "dom_conf_test.hpp" + +/** + * hasFeature("XML", "") should return true for implementations that can read staff files. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +* @see http://www.w3.org/2000/11/DOM-Level-2-errata#core-14 +*/ + +template +class domimplementationfeaturenoversion : public DOMTestCase +{ + public: + domimplementationfeaturenoversion(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DOMImplementation domImpl; + boolean state; + doc = (Document) load("staff", false); + domImpl = doc.getImplementation(); + state = domImpl.hasFeature(SA::construct_from_utf8("XML"), SA::construct_from_utf8("")); +assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/domimplementationfeaturenoversion"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/domimplementationfeaturenull.hpp b/tests/DOM/conformance/level1/core/domimplementationfeaturenull.hpp new file mode 100644 index 00000000..2bd8862b --- /dev/null +++ b/tests/DOM/conformance/level1/core/domimplementationfeaturenull.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_domimplementationfeaturenull +#define test_domimplementationfeaturenull + +#include "dom_conf_test.hpp" + +/** + * hasFeature("XML", null) should return true for implementations that can read staff documents. +* @author NIST +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +* @see http://www.w3.org/2000/11/DOM-Level-2-errata#core-14 +*/ + +template +class domimplementationfeaturenull : public DOMTestCase +{ + public: + domimplementationfeaturenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DOMImplementation domImpl; + boolean state; + String nullVersion; + doc = (Document) load("staff", false); + domImpl = doc.getImplementation(); + state = domImpl.hasFeature(SA::construct_from_utf8("XML"), nullVersion); +assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/domimplementationfeaturenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/domimplementationfeaturexml.hpp b/tests/DOM/conformance/level1/core/domimplementationfeaturexml.hpp new file mode 100644 index 00000000..b7d72b94 --- /dev/null +++ b/tests/DOM/conformance/level1/core/domimplementationfeaturexml.hpp @@ -0,0 +1,92 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_domimplementationfeaturexml +#define test_domimplementationfeaturexml + +#include "dom_conf_test.hpp" + +/** + * hasFeature("xml", "1.0") should return true for implementations that can read staff documents. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +*/ + +template +class domimplementationfeaturexml : public DOMTestCase +{ + public: + domimplementationfeaturexml(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DOMImplementation domImpl; + boolean state; + doc = (Document) load("staff", false); + domImpl = doc.getImplementation(); + state = domImpl.hasFeature(SA::construct_from_utf8("xml"), SA::construct_from_utf8("1.0")); +assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/domimplementationfeaturexml"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementaddnewattribute.hpp b/tests/DOM/conformance/level1/core/elementaddnewattribute.hpp new file mode 100644 index 00000000..aa814d38 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementaddnewattribute.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementaddnewattribute +#define test_elementaddnewattribute + +#include "dom_conf_test.hpp" + +/** + * The "setAttribute(name,value)" method adds a new attribute + * to the Element + * + * Retrieve the last child of the last employee, then + * add an attribute to it by invoking the + * "setAttribute(name,value)" method. It should create + * a "name" attribute with an assigned value equal to + * "value". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +*/ + +template +class elementaddnewattribute : public DOMTestCase +{ + public: + elementaddnewattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + String attrValue; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(4); + testEmployee.setAttribute(SA::construct_from_utf8("district"), SA::construct_from_utf8("dallas")); + attrValue = testEmployee.getAttribute(SA::construct_from_utf8("district")); + assertEquals("dallas", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementaddnewattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementassociatedattribute.hpp b/tests/DOM/conformance/level1/core/elementassociatedattribute.hpp new file mode 100644 index 00000000..985ad14c --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementassociatedattribute.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementassociatedattribute +#define test_elementassociatedattribute + +#include "dom_conf_test.hpp" + +/** + * Elements may have attributes associated with them. + * + * Retrieve the first attribute from the last child of + * the first employee and invoke the "getSpecified()" + * method. This test is only intended to show that + * Elements can actually have attributes. This test uses + * the "getNamedItem(name)" method from the NamedNodeMap + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class elementassociatedattribute : public DOMTestCase +{ + public: + elementassociatedattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Attr domesticAttr; + boolean specified; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = elementList.item(0); + attributes = testEmployee.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic")); + specified = domesticAttr.getSpecified(); + assertTrue(specified); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementassociatedattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementchangeattributevalue.hpp b/tests/DOM/conformance/level1/core/elementchangeattributevalue.hpp new file mode 100644 index 00000000..43ca71a1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementchangeattributevalue.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementchangeattributevalue +#define test_elementchangeattributevalue + +#include "dom_conf_test.hpp" + +/** + * The "setAttribute(name,value)" method adds a new attribute + * to the Element. If the "name" is already present, then + * its value should be changed to the new one that is in + * the "value" parameter. + * + * Retrieve the last child of the fourth employee, then add + * an attribute to it by invoking the + * "setAttribute(name,value)" method. Since the name of the + * used attribute("street") is already present in this + * element, then its value should be changed to the new one + * of the "value" parameter. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +*/ + +template +class elementchangeattributevalue : public DOMTestCase +{ + public: + elementchangeattributevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + String attrValue; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(3); + testEmployee.setAttribute(SA::construct_from_utf8("street"), SA::construct_from_utf8("Neither")); + attrValue = testEmployee.getAttribute(SA::construct_from_utf8("street")); + assertEquals("Neither", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementchangeattributevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementcreatenewattribute.hpp b/tests/DOM/conformance/level1/core/elementcreatenewattribute.hpp new file mode 100644 index 00000000..214dc55d --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementcreatenewattribute.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementcreatenewattribute +#define test_elementcreatenewattribute + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method adds a new + * attribute to the Element. + * + * Retrieve first address element and add + * a new attribute node to it by invoking its + * "setAttributeNode(newAttr)" method. This test makes use + * of the "createAttribute(name)" method from the Document + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ + +template +class elementcreatenewattribute : public DOMTestCase +{ + public: + elementcreatenewattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddress; + Attr newAttribute; + Attr oldAttr; + Attr districtAttr; + String attrVal; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = (Element) elementList.item(0); + newAttribute = doc.createAttribute(SA::construct_from_utf8("district")); + oldAttr = testAddress.setAttributeNode(newAttribute); + assertNull(oldAttr); + districtAttr = testAddress.getAttributeNode(SA::construct_from_utf8("district")); + assertNotNull(districtAttr); + attrVal = testAddress.getAttribute(SA::construct_from_utf8("district")); + assertEquals("", attrVal); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementcreatenewattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementgetattributenode.hpp b/tests/DOM/conformance/level1/core/elementgetattributenode.hpp new file mode 100644 index 00000000..6fc06361 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementgetattributenode.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementgetattributenode +#define test_elementgetattributenode + +#include "dom_conf_test.hpp" + +/** + * The "getAttributeNode(name)" method retrieves an + * attribute node by name. + * + * Retrieve the attribute "domestic" from the last child + * of the first employee. Since the method returns an + * Attr object, the "name" can be examined to ensure the + * proper attribute was retrieved. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8 +*/ + +template +class elementgetattributenode : public DOMTestCase +{ + public: + elementgetattributenode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr domesticAttr; + String name; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(0); + domesticAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("domestic")); + name = domesticAttr.getNodeName(); + assertEquals("domestic", name); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetattributenode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementgetattributenodenull.hpp b/tests/DOM/conformance/level1/core/elementgetattributenodenull.hpp new file mode 100644 index 00000000..847ab03e --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementgetattributenodenull.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementgetattributenodenull +#define test_elementgetattributenodenull + +#include "dom_conf_test.hpp" + +/** + * The "getAttributeNode(name)" method retrieves an + * attribute node by name. It should return null if the + * "name" attribute does not exist. + * + * Retrieve the last child of the first employee and attempt + * to retrieve a non-existing attribute. The method should + * return "null". The non-existing attribute to be used + * is "invalidAttribute". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8 +*/ + +template +class elementgetattributenodenull : public DOMTestCase +{ + public: + elementgetattributenodenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr domesticAttr; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(0); + domesticAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("invalidAttribute")); + assertNull(domesticAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetattributenodenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementgetelementempty.hpp b/tests/DOM/conformance/level1/core/elementgetelementempty.hpp new file mode 100644 index 00000000..1da7afd7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementgetelementempty.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementgetelementempty +#define test_elementgetelementempty + +#include "dom_conf_test.hpp" + +/** + * The "getAttribute(name)" method returns an empty + * string if no value was assigned to an attribute and + * no default value was given in the DTD file. + * + * Retrieve the last child of the last employee, then + * invoke "getAttribute(name)" method, where "name" is an + * attribute without a specified or DTD default value. + * The "getAttribute(name)" method should return the empty + * string. This method makes use of the + * "createAttribute(newAttr)" method from the Document + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9 +*/ + +template +class elementgetelementempty : public DOMTestCase +{ + public: + elementgetelementempty(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr newAttribute; + NodeList elementList; + Element testEmployee; + Attr domesticAttr; + String attrValue; + doc = (Document) load("staff", true); + newAttribute = doc.createAttribute(SA::construct_from_utf8("district")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(3); + domesticAttr = testEmployee.setAttributeNode(newAttribute); + attrValue = testEmployee.getAttribute(SA::construct_from_utf8("district")); + assertEquals("", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementempty"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementgetelementsbytagname.hpp b/tests/DOM/conformance/level1/core/elementgetelementsbytagname.hpp new file mode 100644 index 00000000..4f0e3fa6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementgetelementsbytagname.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementgetelementsbytagname +#define test_elementgetelementsbytagname + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(name)" method returns a list + * of all descendant Elements with the given tag name. + * Test for an empty list. + * Create a NodeList of all the descendant elements + * using the string "noMatch" as the tagName. + * The method should return a NodeList whose length is + * "0" since there are not any descendant elements + * that match the given tag name. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ + +template +class elementgetelementsbytagname : public DOMTestCase +{ + public: + elementgetelementsbytagname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + assertSize(5, elementList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementgetelementsbytagnameaccessnodelist.hpp b/tests/DOM/conformance/level1/core/elementgetelementsbytagnameaccessnodelist.hpp new file mode 100644 index 00000000..747022c1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementgetelementsbytagnameaccessnodelist.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementgetelementsbytagnameaccessnodelist +#define test_elementgetelementsbytagnameaccessnodelist + +#include "dom_conf_test.hpp" + +/** + * Element.getElementsByTagName("employee") should return a NodeList whose length is + * "5" in the order the children were encountered. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ + +template +class elementgetelementsbytagnameaccessnodelist : public DOMTestCase +{ + public: + elementgetelementsbytagnameaccessnodelist(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Node child; + String childName; + String childValue; + int childType; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + testEmployee = (Element) elementList.item(3); + child = testEmployee.getFirstChild(); + childType = (int) child.getNodeType(); + + if (equals(3, childType)) { + child = child.getNextSibling(); + } + childName = child.getNodeName(); + assertEquals("employeeId", childName); + child = child.getFirstChild(); + childValue = child.getNodeValue(); + assertEquals("EMP0004", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagnameaccessnodelist"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementgetelementsbytagnamenomatch.hpp b/tests/DOM/conformance/level1/core/elementgetelementsbytagnamenomatch.hpp new file mode 100644 index 00000000..cf4b1b08 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementgetelementsbytagnamenomatch.hpp @@ -0,0 +1,95 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementgetelementsbytagnamenomatch +#define test_elementgetelementsbytagnamenomatch + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(name)" method returns a list + * of all descendant Elements with the given tag name. + * Create a NodeList of all the descendant elements + * using the string "employee" as the tagName. + * The method should return a NodeList whose length is + * "5". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ + +template +class elementgetelementsbytagnamenomatch : public DOMTestCase +{ + public: + elementgetelementsbytagnamenomatch(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("noMatch")); + assertSize(0, elementList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagnamenomatch"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementgetelementsbytagnamespecialvalue.hpp b/tests/DOM/conformance/level1/core/elementgetelementsbytagnamespecialvalue.hpp new file mode 100644 index 00000000..87a0dbeb --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementgetelementsbytagnamespecialvalue.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementgetelementsbytagnamespecialvalue +#define test_elementgetelementsbytagnamespecialvalue + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(name)" method may use the + * special value "*" to match all tags in the element + * tree. + * Create a NodeList of all the descendant elements + * of the last employee by using the special value "*". + * The method should return all the descendant children(6) + * in the order the children were encountered. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ + +template +class elementgetelementsbytagnamespecialvalue : public DOMTestCase +{ + public: + elementgetelementsbytagnamespecialvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element lastEmployee; + NodeList lastempList; + Node child; + String childName; + std::vector result; + + std::vector expectedResult; + expectedResult.push_back(SA::construct_from_utf8("employeeId")); + expectedResult.push_back(SA::construct_from_utf8("name")); + expectedResult.push_back(SA::construct_from_utf8("position")); + expectedResult.push_back(SA::construct_from_utf8("salary")); + expectedResult.push_back(SA::construct_from_utf8("gender")); + expectedResult.push_back(SA::construct_from_utf8("address")); + + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + lastEmployee = (Element) elementList.item(4); + lastempList = lastEmployee.getElementsByTagName(SA::construct_from_utf8("*")); + for (int indexN65642 = 0; indexN65642 != lastempList.getLength(); indexN65642++) { + child = (Node) lastempList.item(indexN65642); + childName = child.getNodeName(); + result.push_back(childName); + } + assertEquals(expectedResult, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgetelementsbytagnamespecialvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementgettagname.hpp b/tests/DOM/conformance/level1/core/elementgettagname.hpp new file mode 100644 index 00000000..e4bef6fa --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementgettagname.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementgettagname +#define test_elementgettagname + +#include "dom_conf_test.hpp" + +/** + * The "getTagName()" method returns the + * tagName of an element. + * + * Invoke the "getTagName()" method one the + * root node. The value returned should be "staff". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class elementgettagname : public DOMTestCase +{ + public: + elementgettagname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element root; + String tagname; + doc = (Document) load("staff", false); + root = doc.getDocumentElement(); + tagname = root.getTagName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", tagname); + } else { + assertEquals("staff", tagname); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementgettagname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementinuseattributeerr.hpp b/tests/DOM/conformance/level1/core/elementinuseattributeerr.hpp new file mode 100644 index 00000000..869ea97b --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementinuseattributeerr.hpp @@ -0,0 +1,123 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementinuseattributeerr +#define test_elementinuseattributeerr + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method raises an + * "INUSE_ATTRIBUTE_ERR DOMException if the "newAttr" + * is already an attribute of another element. + * + * Retrieve the last child of the second employee and append + * a newly created element. The "createAttribute(name)" + * and "setAttributeNode(newAttr)" methods are invoked + * to create and add a new attribute to the newly created + * Element. The "setAttributeNode(newAttr)" method is + * once again called to add the new attribute causing an + * exception to be raised since the attribute is already + * an attribute of another element. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +*/ + +template +class elementinuseattributeerr : public DOMTestCase +{ + public: + elementinuseattributeerr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr newAttribute; + NodeList addressElementList; + Element testAddress; + Element newElement; + Node appendedChild; + Attr setAttr1; + Attr setAttr2; + doc = (Document) load("staff", true); + addressElementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = (Element) addressElementList.item(1); + newElement = doc.createElement(SA::construct_from_utf8("newElement")); + appendedChild = testAddress.appendChild(newElement); + newAttribute = doc.createAttribute(SA::construct_from_utf8("newAttribute")); + setAttr1 = newElement.setAttributeNode(newAttribute); + + { + boolean success = false; + try { + setAttr2 = testAddress.setAttributeNode(newAttribute); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INUSE_ATTRIBUTE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementinuseattributeerr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementinvalidcharacterexception.hpp b/tests/DOM/conformance/level1/core/elementinvalidcharacterexception.hpp new file mode 100644 index 00000000..447c79c9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementinvalidcharacterexception.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementinvalidcharacterexception +#define test_elementinvalidcharacterexception + +#include "dom_conf_test.hpp" + +/** + * The "setAttribute(name,value)" method raises an + * "INVALID_CHARACTER_ERR DOMException if the specified + * name contains an invalid character. + * + * Retrieve the last child of the first employee and + * call its "setAttribute(name,value)" method with + * "name" containing an invalid character. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class elementinvalidcharacterexception : public DOMTestCase +{ + public: + elementinvalidcharacterexception(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddress; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = (Element) elementList.item(0); + + { + boolean success = false; + try { + testAddress.setAttribute(SA::construct_from_utf8("invalid^Name"), SA::construct_from_utf8("value")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementinvalidcharacterexception"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementnormalize.hpp b/tests/DOM/conformance/level1/core/elementnormalize.hpp new file mode 100644 index 00000000..c3549b74 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementnormalize.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementnormalize +#define test_elementnormalize + +#include "dom_conf_test.hpp" + +/** + * The "normalize()" method puts all the nodes in the full + * depth of the sub-tree underneath this element into a + * "normal" form. + * + * Retrieve the third employee and access its second child. + * This child contains a block of text that is spread + * across multiple lines. The content of the "name" child + * should be parsed and treated as a single Text node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083 +*/ + +template +class elementnormalize : public DOMTestCase +{ + public: + elementnormalize(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element root; + NodeList elementList; + Element testName; + Node firstChild; + String childValue; + doc = (Document) load("staff", true); + root = doc.getDocumentElement(); + root.normalize(); + elementList = root.getElementsByTagName(SA::construct_from_utf8("name")); + testName = (Element) elementList.item(2); + firstChild = testName.getFirstChild(); + childValue = firstChild.getNodeValue(); + assertEquals("Roger\n Jones", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementnormalize"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementnotfounderr.hpp b/tests/DOM/conformance/level1/core/elementnotfounderr.hpp new file mode 100644 index 00000000..63ca7cdf --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementnotfounderr.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementnotfounderr +#define test_elementnotfounderr + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method raises a + * NOT_FOUND_ERR DOMException if the "oldAttr" attribute + * is not an attribute of the element. + * + * Retrieve the last employee and attempt to remove + * a non existing attribute node. This should cause the + * intended exception to be raised. This test makes use + * of the "createAttribute(name)" method from the Document + * interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class elementnotfounderr : public DOMTestCase +{ + public: + elementnotfounderr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr oldAttribute; + NodeList addressElementList; + Element testAddress; + Attr attrAddress; + doc = (Document) load("staff", true); + addressElementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = (Element) addressElementList.item(4); + oldAttribute = doc.createAttribute(SA::construct_from_utf8("oldAttribute")); + + { + boolean success = false; + try { + attrAddress = testAddress.removeAttributeNode(oldAttribute); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementnotfounderr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementremoveattribute.hpp b/tests/DOM/conformance/level1/core/elementremoveattribute.hpp new file mode 100644 index 00000000..2f1be61a --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementremoveattribute.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementremoveattribute +#define test_elementremoveattribute + +#include "dom_conf_test.hpp" + +/** + * The "removeAttribute(name)" removes an attribute by name. + * If the attribute has a default value, it is immediately + * replaced. + * + * Retrieve the attribute named "street" from the last child + * of the fourth employee, then remove the "street" + * attribute by invoking the "removeAttribute(name)" method. + * The "street" attribute has a default value defined in the + * DTD file, that value should immediately replace the old + * value. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class elementremoveattribute : public DOMTestCase +{ + public: + elementremoveattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + String attrValue; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(3); + testEmployee.removeAttribute(SA::construct_from_utf8("street")); + attrValue = testEmployee.getAttribute(SA::construct_from_utf8("street")); + assertEquals("Yes", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementremoveattributeaftercreate.hpp b/tests/DOM/conformance/level1/core/elementremoveattributeaftercreate.hpp new file mode 100644 index 00000000..181736f0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementremoveattributeaftercreate.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementremoveattributeaftercreate +#define test_elementremoveattributeaftercreate + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method removes the + * specified attribute. + * + * Retrieve the last child of the third employee, add a + * new "district" node to it and then try to remove it. + * To verify that the node was removed use the + * "getNamedItem(name)" method from the NamedNodeMap + * interface. It also uses the "getAttributes()" method + * from the Node interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +*/ + +template +class elementremoveattributeaftercreate : public DOMTestCase +{ + public: + elementremoveattributeaftercreate(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr newAttribute; + NamedNodeMap attributes; + Attr districtAttr; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("district")); + districtAttr = testEmployee.setAttributeNode(newAttribute); + districtAttr = testEmployee.removeAttributeNode(newAttribute); + attributes = testEmployee.getAttributes(); + districtAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("district")); + assertNull(districtAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributeaftercreate"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementremoveattributenode.hpp b/tests/DOM/conformance/level1/core/elementremoveattributenode.hpp new file mode 100644 index 00000000..83df28da --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementremoveattributenode.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementremoveattributenode +#define test_elementremoveattributenode + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method returns the + * node that was removed. + * + * Retrieve the last child of the third employee and + * remove its "street" Attr node. The method should + * return the old attribute node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +*/ + +template +class elementremoveattributenode : public DOMTestCase +{ + public: + elementremoveattributenode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr streetAttr; + Attr removedAttr; + String removedValue; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(2); + streetAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("street")); + removedAttr = testEmployee.removeAttributeNode(streetAttr); + removedValue = removedAttr.getValue(); + assertEquals("No", removedValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementremoveattributenodenomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/elementremoveattributenodenomodificationallowederr.hpp new file mode 100644 index 00000000..c626a6ec --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementremoveattributenodenomodificationallowederr.hpp @@ -0,0 +1,133 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementremoveattributenodenomodificationallowederr +#define test_elementremoveattributenodenomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Try to remove the "domestic" attribute + * from the entity reference by executing the "removeAttributeNode(oldAttr)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +*/ + +template +class elementremoveattributenodenomodificationallowederr : public DOMTestCase +{ + public: + elementremoveattributenodenomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + NodeList genList; + Node gen; + int nodeType; + NodeList gList; + Element genElement; + NamedNodeMap attrList; + Attr attrNode; + Attr removedAttr; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + genList = gender.getChildNodes(); + gen = genList.item(0); + assertNotNull(gen); + nodeType = (int) gen.getNodeType(); + + if (equals(1, nodeType)) { + gen = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(gen); + } + gList = gen.getChildNodes(); + genElement = (Element) gList.item(0); + assertNotNull(genElement); + attrList = genElement.getAttributes(); + attrNode = (Attr) attrList.getNamedItem(SA::construct_from_utf8("domestic")); + + { + boolean success = false; + try { + removedAttr = genElement.removeAttributeNode(attrNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenodenomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementremoveattributenodenomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/elementremoveattributenodenomodificationallowederrEE.hpp new file mode 100644 index 00000000..2f5b2b19 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementremoveattributenodenomodificationallowederrEE.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementremoveattributenodenomodificationallowederrEE +#define test_elementremoveattributenodenomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Create an entity reference and add it to the children of the THIRD "gender" element. + * Try to remove the "domestic" attribute from the entity + * reference by executing the "removeAttributeNode(oldAttr)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenodenomodificationallowederr.xml +*/ + +template +class elementremoveattributenodenomodificationallowederrEE : public DOMTestCase +{ + public: + elementremoveattributenodenomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + EntityReference entRef; + Element entElement; + NamedNodeMap attrList; + Attr attrNode; + Attr removedAttr; + Node appendedChild; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + appendedChild = gender.appendChild(entRef); + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + attrList = entElement.getAttributes(); + attrNode = (Attr) attrList.getNamedItem(SA::construct_from_utf8("domestic")); + assertNotNull(attrNode); + + { + boolean success = false; + try { + removedAttr = entElement.removeAttributeNode(attrNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenodenomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementremoveattributenomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/elementremoveattributenomodificationallowederr.hpp new file mode 100644 index 00000000..5afb0762 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementremoveattributenomodificationallowederr.hpp @@ -0,0 +1,128 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementremoveattributenomodificationallowederr +#define test_elementremoveattributenomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "removeAttribute(name)" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Try to remove the "domestic" attribute + * from the entity reference by executing the "removeAttribute(name)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6D6AC0F9')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 +*/ + +template +class elementremoveattributenomodificationallowederr : public DOMTestCase +{ + public: + elementremoveattributenomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + NodeList genList; + Node gen; + NodeList gList; + int nodeType; + Element genElement; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + genList = gender.getChildNodes(); + gen = genList.item(0); + assertNotNull(gen); + nodeType = (int) gen.getNodeType(); + + if (equals(1, nodeType)) { + gen = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(gen); + } + gList = gen.getChildNodes(); + genElement = (Element) gList.item(0); + assertNotNull(genElement); + + { + boolean success = false; + try { + genElement.removeAttribute(SA::construct_from_utf8("domestic")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementremoveattributenomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/elementremoveattributenomodificationallowederrEE.hpp new file mode 100644 index 00000000..240b6236 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementremoveattributenomodificationallowederrEE.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementremoveattributenomodificationallowederrEE +#define test_elementremoveattributenomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "removeAttribute(name)" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Create an reference the entity ent4 and add it to the THIRD "gender" element. + * Try to remove the "domestic" attribute from the entity reference by executing the "removeAttribute(name)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6D6AC0F9')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederr.xml +*/ + +template +class elementremoveattributenomodificationallowederrEE : public DOMTestCase +{ + public: + elementremoveattributenomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + EntityReference entRef; + Element entElement; + Node appendedChild; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + appendedChild = gender.appendChild(entRef); + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + + { + boolean success = false; + try { + entElement.removeAttribute(SA::construct_from_utf8("domestic")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributenomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementremoveattributerestoredefaultvalue.hpp b/tests/DOM/conformance/level1/core/elementremoveattributerestoredefaultvalue.hpp new file mode 100644 index 00000000..556155b9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementremoveattributerestoredefaultvalue.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementremoveattributerestoredefaultvalue +#define test_elementremoveattributerestoredefaultvalue + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method removes the + * specified attribute node and restores any default values. + * + * Retrieve the last child of the third employeed and + * remove its "street" Attr node. Since this node has a + * default value defined in the DTD file, that default + * should immediately be the new value. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class elementremoveattributerestoredefaultvalue : public DOMTestCase +{ + public: + elementremoveattributerestoredefaultvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr streetAttr; + String attribute; + Attr removedAttr; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(2); + streetAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("street")); + removedAttr = testEmployee.removeAttributeNode(streetAttr); + attribute = testEmployee.getAttribute(SA::construct_from_utf8("street")); + assertEquals("Yes", attribute); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementremoveattributerestoredefaultvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementreplaceattributewithself.hpp b/tests/DOM/conformance/level1/core/elementreplaceattributewithself.hpp new file mode 100644 index 00000000..438ba12d --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementreplaceattributewithself.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementreplaceattributewithself +#define test_elementreplaceattributewithself + +#include "dom_conf_test.hpp" + +/** + * This test calls setAttributeNode to replace an attribute with itself. + * Since the node is not an attribute of another Element, it would + * be inappropriate to throw an INUSE_ATTRIBUTE_ERR. + * This test was derived from elementinuserattributeerr which + * inadvertanly made this test. +* @author Curt Arnold +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ + +template +class elementreplaceattributewithself : public DOMTestCase +{ + public: + elementreplaceattributewithself(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr streetAttr; + Attr replacedAttr; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(2); + streetAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("street")); + replacedAttr = testEmployee.setAttributeNode(streetAttr); + assertSame(streetAttr, replacedAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementreplaceattributewithself"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementreplaceexistingattribute.hpp b/tests/DOM/conformance/level1/core/elementreplaceexistingattribute.hpp new file mode 100644 index 00000000..f5a11356 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementreplaceexistingattribute.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementreplaceexistingattribute +#define test_elementreplaceexistingattribute + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method adds a new + * attribute to the Element. If the "newAttr" Attr node is + * already present in this element, it should replace the + * existing one. + * + * Retrieve the last child of the third employee and add a + * new attribute node by invoking the "setAttributeNode(new + * Attr)" method. The new attribute node to be added is + * "street", which is already present in this element. The + * method should replace the existing Attr node with the + * new one. This test uses the "createAttribute(name)" + * method from the Document interface. +* @author NIST +* @author Mary Brady +*/ + +template +class elementreplaceexistingattribute : public DOMTestCase +{ + public: + elementreplaceexistingattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr newAttribute; + String name; + Attr setAttr; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("street")); + setAttr = testEmployee.setAttributeNode(newAttribute); + name = testEmployee.getAttribute(SA::construct_from_utf8("street")); + assertEquals("", name); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementreplaceexistingattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementreplaceexistingattributegevalue.hpp b/tests/DOM/conformance/level1/core/elementreplaceexistingattributegevalue.hpp new file mode 100644 index 00000000..4a295433 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementreplaceexistingattributegevalue.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementreplaceexistingattributegevalue +#define test_elementreplaceexistingattributegevalue + +#include "dom_conf_test.hpp" + +/** + * If the "setAttributeNode(newAttr)" method replaces an + * existing Attr node with the same name, then it should + * return the previously existing Attr node. + * Retrieve the last child of the third employee and add a + * new attribute node. The new attribute node is "street", + * which is already present in this Element. The method + * should return the existing Attr node(old "street" Attr). + * This test uses the "createAttribute(name)" method + * from the Document interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ + +template +class elementreplaceexistingattributegevalue : public DOMTestCase +{ + public: + elementreplaceexistingattributegevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr newAttribute; + Attr streetAttr; + String value; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("street")); + streetAttr = testEmployee.setAttributeNode(newAttribute); + value = streetAttr.getValue(); + assertEquals("No", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementreplaceexistingattributegevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementretrieveallattributes.hpp b/tests/DOM/conformance/level1/core/elementretrieveallattributes.hpp new file mode 100644 index 00000000..787a90ed --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementretrieveallattributes.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementretrieveallattributes +#define test_elementretrieveallattributes + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method(Node Interface) may + * be used to retrieve the set of all attributes of an + * element. + * + * Create a list of all the attributes of the last child + * of the first employee by using the "getAttributes()" + * method. Examine the length of the attribute list. + * This test uses the "getLength()" method from the + * NameNodeMap interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class elementretrieveallattributes : public DOMTestCase +{ + public: + elementretrieveallattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testAddress; + NamedNodeMap attributes; + doc = (Document) load("staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = addressList.item(0); + attributes = testAddress.getAttributes(); + assertSize(2, attributes); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementretrieveallattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementretrieveattrvalue.hpp b/tests/DOM/conformance/level1/core/elementretrieveattrvalue.hpp new file mode 100644 index 00000000..a140f0f7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementretrieveattrvalue.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementretrieveattrvalue +#define test_elementretrieveattrvalue + +#include "dom_conf_test.hpp" + +/** + * The "getAttribute(name)" method returns an attribute + * value by name. + * + * Retrieve the second address element, then + * invoke the 'getAttribute("street")' method. This should + * return the value of the attribute("No"). +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9 +*/ + +template +class elementretrieveattrvalue : public DOMTestCase +{ + public: + elementretrieveattrvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddress; + String attrValue; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = (Element) elementList.item(2); + attrValue = testAddress.getAttribute(SA::construct_from_utf8("street")); + assertEquals("No", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementretrieveattrvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementretrievetagname.hpp b/tests/DOM/conformance/level1/core/elementretrievetagname.hpp new file mode 100644 index 00000000..2eb10d26 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementretrievetagname.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementretrievetagname +#define test_elementretrievetagname + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName()" method returns a NodeList + * of all descendant elements with a given tagName. + * + * Invoke the "getElementsByTagName()" method and create + * a NodeList of "position" elements. Retrieve the second + * "position" element in the list and return the NodeName. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815 +*/ + +template +class elementretrievetagname : public DOMTestCase +{ + public: + elementretrievetagname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + String name; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("position")); + testEmployee = elementList.item(1); + name = testEmployee.getNodeName(); + assertEquals("position", name); + name = ((Element) /*Node */testEmployee).getTagName(); + assertEquals("position", name); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementretrievetagname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementsetattributenodenomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/elementsetattributenodenomodificationallowederr.hpp new file mode 100644 index 00000000..ec6f8016 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementsetattributenodenomodificationallowederr.hpp @@ -0,0 +1,127 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementsetattributenodenomodificationallowederr +#define test_elementsetattributenodenomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Try to remove the "domestic" attribute + * from the entity reference by executing the "setAttributeNode(newAttr)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ + +template +class elementsetattributenodenomodificationallowederr : public DOMTestCase +{ + public: + elementsetattributenodenomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + Node entRef; + Element entElement; + Attr newAttr; + int nodeType; + Attr badAttr; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = gender.getFirstChild(); + assertNotNull(entRef); + nodeType = (int) entRef.getNodeType(); + + if (equals(1, nodeType)) { + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + } + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + newAttr = doc.createAttribute(SA::construct_from_utf8("newAttr")); + + { + boolean success = false; + try { + badAttr = entElement.setAttributeNode(newAttr); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementsetattributenodenomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/elementsetattributenodenomodificationallowederrEE.hpp new file mode 100644 index 00000000..952fba41 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementsetattributenodenomodificationallowederrEE.hpp @@ -0,0 +1,122 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementsetattributenodenomodificationallowederrEE +#define test_elementsetattributenodenomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Create an entity reference and add to the THIRD "gender" element. The elements + * content is an entity reference. Try to remove the "domestic" attribute + * from the entity reference by executing the "setAttributeNode(newAttr)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenomodificationallowederr.xml +*/ + +template +class elementsetattributenodenomodificationallowederrEE : public DOMTestCase +{ + public: + elementsetattributenodenomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + EntityReference entRef; + Element entElement; + Attr newAttr; + Attr badAttr; + Node appendedChild; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + appendedChild = gender.appendChild(entRef); + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + newAttr = doc.createAttribute(SA::construct_from_utf8("newAttr")); + + { + boolean success = false; + try { + badAttr = entElement.setAttributeNode(newAttr); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementsetattributenodenull.hpp b/tests/DOM/conformance/level1/core/elementsetattributenodenull.hpp new file mode 100644 index 00000000..8e77d64a --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementsetattributenodenull.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementsetattributenodenull +#define test_elementsetattributenodenull + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method returns the + * null value if no previously existing Attr node with the + * same name was replaced. + * + * Retrieve the last child of the third employee and add a + * new attribute to it. The new attribute node added is + * "district", which is not part of this Element. The + * method should return the null value. + * This test uses the "createAttribute(name)" + * method from the Document interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ + +template +class elementsetattributenodenull : public DOMTestCase +{ + public: + elementsetattributenodenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr newAttribute; + Attr districtAttr; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("district")); + districtAttr = testEmployee.setAttributeNode(newAttribute); + assertNull(districtAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementsetattributenomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/elementsetattributenomodificationallowederr.hpp new file mode 100644 index 00000000..23e9dcf8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementsetattributenomodificationallowederr.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementsetattributenomodificationallowederr +#define test_elementsetattributenomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "setAttribute(name,value)" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Try to remove the "domestic" attribute + * from the entity reference by executing the "setAttribute(name,value)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +*/ + +template +class elementsetattributenomodificationallowederr : public DOMTestCase +{ + public: + elementsetattributenomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + EntityReference entRef; + Element entElement; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = (EntityReference) gender.getFirstChild(); + assertNotNull(entRef); + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + + { + boolean success = false; + try { + entElement.setAttribute(SA::construct_from_utf8("newAttr"), SA::construct_from_utf8("newValue")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementsetattributenomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/elementsetattributenomodificationallowederrEE.hpp new file mode 100644 index 00000000..fffb3c8a --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementsetattributenomodificationallowederrEE.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementsetattributenomodificationallowederrEE +#define test_elementsetattributenomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "setAttribute(name,value)" method for an attribute causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Add an ent4 reference to the children of the THIRD "gender" element. + * Try to remove the "domestic" attribute + * from the entity reference by executing the "setAttribute(name,value)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenomodificationallowederr.xml +*/ + +template +class elementsetattributenomodificationallowederrEE : public DOMTestCase +{ + public: + elementsetattributenomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + EntityReference entRef; + Element entElement; + Node appendedChild; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + appendedChild = gender.appendChild(entRef); + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + + { + boolean success = false; + try { + entElement.setAttribute(SA::construct_from_utf8("newAttr"), SA::construct_from_utf8("newValue")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/elementwrongdocumenterr.hpp b/tests/DOM/conformance/level1/core/elementwrongdocumenterr.hpp new file mode 100644 index 00000000..8501071e --- /dev/null +++ b/tests/DOM/conformance/level1/core/elementwrongdocumenterr.hpp @@ -0,0 +1,121 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_elementwrongdocumenterr +#define test_elementwrongdocumenterr + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method raises an + * "WRONG_DOCUMENT_ERR DOMException if the "newAttr" + * was created from a different document than the one that + * created this document. + * + * Retrieve the last employee and attempt to set a new + * attribute node for its "employee" element. The new + * attribute was created from a document other than the + * one that created this element, therefore a + * WRONG_DOCUMENT_ERR DOMException should be raised. + * This test uses the "createAttribute(newAttr)" method + * from the Document interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class elementwrongdocumenterr : public DOMTestCase +{ + public: + elementwrongdocumenterr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + Attr newAttribute; + NodeList addressElementList; + Element testAddress; + Attr attrAddress; + doc1 = (Document) load("staff", true); + doc2 = (Document) load("staff", false); + newAttribute = doc2.createAttribute(SA::construct_from_utf8("newAttribute")); + addressElementList = doc1.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = (Element) addressElementList.item(4); + + { + boolean success = false; + try { + attrAddress = testAddress.setAttributeNode(newAttribute); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementwrongdocumenterr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/entitygetentityname.hpp b/tests/DOM/conformance/level1/core/entitygetentityname.hpp new file mode 100644 index 00000000..93b23945 --- /dev/null +++ b/tests/DOM/conformance/level1/core/entitygetentityname.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_entitygetentityname +#define test_entitygetentityname + +#include "dom_conf_test.hpp" + +/** + * The nodeName attribute that is inherited from Node + * contains the name of the entity. + * + * Retrieve the entity named "ent1" and access its name by + * invoking the "getNodeName()" method inherited from + * the Node interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class entitygetentityname : public DOMTestCase +{ + public: + entitygetentityname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entityList; + Entity entityNode; + String entityName; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entityList = docType.getEntities(); + assertNotNull(entityList); + entityNode = (Entity) entityList.getNamedItem(SA::construct_from_utf8("ent1")); + entityName = entityNode.getNodeName(); + assertEquals("ent1", entityName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/entitygetentityname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/entitygetpublicid.hpp b/tests/DOM/conformance/level1/core/entitygetpublicid.hpp new file mode 100644 index 00000000..c32953d8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/entitygetpublicid.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_entitygetpublicid +#define test_entitygetpublicid + +#include "dom_conf_test.hpp" + +/** + * The "getPublicId()" method of an Entity node contains + * the public identifier associated with the entity, if + * one was specified. + * + * Retrieve the entity named "ent5" and access its + * public identifier. The string "entityURI" should be + * returned. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7303025 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6ABAEB38 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7C29F3E +*/ + +template +class entitygetpublicid : public DOMTestCase +{ + public: + entitygetpublicid(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entityList; + Entity entityNode; + String publicId; + String systemId; + String notation; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entityList = docType.getEntities(); + assertNotNull(entityList); + entityNode = (Entity) entityList.getNamedItem(SA::construct_from_utf8("ent5")); + skipIfNull(entityNode); + publicId = entityNode.getPublicId(); + assertEquals("entityURI", publicId); + systemId = entityNode.getSystemId(); + assertURIEquals("systemId", "", "", "", "entityFile", "", "", "", false, systemId); +notation = entityNode.getNotationName(); + assertEquals("notation1", notation); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/entitygetpublicid"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/entitygetpublicidnull.hpp b/tests/DOM/conformance/level1/core/entitygetpublicidnull.hpp new file mode 100644 index 00000000..aa288e71 --- /dev/null +++ b/tests/DOM/conformance/level1/core/entitygetpublicidnull.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_entitygetpublicidnull +#define test_entitygetpublicidnull + +#include "dom_conf_test.hpp" + +/** + * The "getPublicId()" method of an Entity node contains + * the public identifier associated with the entity, if + * one was not specified a null value should be returned. + * + * Retrieve the entity named "ent1" and access its + * public identifier. Since a public identifier was not + * specified for this entity, the "getPublicId()" method + * should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D7303025 +*/ + +template +class entitygetpublicidnull : public DOMTestCase +{ + public: + entitygetpublicidnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entityList; + Entity entityNode; + String publicId; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entityList = docType.getEntities(); + assertNotNull(entityList); + entityNode = (Entity) entityList.getNamedItem(SA::construct_from_utf8("ent1")); + publicId = entityNode.getPublicId(); + assertNull(publicId); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/entitygetpublicidnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrappendchild1.hpp b/tests/DOM/conformance/level1/core/hc_attrappendchild1.hpp new file mode 100644 index 00000000..92b3159a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrappendchild1.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrappendchild1 +#define test_hc_attrappendchild1 + +#include "dom_conf_test.hpp" + +/** + * Appends a text node to an attribute and checks if the value of + * the attribute is changed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class hc_attrappendchild1 : public DOMTestCase +{ + public: + hc_attrappendchild1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node lastChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("terday")); + retval = titleAttr.appendChild(textNode); + value = titleAttr.getValue(); + assertEquals("Yesterday", value); + value = titleAttr.getNodeValue(); + assertEquals("Yesterday", value); + value = retval.getNodeValue(); + assertEquals("terday", value); + lastChild = titleAttr.getLastChild(); + value = lastChild.getNodeValue(); + assertEquals("terday", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrappendchild2.hpp b/tests/DOM/conformance/level1/core/hc_attrappendchild2.hpp new file mode 100644 index 00000000..daf9c71d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrappendchild2.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrappendchild2 +#define test_hc_attrappendchild2 + +#include "dom_conf_test.hpp" + +/** + * Attempts to append an element to the child nodes of an attribute. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class hc_attrappendchild2 : public DOMTestCase +{ + public: + hc_attrappendchild2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Node newChild; + Node retval; + Node lastChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + newChild = doc.createElement(SA::construct_from_utf8("terday")); + + { + boolean success = false; + try { + retval = titleAttr.appendChild(newChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrappendchild3.hpp b/tests/DOM/conformance/level1/core/hc_attrappendchild3.hpp new file mode 100644 index 00000000..24b7eb9d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrappendchild3.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrappendchild3 +#define test_hc_attrappendchild3 + +#include "dom_conf_test.hpp" + +/** + * Appends a document fragment to an attribute and checks if the value of + * the attribute is changed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class hc_attrappendchild3 : public DOMTestCase +{ + public: + hc_attrappendchild3(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text terNode; + Text dayNode; + Node retval; + Node lastChild; + DocumentFragment docFrag; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + terNode = doc.createTextNode(SA::construct_from_utf8("ter")); + dayNode = doc.createTextNode(SA::construct_from_utf8("day")); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + retval = titleAttr.appendChild(docFrag); + value = titleAttr.getValue(); + assertEquals("Yesterday", value); + value = titleAttr.getNodeValue(); + assertEquals("Yesterday", value); + value = retval.getNodeValue(); + assertNull(value); + lastChild = titleAttr.getLastChild(); + value = lastChild.getNodeValue(); + assertEquals("day", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild3"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrappendchild4.hpp b/tests/DOM/conformance/level1/core/hc_attrappendchild4.hpp new file mode 100644 index 00000000..80af5dfa --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrappendchild4.hpp @@ -0,0 +1,126 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrappendchild4 +#define test_hc_attrappendchild4 + +#include "dom_conf_test.hpp" + +/** + * Attempt to append a CDATASection to an attribute which should result + * in a HIERARCHY_REQUEST_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class hc_attrappendchild4 : public DOMTestCase +{ + public: + hc_attrappendchild4(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Node textNode; + Node retval; + Node lastChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + textNode = doc.createCDATASection(SA::construct_from_utf8("terday")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + textNode = doc.createCDATASection(SA::construct_from_utf8("terday")); + + { + boolean success = false; + try { + retval = titleAttr.appendChild(textNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } +} + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild4"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrappendchild5.hpp b/tests/DOM/conformance/level1/core/hc_attrappendchild5.hpp new file mode 100644 index 00000000..f1b05bab --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrappendchild5.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrappendchild5 +#define test_hc_attrappendchild5 + +#include "dom_conf_test.hpp" + +/** + * Attempt to append a node from another document to an attribute which should result + * in a WRONG_DOCUMENT_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class hc_attrappendchild5 : public DOMTestCase +{ + public: + hc_attrappendchild5(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Node textNode; + Node retval; + Node lastChild; + Document otherDoc; + doc = (Document) load("hc_staff", true); + otherDoc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = otherDoc.createTextNode(SA::construct_from_utf8("terday")); + + { + boolean success = false; + try { + retval = titleAttr.appendChild(textNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild5"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrappendchild6.hpp b/tests/DOM/conformance/level1/core/hc_attrappendchild6.hpp new file mode 100644 index 00000000..c23f4a5f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrappendchild6.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrappendchild6 +#define test_hc_attrappendchild6 + +#include "dom_conf_test.hpp" + +/** + * Creates an new attribute node and appends a text node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class hc_attrappendchild6 : public DOMTestCase +{ + public: + hc_attrappendchild6(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node lastChild; + doc = (Document) load("hc_staff", true); + titleAttr = doc.createAttribute(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("Yesterday")); + retval = titleAttr.appendChild(textNode); + value = titleAttr.getValue(); + assertEquals("Yesterday", value); + value = titleAttr.getNodeValue(); + assertEquals("Yesterday", value); + value = retval.getNodeValue(); + assertEquals("Yesterday", value); + lastChild = titleAttr.getLastChild(); + value = lastChild.getNodeValue(); + assertEquals("Yesterday", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild6"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrchildnodes1.hpp b/tests/DOM/conformance/level1/core/hc_attrchildnodes1.hpp new file mode 100644 index 00000000..29d60510 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrchildnodes1.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrchildnodes1 +#define test_hc_attrchildnodes1 + +#include "dom_conf_test.hpp" + +/** + * Checks that Node.childNodes for an attribute node contains + * the expected text node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +*/ + +template +class hc_attrchildnodes1 : public DOMTestCase +{ + public: + hc_attrchildnodes1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + NodeList childNodes; + doc = (Document) load("hc_staff", false); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + childNodes = titleAttr.getChildNodes(); + assertSize(1, childNodes); + textNode = (Text) childNodes.item(0); + value = textNode.getNodeValue(); + assertEquals("Yes", value); + textNode = (Text) childNodes.item(1); + assertNull(textNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrchildnodes1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrchildnodes2.hpp b/tests/DOM/conformance/level1/core/hc_attrchildnodes2.hpp new file mode 100644 index 00000000..116e2444 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrchildnodes2.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrchildnodes2 +#define test_hc_attrchildnodes2 + +#include "dom_conf_test.hpp" + +/** + * Checks Node.childNodes for an attribute with multiple child nodes. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +*/ + +template +class hc_attrchildnodes2 : public DOMTestCase +{ + public: + hc_attrchildnodes2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + NodeList childNodes; + Node retval; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + childNodes = titleAttr.getChildNodes(); + textNode = doc.createTextNode(SA::construct_from_utf8("terday")); + retval = titleAttr.appendChild(textNode); + assertSize(2, childNodes); + textNode = (Text) childNodes.item(0); + value = textNode.getNodeValue(); + assertEquals("Yes", value); + textNode = (Text) childNodes.item(1); + value = textNode.getNodeValue(); + assertEquals("terday", value); + textNode = (Text) childNodes.item(2); + assertNull(textNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrchildnodes2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrclonenode1.hpp b/tests/DOM/conformance/level1/core/hc_attrclonenode1.hpp new file mode 100644 index 00000000..822e7201 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrclonenode1.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrclonenode1 +#define test_hc_attrclonenode1 + +#include "dom_conf_test.hpp" + +/** + * Appends a text node to an attribute and clones the node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class hc_attrclonenode1 : public DOMTestCase +{ + public: + hc_attrclonenode1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node lastChild; + Attr clonedTitle; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("terday")); + retval = titleAttr.appendChild(textNode); + clonedTitle = (Attr) titleAttr.cloneNode(false); + textNode.setNodeValue(SA::construct_from_utf8("text_node_not_cloned")); + value = clonedTitle.getValue(); + assertEquals("Yesterday", value); + value = clonedTitle.getNodeValue(); + assertEquals("Yesterday", value); + lastChild = clonedTitle.getLastChild(); + value = lastChild.getNodeValue(); + assertEquals("terday", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrclonenode1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrcreatedocumentfragment.hpp b/tests/DOM/conformance/level1/core/hc_attrcreatedocumentfragment.hpp new file mode 100644 index 00000000..cabbbf01 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrcreatedocumentfragment.hpp @@ -0,0 +1,116 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrcreatedocumentfragment +#define test_hc_attrcreatedocumentfragment + +#include "dom_conf_test.hpp" + +/** + * Create a new DocumentFragment and add a newly created Element node(with one attribute). + * Once the element is added, its attribute should be available as an attribute associated + * with an Element within a DocumentFragment. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ + +template +class hc_attrcreatedocumentfragment : public DOMTestCase +{ + public: + hc_attrcreatedocumentfragment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment docFragment; + Element newOne; + Node domesticNode; + NamedNodeMap attributes; + Attr attribute; + String attrName; + Node appendedChild; + int langAttrCount = 0; + doc = (Document) load("hc_staff", true); + docFragment = doc.createDocumentFragment(); + newOne = doc.createElement(SA::construct_from_utf8("html")); + newOne.setAttribute(SA::construct_from_utf8("lang"), SA::construct_from_utf8("EN")); + appendedChild = docFragment.appendChild(newOne); + domesticNode = docFragment.getFirstChild(); + attributes = domesticNode.getAttributes(); + for (int indexN65656 = 0; indexN65656 != attributes.getLength(); indexN65656++) { + attribute = (Attr) attributes.item(indexN65656); + attrName = attribute.getNodeName(); + + if (equals("lang", attrName)) { + langAttrCount += 1; + } + } + assertEquals(1, langAttrCount); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatedocumentfragment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrcreatetextnode.hpp b/tests/DOM/conformance/level1/core/hc_attrcreatetextnode.hpp new file mode 100644 index 00000000..a181b7f1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrcreatetextnode.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrcreatetextnode +#define test_hc_attrcreatetextnode + +#include "dom_conf_test.hpp" + +/** + * The "setValue()" method for an attribute creates a + * Text node with the unparsed content of the string. + * Retrieve the attribute named "class" from the last + * child of of the fourth employee and assign the "Y&ent1;" + * string to its value attribute. This value is not yet + * parsed and therefore should still be the same upon + * retrieval. This test uses the "getNamedItem(name)" method + * from the NamedNodeMap interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html +*/ + +template +class hc_attrcreatetextnode : public DOMTestCase +{ + public: + hc_attrcreatetextnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String value; + doc = (Document) load("hc_staff", true); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(3); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); + streetAttr.setValue(SA::construct_from_utf8("Y&ent1;")); + value = streetAttr.getValue(); + assertEquals("Y&ent1;", value); + value = streetAttr.getNodeValue(); + assertEquals("Y&ent1;", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatetextnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrcreatetextnode2.hpp b/tests/DOM/conformance/level1/core/hc_attrcreatetextnode2.hpp new file mode 100644 index 00000000..08a65b59 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrcreatetextnode2.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrcreatetextnode2 +#define test_hc_attrcreatetextnode2 + +#include "dom_conf_test.hpp" + +/** + * The "setNodeValue()" method for an attribute creates a + * Text node with the unparsed content of the string. + * Retrieve the attribute named "class" from the last + * child of of the fourth employee and assign the "Y&ent1;" + * string to its value attribute. This value is not yet + * parsed and therefore should still be the same upon + * retrieval. This test uses the "getNamedItem(name)" method + * from the NamedNodeMap interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html +*/ + +template +class hc_attrcreatetextnode2 : public DOMTestCase +{ + public: + hc_attrcreatetextnode2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String value; + doc = (Document) load("hc_staff", true); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(3); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); + streetAttr.setNodeValue(SA::construct_from_utf8("Y&ent1;")); + value = streetAttr.getValue(); + assertEquals("Y&ent1;", value); + value = streetAttr.getNodeValue(); + assertEquals("Y&ent1;", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatetextnode2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attreffectivevalue.hpp b/tests/DOM/conformance/level1/core/hc_attreffectivevalue.hpp new file mode 100644 index 00000000..57e3eb0b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attreffectivevalue.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attreffectivevalue +#define test_hc_attreffectivevalue + +#include "dom_conf_test.hpp" + +/** + * If an Attr is explicitly assigned any value, then that value is the attributes effective value. + * Retrieve the attribute named "domestic" from the last child of of the first employee + * and examine its nodeValue attribute. This test uses the "getNamedItem(name)" method + * from the NamedNodeMap interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +*/ + +template +class hc_attreffectivevalue : public DOMTestCase +{ + public: + hc_attreffectivevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + String value; + doc = (Document) load("hc_staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + value = domesticAttr.getNodeValue(); + assertEquals("Yes", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attreffectivevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrfirstchild.hpp b/tests/DOM/conformance/level1/core/hc_attrfirstchild.hpp new file mode 100644 index 00000000..f516e1b6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrfirstchild.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrfirstchild +#define test_hc_attrfirstchild + +#include "dom_conf_test.hpp" + +/** + * Checks that Node.firstChild for an attribute node contains + * the expected text node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388 +*/ + +template +class hc_attrfirstchild : public DOMTestCase +{ + public: + hc_attrfirstchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node otherChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = (Text) titleAttr.getFirstChild(); + assertNotNull(textNode); + value = textNode.getNodeValue(); + assertEquals("Yes", value); + otherChild = textNode.getNextSibling(); + assertNull(otherChild); + otherChild = textNode.getPreviousSibling(); + assertNull(otherChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrfirstchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrgetvalue1.hpp b/tests/DOM/conformance/level1/core/hc_attrgetvalue1.hpp new file mode 100644 index 00000000..d738ebdf --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrgetvalue1.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrgetvalue1 +#define test_hc_attrgetvalue1 + +#include "dom_conf_test.hpp" + +/** + * Checks the value of an attribute that contains entity references. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ + +template +class hc_attrgetvalue1 : public DOMTestCase +{ + public: + hc_attrgetvalue1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node lastChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); + value = titleAttr.getValue(); + assertEquals("Yα", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrgetvalue2.hpp b/tests/DOM/conformance/level1/core/hc_attrgetvalue2.hpp new file mode 100644 index 00000000..9412026c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrgetvalue2.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrgetvalue2 +#define test_hc_attrgetvalue2 + +#include "dom_conf_test.hpp" + +/** + * Checks the value of an attribute that contains entity references. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ + +template +class hc_attrgetvalue2 : public DOMTestCase +{ + public: + hc_attrgetvalue2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node firstChild; + EntityReference alphaRef; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + alphaRef = doc.createEntityReference(SA::construct_from_utf8("alpha")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + alphaRef = doc.createEntityReference(SA::construct_from_utf8("alpha")); + firstChild = titleAttr.getFirstChild(); + retval = titleAttr.insertBefore(alphaRef, firstChild); + value = titleAttr.getValue(); + assertEquals("αYα", value); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrhaschildnodes.hpp b/tests/DOM/conformance/level1/core/hc_attrhaschildnodes.hpp new file mode 100644 index 00000000..dabe3689 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrhaschildnodes.hpp @@ -0,0 +1,98 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrhaschildnodes +#define test_hc_attrhaschildnodes + +#include "dom_conf_test.hpp" + +/** + * Checks that Node.hasChildNodes() is true for an attribute with content. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187 +*/ + +template +class hc_attrhaschildnodes : public DOMTestCase +{ + public: + hc_attrhaschildnodes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + boolean hasChildNodes; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + hasChildNodes = titleAttr.hasChildNodes(); + assertTrue(hasChildNodes); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrhaschildnodes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrinsertbefore1.hpp b/tests/DOM/conformance/level1/core/hc_attrinsertbefore1.hpp new file mode 100644 index 00000000..1b392a09 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrinsertbefore1.hpp @@ -0,0 +1,116 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrinsertbefore1 +#define test_hc_attrinsertbefore1 + +#include "dom_conf_test.hpp" + +/** + * Appends a text node to an attribute and checks if the value of + * the attribute is changed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class hc_attrinsertbefore1 : public DOMTestCase +{ + public: + hc_attrinsertbefore1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node firstChild; + Node lastChild; + Node refChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("terday")); + retval = titleAttr.insertBefore(textNode, refChild); + value = titleAttr.getValue(); + assertEquals("Yesterday", value); + value = titleAttr.getNodeValue(); + assertEquals("Yesterday", value); + value = retval.getNodeValue(); + assertEquals("terday", value); + firstChild = titleAttr.getFirstChild(); + value = firstChild.getNodeValue(); + assertEquals("Yes", value); + lastChild = titleAttr.getLastChild(); + value = lastChild.getNodeValue(); + assertEquals("terday", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrinsertbefore2.hpp b/tests/DOM/conformance/level1/core/hc_attrinsertbefore2.hpp new file mode 100644 index 00000000..9b3027eb --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrinsertbefore2.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrinsertbefore2 +#define test_hc_attrinsertbefore2 + +#include "dom_conf_test.hpp" + +/** + * Prepends a text node to an attribute and checks if the value of + * the attribute is changed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class hc_attrinsertbefore2 : public DOMTestCase +{ + public: + hc_attrinsertbefore2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node lastChild; + Node firstChild; + Node refChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("terday")); + refChild = titleAttr.getFirstChild(); + retval = titleAttr.insertBefore(textNode, refChild); + value = titleAttr.getValue(); + assertEquals("terdayYes", value); + value = titleAttr.getNodeValue(); + assertEquals("terdayYes", value); + value = retval.getNodeValue(); + assertEquals("terday", value); + firstChild = titleAttr.getFirstChild(); + value = firstChild.getNodeValue(); + assertEquals("terday", value); + lastChild = titleAttr.getLastChild(); + value = lastChild.getNodeValue(); + assertEquals("Yes", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrinsertbefore3.hpp b/tests/DOM/conformance/level1/core/hc_attrinsertbefore3.hpp new file mode 100644 index 00000000..1507e1f8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrinsertbefore3.hpp @@ -0,0 +1,122 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrinsertbefore3 +#define test_hc_attrinsertbefore3 + +#include "dom_conf_test.hpp" + +/** + * Appends a document fragment to an attribute and checks if the value of + * the attribute is changed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class hc_attrinsertbefore3 : public DOMTestCase +{ + public: + hc_attrinsertbefore3(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text terNode; + Text dayNode; + DocumentFragment docFrag; + Node retval; + Node firstChild; + Node lastChild; + Node refChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + terNode = doc.createTextNode(SA::construct_from_utf8("ter")); + dayNode = doc.createTextNode(SA::construct_from_utf8("day")); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + retval = titleAttr.insertBefore(docFrag, refChild); + value = titleAttr.getValue(); + assertEquals("Yesterday", value); + value = titleAttr.getNodeValue(); + assertEquals("Yesterday", value); + value = retval.getNodeValue(); + assertNull(value); + firstChild = titleAttr.getFirstChild(); + value = firstChild.getNodeValue(); + assertEquals("Yes", value); + lastChild = titleAttr.getLastChild(); + value = lastChild.getNodeValue(); + assertEquals("day", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore3"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrinsertbefore4.hpp b/tests/DOM/conformance/level1/core/hc_attrinsertbefore4.hpp new file mode 100644 index 00000000..fb97443f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrinsertbefore4.hpp @@ -0,0 +1,123 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrinsertbefore4 +#define test_hc_attrinsertbefore4 + +#include "dom_conf_test.hpp" + +/** + * Prepends a document fragment to an attribute and checks if the value of + * the attribute is changed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class hc_attrinsertbefore4 : public DOMTestCase +{ + public: + hc_attrinsertbefore4(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text terNode; + Text dayNode; + DocumentFragment docFrag; + Node retval; + Node firstChild; + Node lastChild; + Node refChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + terNode = doc.createTextNode(SA::construct_from_utf8("ter")); + dayNode = doc.createTextNode(SA::construct_from_utf8("day")); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + refChild = titleAttr.getFirstChild(); + retval = titleAttr.insertBefore(docFrag, refChild); + value = titleAttr.getValue(); + assertEquals("terdayYes", value); + value = titleAttr.getNodeValue(); + assertEquals("terdayYes", value); + value = retval.getNodeValue(); + assertNull(value); + firstChild = titleAttr.getFirstChild(); + value = firstChild.getNodeValue(); + assertEquals("ter", value); + lastChild = titleAttr.getLastChild(); + value = lastChild.getNodeValue(); + assertEquals("Yes", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore4"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrinsertbefore5.hpp b/tests/DOM/conformance/level1/core/hc_attrinsertbefore5.hpp new file mode 100644 index 00000000..0c87efa9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrinsertbefore5.hpp @@ -0,0 +1,126 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrinsertbefore5 +#define test_hc_attrinsertbefore5 + +#include "dom_conf_test.hpp" + +/** + * Attempt to append a CDATASection to an attribute which should result + * in a HIERARCHY_REQUEST_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class hc_attrinsertbefore5 : public DOMTestCase +{ + public: + hc_attrinsertbefore5(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Node textNode; + Node retval; + Node refChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + textNode = doc.createCDATASection(SA::construct_from_utf8("terday")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + textNode = doc.createCDATASection(SA::construct_from_utf8("terday")); + + { + boolean success = false; + try { + retval = titleAttr.insertBefore(textNode, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } +} + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore5"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrinsertbefore6.hpp b/tests/DOM/conformance/level1/core/hc_attrinsertbefore6.hpp new file mode 100644 index 00000000..df2c026e --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrinsertbefore6.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrinsertbefore6 +#define test_hc_attrinsertbefore6 + +#include "dom_conf_test.hpp" + +/** + * Attempt to append a text node from another document to an attribute which should result + * in a WRONG_DOCUMENT_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class hc_attrinsertbefore6 : public DOMTestCase +{ + public: + hc_attrinsertbefore6(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Node textNode; + Node retval; + Node refChild; + Document otherDoc; + doc = (Document) load("hc_staff", true); + otherDoc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = otherDoc.createTextNode(SA::construct_from_utf8("terday")); + + { + boolean success = false; + try { + retval = titleAttr.insertBefore(textNode, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore6"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrinsertbefore7.hpp b/tests/DOM/conformance/level1/core/hc_attrinsertbefore7.hpp new file mode 100644 index 00000000..5bb6bc2f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrinsertbefore7.hpp @@ -0,0 +1,133 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrinsertbefore7 +#define test_hc_attrinsertbefore7 + +#include "dom_conf_test.hpp" + +/** + * Appends a document fragment containing a CDATASection to an attribute. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class hc_attrinsertbefore7 : public DOMTestCase +{ + public: + hc_attrinsertbefore7(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text terNode; + Node dayNode; + DocumentFragment docFrag; + Node retval; + Node firstChild; + Node lastChild; + Node refChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + terNode = doc.createTextNode(SA::construct_from_utf8("ter")); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + dayNode = doc.createCDATASection(SA::construct_from_utf8("day")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + dayNode = doc.createCDATASection(SA::construct_from_utf8("day")); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + + { + boolean success = false; + try { + retval = titleAttr.insertBefore(docFrag, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } +} + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore7"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrlastchild.hpp b/tests/DOM/conformance/level1/core/hc_attrlastchild.hpp new file mode 100644 index 00000000..80cc291b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrlastchild.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrlastchild +#define test_hc_attrlastchild + +#include "dom_conf_test.hpp" + +/** + * Checks that Node.lastChild for an attribute node contains + * the expected text node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB +*/ + +template +class hc_attrlastchild : public DOMTestCase +{ + public: + hc_attrlastchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node otherChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = (Text) titleAttr.getFirstChild(); + assertNotNull(textNode); + value = textNode.getNodeValue(); + assertEquals("Yes", value); + otherChild = textNode.getNextSibling(); + assertNull(otherChild); + otherChild = textNode.getPreviousSibling(); + assertNull(otherChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrlastchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrname.hpp b/tests/DOM/conformance/level1/core/hc_attrname.hpp new file mode 100644 index 00000000..1dfbb531 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrname.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrname +#define test_hc_attrname + +#include "dom_conf_test.hpp" + +/** + * Retrieve the attribute named class from the last + * child of of the second "p" element and examine its + * NodeName. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +*/ + +template +class hc_attrname : public DOMTestCase +{ + public: + hc_attrname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + String strong1; + String strong2; + doc = (Document) load("hc_staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(1); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); + strong1 = streetAttr.getNodeName(); + strong2 = streetAttr.getName(); + assertEquals("class", strong1); + assertEquals("class", strong2); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrnextsiblingnull.hpp b/tests/DOM/conformance/level1/core/hc_attrnextsiblingnull.hpp new file mode 100644 index 00000000..62ce1457 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrnextsiblingnull.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrnextsiblingnull +#define test_hc_attrnextsiblingnull + +#include "dom_conf_test.hpp" + +/** + * The "getNextSibling()" method for an Attr node should return null. + * Retrieve the attribute named "domestic" from the last child of of the + * first employee and examine its NextSibling node. This test uses the + * "getNamedItem(name)" method from the NamedNodeMap interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ + +template +class hc_attrnextsiblingnull : public DOMTestCase +{ + public: + hc_attrnextsiblingnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + Node s; + doc = (Document) load("hc_staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + s = domesticAttr.getNextSibling(); + assertNull(s); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrnextsiblingnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrnormalize.hpp b/tests/DOM/conformance/level1/core/hc_attrnormalize.hpp new file mode 100644 index 00000000..266d26ab --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrnormalize.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrnormalize +#define test_hc_attrnormalize + +#include "dom_conf_test.hpp" + +/** + * Appends a text node to an attribute, normalizes the attribute + * and checks for a single child node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083 +*/ + +template +class hc_attrnormalize : public DOMTestCase +{ + public: + hc_attrnormalize(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node firstChild; + Node secondChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("terday")); + retval = titleAttr.appendChild(textNode); + textNode = doc.createTextNode(SA::construct_from_utf8("")); + retval = titleAttr.appendChild(textNode); + ((Element) /*Node */testNode).normalize(); + value = titleAttr.getNodeValue(); + assertEquals("Yesterday", value); + firstChild = titleAttr.getFirstChild(); + value = firstChild.getNodeValue(); + assertEquals("Yesterday", value); + secondChild = firstChild.getNextSibling(); + assertNull(secondChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrnormalize"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrparentnodenull.hpp b/tests/DOM/conformance/level1/core/hc_attrparentnodenull.hpp new file mode 100644 index 00000000..6fa87b4a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrparentnodenull.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrparentnodenull +#define test_hc_attrparentnodenull + +#include "dom_conf_test.hpp" + +/** + * The "getParentNode()" method for an Attr node should return null. Retrieve + * the attribute named "domestic" from the last child of the first employee + * and examine its parentNode attribute. This test also uses the "getNamedItem(name)" + * method from the NamedNodeMap interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ + +template +class hc_attrparentnodenull : public DOMTestCase +{ + public: + hc_attrparentnodenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + Node s; + doc = (Document) load("hc_staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + s = domesticAttr.getParentNode(); + assertNull(s); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrparentnodenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrprevioussiblingnull.hpp b/tests/DOM/conformance/level1/core/hc_attrprevioussiblingnull.hpp new file mode 100644 index 00000000..e09a2bbc --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrprevioussiblingnull.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrprevioussiblingnull +#define test_hc_attrprevioussiblingnull + +#include "dom_conf_test.hpp" + +/** + * The "getPreviousSibling()" method for an Attr node should return null. + * Retrieve the attribute named "domestic" from the last child of of the + * first employee and examine its PreviousSibling node. This test uses the + * "getNamedItem(name)" method from the NamedNodeMap interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ + +template +class hc_attrprevioussiblingnull : public DOMTestCase +{ + public: + hc_attrprevioussiblingnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + Node s; + doc = (Document) load("hc_staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + s = domesticAttr.getPreviousSibling(); + assertNull(s); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrprevioussiblingnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrremovechild1.hpp b/tests/DOM/conformance/level1/core/hc_attrremovechild1.hpp new file mode 100644 index 00000000..732349b7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrremovechild1.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrremovechild1 +#define test_hc_attrremovechild1 + +#include "dom_conf_test.hpp" + +/** + * Removes the child node of an attribute and checks that the value is empty. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +*/ + +template +class hc_attrremovechild1 : public DOMTestCase +{ + public: + hc_attrremovechild1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node firstChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = (Text) titleAttr.getFirstChild(); + assertNotNull(textNode); + retval = titleAttr.removeChild(textNode); + value = titleAttr.getValue(); + assertEquals("", value); + value = titleAttr.getNodeValue(); + assertEquals("", value); + value = retval.getNodeValue(); + assertEquals("Yes", value); + firstChild = titleAttr.getFirstChild(); + assertNull(firstChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrremovechild1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrremovechild2.hpp b/tests/DOM/conformance/level1/core/hc_attrremovechild2.hpp new file mode 100644 index 00000000..5f3c9069 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrremovechild2.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrremovechild2 +#define test_hc_attrremovechild2 + +#include "dom_conf_test.hpp" + +/** + * Attempts to remove a freshly created text node which should result in a NOT_FOUND_ERR exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +*/ + +template +class hc_attrremovechild2 : public DOMTestCase +{ + public: + hc_attrremovechild2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("Yesterday")); + + { + boolean success = false; + try { + retval = titleAttr.removeChild(textNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrremovechild2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrreplacechild1.hpp b/tests/DOM/conformance/level1/core/hc_attrreplacechild1.hpp new file mode 100644 index 00000000..0c493820 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrreplacechild1.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrreplacechild1 +#define test_hc_attrreplacechild1 + +#include "dom_conf_test.hpp" + +/** + * Replaces a text node of an attribute and checks if the value of + * the attribute is changed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ + +template +class hc_attrreplacechild1 : public DOMTestCase +{ + public: + hc_attrreplacechild1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node firstChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("terday")); + firstChild = titleAttr.getFirstChild(); + assertNotNull(firstChild); + retval = titleAttr.replaceChild(textNode, firstChild); + value = titleAttr.getValue(); + assertEquals("terday", value); + value = titleAttr.getNodeValue(); + assertEquals("terday", value); + value = retval.getNodeValue(); + assertEquals("Yes", value); + firstChild = titleAttr.getFirstChild(); + value = firstChild.getNodeValue(); + assertEquals("terday", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrreplacechild1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrreplacechild2.hpp b/tests/DOM/conformance/level1/core/hc_attrreplacechild2.hpp new file mode 100644 index 00000000..70844977 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrreplacechild2.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrreplacechild2 +#define test_hc_attrreplacechild2 + +#include "dom_conf_test.hpp" + +/** + * Replaces a text node of an attribute with a document fragment and checks if the value of + * the attribute is changed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ + +template +class hc_attrreplacechild2 : public DOMTestCase +{ + public: + hc_attrreplacechild2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text terNode; + Text dayNode; + DocumentFragment docFrag; + Node retval; + Node firstChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + terNode = doc.createTextNode(SA::construct_from_utf8("ter")); + dayNode = doc.createTextNode(SA::construct_from_utf8("day")); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + firstChild = titleAttr.getFirstChild(); + assertNotNull(firstChild); + retval = titleAttr.replaceChild(docFrag, firstChild); + value = titleAttr.getValue(); + assertEquals("terday", value); + value = titleAttr.getNodeValue(); + assertEquals("terday", value); + value = retval.getNodeValue(); + assertEquals("Yes", value); + firstChild = titleAttr.getFirstChild(); + value = firstChild.getNodeValue(); + assertEquals("ter", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrreplacechild2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrsetvalue1.hpp b/tests/DOM/conformance/level1/core/hc_attrsetvalue1.hpp new file mode 100644 index 00000000..531d9027 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrsetvalue1.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrsetvalue1 +#define test_hc_attrsetvalue1 + +#include "dom_conf_test.hpp" + +/** + * Sets Attr.value on an attribute that only has a simple value. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ + +template +class hc_attrsetvalue1 : public DOMTestCase +{ + public: + hc_attrsetvalue1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Node retval; + Node firstChild; + Node otherChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + firstChild = titleAttr.getFirstChild(); + assertNotNull(firstChild); + titleAttr.setValue(SA::construct_from_utf8("Tomorrow")); + firstChild.setNodeValue(SA::construct_from_utf8("impl reused node")); + value = titleAttr.getValue(); + assertEquals("Tomorrow", value); + value = titleAttr.getNodeValue(); + assertEquals("Tomorrow", value); + firstChild = titleAttr.getLastChild(); + value = firstChild.getNodeValue(); + assertEquals("Tomorrow", value); + otherChild = firstChild.getNextSibling(); + assertNull(otherChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrsetvalue1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrsetvalue2.hpp b/tests/DOM/conformance/level1/core/hc_attrsetvalue2.hpp new file mode 100644 index 00000000..f6e76ddf --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrsetvalue2.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrsetvalue2 +#define test_hc_attrsetvalue2 + +#include "dom_conf_test.hpp" + +/** + * Sets Attr.value on an attribute that should contain multiple child nodes. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ + +template +class hc_attrsetvalue2 : public DOMTestCase +{ + public: + hc_attrsetvalue2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList acronymList; + Node testNode; + NamedNodeMap attributes; + Attr titleAttr; + String value; + Text textNode; + Node retval; + Node firstChild; + Node otherChild; + doc = (Document) load("hc_staff", true); + acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = acronymList.item(3); + attributes = testNode.getAttributes(); + titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + textNode = doc.createTextNode(SA::construct_from_utf8("terday")); + retval = titleAttr.appendChild(textNode); + firstChild = titleAttr.getFirstChild(); + assertNotNull(firstChild); + titleAttr.setValue(SA::construct_from_utf8("Tomorrow")); + firstChild.setNodeValue(SA::construct_from_utf8("impl reused node")); + value = titleAttr.getValue(); + assertEquals("Tomorrow", value); + value = titleAttr.getNodeValue(); + assertEquals("Tomorrow", value); + firstChild = titleAttr.getLastChild(); + value = firstChild.getNodeValue(); + assertEquals("Tomorrow", value); + otherChild = firstChild.getNextSibling(); + assertNull(otherChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrsetvalue2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrspecifiedvalue.hpp b/tests/DOM/conformance/level1/core/hc_attrspecifiedvalue.hpp new file mode 100644 index 00000000..242e4d4f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrspecifiedvalue.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrspecifiedvalue +#define test_hc_attrspecifiedvalue + +#include "dom_conf_test.hpp" + +/** + * The "getSpecified()" method for an Attr node should + * be set to true if the attribute was explicitly given + * a value. + * Retrieve the attribute named "domestic" from the last + * child of of the first employee and examine the value + * returned by the "getSpecified()" method. This test uses + * the "getNamedItem(name)" method from the NamedNodeMap + * interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 +*/ + +template +class hc_attrspecifiedvalue : public DOMTestCase +{ + public: + hc_attrspecifiedvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + boolean state; + doc = (Document) load("hc_staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(0); + attributes = testNode.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + state = domesticAttr.getSpecified(); + assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrspecifiedvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_attrspecifiedvaluechanged.hpp b/tests/DOM/conformance/level1/core/hc_attrspecifiedvaluechanged.hpp new file mode 100644 index 00000000..d106c894 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_attrspecifiedvaluechanged.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_attrspecifiedvaluechanged +#define test_hc_attrspecifiedvaluechanged + +#include "dom_conf_test.hpp" + +/** + * The "getSpecified()" method for an Attr node should return true if the + * value of the attribute is changed. + * Retrieve the attribute named "class" from the last + * child of of the THIRD employee and change its + * value to "Yes"(which is the default DTD value). This + * should cause the "getSpecified()" method to be true. + * This test uses the "setAttribute(name,value)" method + * from the Element interface and the "getNamedItem(name)" + * method from the NamedNodeMap interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 +*/ + +template +class hc_attrspecifiedvaluechanged : public DOMTestCase +{ + public: + hc_attrspecifiedvaluechanged(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testNode; + NamedNodeMap attributes; + Attr streetAttr; + boolean state; + doc = (Document) load("hc_staff", true); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = addressList.item(2); + ((Element) /*Node */testNode).setAttribute(SA::construct_from_utf8("class"), SA::construct_from_utf8("Yα")); + attributes = testNode.getAttributes(); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); + state = streetAttr.getSpecified(); + assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrspecifiedvaluechanged"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataappenddata.hpp b/tests/DOM/conformance/level1/core/hc_characterdataappenddata.hpp new file mode 100644 index 00000000..c2555266 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataappenddata.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataappenddata +#define test_hc_characterdataappenddata + +#include "dom_conf_test.hpp" + +/** + * The "appendData(arg)" method appends a string to the end + * of the character data of the node. + * + * Retrieve the character data from the second child + * of the first employee. The appendData(arg) method is + * called with arg=", Esquire". The method should append + * the specified data to the already existing character + * data. The new value return by the "getLength()" method + * should be 24. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +*/ + +template +class hc_characterdataappenddata : public DOMTestCase +{ + public: + hc_characterdataappenddata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childValue; + int childLength; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.appendData(SA::construct_from_utf8(", Esquire")); + childValue = child.getData(); + childLength = SA::length(childValue); + assertEquals(24, childLength); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataappenddatagetdata.hpp b/tests/DOM/conformance/level1/core/hc_characterdataappenddatagetdata.hpp new file mode 100644 index 00000000..fe521767 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataappenddatagetdata.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataappenddatagetdata +#define test_hc_characterdataappenddatagetdata + +#include "dom_conf_test.hpp" + +/** + * On successful invocation of the "appendData(arg)" + * method the "getData()" method provides access to the + * concatentation of data and the specified string. + * + * Retrieve the character data from the second child + * of the first employee. The appendData(arg) method is + * called with arg=", Esquire". The method should append + * the specified data to the already existing character + * data. The new value return by the "getData()" method + * should be "Margaret Martin, Esquire". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +*/ + +template +class hc_characterdataappenddatagetdata : public DOMTestCase +{ + public: + hc_characterdataappenddatagetdata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.appendData(SA::construct_from_utf8(", Esquire")); + childData = child.getData(); + assertEquals("Margaret Martin, Esquire", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddatagetdata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatadeletedatabegining.hpp b/tests/DOM/conformance/level1/core/hc_characterdatadeletedatabegining.hpp new file mode 100644 index 00000000..d0fd0ddb --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatadeletedatabegining.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatadeletedatabegining +#define test_hc_characterdatadeletedatabegining + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method removes a range of + * characters from the node. Delete data at the beginning + * of the character data. + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=0 and count=16. + * The method should delete the characters from position + * 0 thru position 16. The new value of the character data + * should be "Dallas, Texas 98551". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class hc_characterdatadeletedatabegining : public DOMTestCase +{ + public: + hc_characterdatadeletedatabegining(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(0, 16); + childData = child.getData(); + assertEquals("Dallas, Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatabegining"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatadeletedataend.hpp b/tests/DOM/conformance/level1/core/hc_characterdatadeletedataend.hpp new file mode 100644 index 00000000..be184e53 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatadeletedataend.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatadeletedataend +#define test_hc_characterdatadeletedataend + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method removes a range of + * characters from the node. Delete data at the end + * of the character data. + * + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=30 and count=5. + * The method should delete the characters from position + * 30 thru position 35. The new value of the character data + * should be "1230 North Ave. Dallas, Texas". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class hc_characterdatadeletedataend : public DOMTestCase +{ + public: + hc_characterdatadeletedataend(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(30, 5); + childData = child.getData(); + assertEquals("1230 North Ave. Dallas, Texas ", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedataend"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatadeletedataexceedslength.hpp b/tests/DOM/conformance/level1/core/hc_characterdatadeletedataexceedslength.hpp new file mode 100644 index 00000000..b5099048 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatadeletedataexceedslength.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatadeletedataexceedslength +#define test_hc_characterdatadeletedataexceedslength + +#include "dom_conf_test.hpp" + +/** + * If the sum of the offset and count used in the + * "deleteData(offset,count) method is greater than the + * length of the character data then all the characters + * from the offset to the end of the data are deleted. + * + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=4 and count=50. + * The method should delete the characters from position 4 + * to the end of the data since the offset+count(50+4) + * is greater than the length of the character data(35). + * The new value of the character data should be "1230". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class hc_characterdatadeletedataexceedslength : public DOMTestCase +{ + public: + hc_characterdatadeletedataexceedslength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(4, 50); + childData = child.getData(); + assertEquals("1230", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedataexceedslength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatadeletedatagetlengthanddata.hpp b/tests/DOM/conformance/level1/core/hc_characterdatadeletedatagetlengthanddata.hpp new file mode 100644 index 00000000..213c76b6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatadeletedatagetlengthanddata.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatadeletedatagetlengthanddata +#define test_hc_characterdatadeletedatagetlengthanddata + +#include "dom_conf_test.hpp" + +/** + * On successful invocation of the "deleteData(offset,count)" + * method, the "getData()" and "getLength()" methods reflect + * the changes. + * + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=30 and count=5. + * The method should delete the characters from position + * 30 thru position 35. The new value of the character data + * should be "1230 North Ave. Dallas, Texas" which is + * returned by the "getData()" method and "getLength()" + * method should return 30". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class hc_characterdatadeletedatagetlengthanddata : public DOMTestCase +{ + public: + hc_characterdatadeletedatagetlengthanddata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + int childLength; + std::vector result; + + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(30, 5); + childData = child.getData(); + assertEquals("1230 North Ave. Dallas, Texas ", childData); + childLength = (int) child.getLength(); + assertEquals(30, childLength); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatagetlengthanddata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatadeletedatamiddle.hpp b/tests/DOM/conformance/level1/core/hc_characterdatadeletedatamiddle.hpp new file mode 100644 index 00000000..0c9ed714 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatadeletedatamiddle.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatadeletedatamiddle +#define test_hc_characterdatadeletedatamiddle + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method removes a range of + * characters from the node. Delete data in the middle + * of the character data. + * + * Retrieve the character data from the last child of the + * first employee. The "deleteData(offset,count)" + * method is then called with offset=16 and count=8. + * The method should delete the characters from position + * 16 thru position 24. The new value of the character data + * should be "1230 North Ave. Texas 98551". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class hc_characterdatadeletedatamiddle : public DOMTestCase +{ + public: + hc_characterdatadeletedatamiddle(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.deleteData(16, 8); + childData = child.getData(); + assertEquals("1230 North Ave. Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatamiddle"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatagetdata.hpp b/tests/DOM/conformance/level1/core/hc_characterdatagetdata.hpp new file mode 100644 index 00000000..7fa99d1a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatagetdata.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatagetdata +#define test_hc_characterdatagetdata + +#include "dom_conf_test.hpp" + +/** + * The "getData()" method retrieves the character data + * currently stored in the node. + * Retrieve the character data from the second child + * of the first employee and invoke the "getData()" + * method. The method returns the character data + * string. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +*/ + +template +class hc_characterdatagetdata : public DOMTestCase +{ + public: + hc_characterdatagetdata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + childData = child.getData(); + assertEquals("Margaret Martin", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatagetdata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatagetlength.hpp b/tests/DOM/conformance/level1/core/hc_characterdatagetlength.hpp new file mode 100644 index 00000000..e3374ee6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatagetlength.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatagetlength +#define test_hc_characterdatagetlength + +#include "dom_conf_test.hpp" + +/** + * The "getLength()" method returns the number of characters + * stored in this nodes data. + * Retrieve the character data from the second + * child of the first employee and examine the + * value returned by the getLength() method. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C +*/ + +template +class hc_characterdatagetlength : public DOMTestCase +{ + public: + hc_characterdatagetlength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childValue; + int childLength; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + childValue = child.getData(); + childLength = SA::length(childValue); + assertEquals(15, childLength); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatagetlength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.hpp new file mode 100644 index 00000000..203c7f2e --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrdeletedatacountnegative +#define test_hc_characterdataindexsizeerrdeletedatacountnegative + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified count + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "deleteData(offset,count)" + * method with offset=10 and count=-3. It should raise the + * desired exception since the count is negative. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class hc_characterdataindexsizeerrdeletedatacountnegative : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrdeletedatacountnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childSubstring; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + childSubstring = child.substringData(10, -3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.hpp new file mode 100644 index 00000000..013ef31c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrdeletedataoffsetgreater +#define test_hc_characterdataindexsizeerrdeletedataoffsetgreater + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is greater that the number of characters in the string. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "deleteData(offset,count)" + * method with offset=40 and count=3. It should raise the + * desired exception since the offset is greater than the + * number of characters in the string. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_characterdataindexsizeerrdeletedataoffsetgreater : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrdeletedataoffsetgreater(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.deleteData(40, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.hpp new file mode 100644 index 00000000..7076b23d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrdeletedataoffsetnegative +#define test_hc_characterdataindexsizeerrdeletedataoffsetnegative + +#include "dom_conf_test.hpp" + +/** + * The "deleteData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "deleteData(offset,count)" + * method with offset=-5 and count=3. It should raise the + * desired exception since the offset is negative. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ + +template +class hc_characterdataindexsizeerrdeletedataoffsetnegative : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrdeletedataoffsetnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.deleteData(-5, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.hpp new file mode 100644 index 00000000..ef0bc680 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrinsertdataoffsetgreater +#define test_hc_characterdataindexsizeerrinsertdataoffsetgreater + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is greater than the number of characters in the string. + * + * Retrieve the character data of the last child of the + * first employee and invoke its insertData"(offset,arg)" + * method with offset=40 and arg="ABC". It should raise + * the desired exception since the offset is greater than + * the number of characters in the string. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_characterdataindexsizeerrinsertdataoffsetgreater : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrinsertdataoffsetgreater(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.deleteData(40, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.hpp new file mode 100644 index 00000000..b592148a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrinsertdataoffsetnegative +#define test_hc_characterdataindexsizeerrinsertdataoffsetnegative + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its insertData"(offset,arg)" + * method with offset=-5 and arg="ABC". It should raise + * the desired exception since the offset is negative. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class hc_characterdataindexsizeerrinsertdataoffsetnegative : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrinsertdataoffsetnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.replaceData(-5, 3, SA::construct_from_utf8("ABC")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.hpp new file mode 100644 index 00000000..a9e64323 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrreplacedatacountnegative +#define test_hc_characterdataindexsizeerrreplacedatacountnegative + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified count + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its + * "replaceData(offset,count,arg) method with offset=10 + * and count=-3 and arg="ABC". It should raise the + * desired exception since the count is negative. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class hc_characterdataindexsizeerrreplacedatacountnegative : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrreplacedatacountnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String badString; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + badString = child.substringData(10, -3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.hpp new file mode 100644 index 00000000..dc82757d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrreplacedataoffsetgreater +#define test_hc_characterdataindexsizeerrreplacedataoffsetgreater + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is greater than the length of the string. + * + * Retrieve the character data of the last child of the + * first employee and invoke its + * "replaceData(offset,count,arg) method with offset=40 + * and count=3 and arg="ABC". It should raise the + * desired exception since the offset is greater than the + * length of the string. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=242 +*/ + +template +class hc_characterdataindexsizeerrreplacedataoffsetgreater : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrreplacedataoffsetgreater(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.deleteData(40, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.hpp new file mode 100644 index 00000000..0c920dee --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrreplacedataoffsetnegative +#define test_hc_characterdataindexsizeerrreplacedataoffsetnegative + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its + * "replaceData(offset,count,arg) method with offset=-5 + * and count=3 and arg="ABC". It should raise the + * desired exception since the offset is negative. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class hc_characterdataindexsizeerrreplacedataoffsetnegative : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrreplacedataoffsetnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + child.replaceData(-5, 3, SA::construct_from_utf8("ABC")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.hpp new file mode 100644 index 00000000..bea4362c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrsubstringcountnegative +#define test_hc_characterdataindexsizeerrsubstringcountnegative + +#include "dom_conf_test.hpp" + +/** + * The "substringData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified count + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "substringData(offset,count) + * method with offset=10 and count=-3. It should raise the + * desired exception since the count is negative. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class hc_characterdataindexsizeerrsubstringcountnegative : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrsubstringcountnegative(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String badSubstring; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + badSubstring = child.substringData(10, -3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringcountnegative"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.hpp new file mode 100644 index 00000000..40dfaddb --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrsubstringnegativeoffset +#define test_hc_characterdataindexsizeerrsubstringnegativeoffset + +#include "dom_conf_test.hpp" + +/** + * The "substringData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is negative. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "substringData(offset,count) + * method with offset=-5 and count=3. It should raise the + * desired exception since the offset is negative. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class hc_characterdataindexsizeerrsubstringnegativeoffset : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrsubstringnegativeoffset(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String badString; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + badString = child.substringData(-5, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.hpp b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.hpp new file mode 100644 index 00000000..13544d6c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdataindexsizeerrsubstringoffsetgreater +#define test_hc_characterdataindexsizeerrsubstringoffsetgreater + +#include "dom_conf_test.hpp" + +/** + * The "substringData(offset,count)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset + * is greater than the number of characters in the string. + * + * Retrieve the character data of the last child of the + * first employee and invoke its "substringData(offset,count) + * method with offset=40 and count=3. It should raise the + * desired exception since the offsets value is greater + * than the length. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_characterdataindexsizeerrsubstringoffsetgreater : public DOMTestCase +{ + public: + hc_characterdataindexsizeerrsubstringoffsetgreater(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String badString; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + + { + boolean success = false; + try { + badString = child.substringData(40, 3); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatainsertdatabeginning.hpp b/tests/DOM/conformance/level1/core/hc_characterdatainsertdatabeginning.hpp new file mode 100644 index 00000000..ff1157ee --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatainsertdatabeginning.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatainsertdatabeginning +#define test_hc_characterdatainsertdatabeginning + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method will insert a string + * at the specified character offset. Insert the data at + * the beginning of the character data. + * Retrieve the character data from the second child of + * the first employee. The "insertData(offset,arg)" + * method is then called with offset=0 and arg="Mss.". + * The method should insert the string "Mss." at position 0. + * The new value of the character data should be + * "Mss. Margaret Martin". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ + +template +class hc_characterdatainsertdatabeginning : public DOMTestCase +{ + public: + hc_characterdatainsertdatabeginning(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.insertData(0, SA::construct_from_utf8("Mss. ")); + childData = child.getData(); + assertEquals("Mss. Margaret Martin", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdatabeginning"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatainsertdataend.hpp b/tests/DOM/conformance/level1/core/hc_characterdatainsertdataend.hpp new file mode 100644 index 00000000..2e6b3f9d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatainsertdataend.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatainsertdataend +#define test_hc_characterdatainsertdataend + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method will insert a string + * at the specified character offset. Insert the data at + * the end of the character data. + * + * Retrieve the character data from the second child of + * the first employee. The "insertData(offset,arg)" + * method is then called with offset=15 and arg=", Esquire". + * The method should insert the string ", Esquire" at + * position 15. The new value of the character data should + * be "Margaret Martin, Esquire". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ + +template +class hc_characterdatainsertdataend : public DOMTestCase +{ + public: + hc_characterdatainsertdataend(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.insertData(15, SA::construct_from_utf8(", Esquire")); + childData = child.getData(); + assertEquals("Margaret Martin, Esquire", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdataend"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatainsertdatamiddle.hpp b/tests/DOM/conformance/level1/core/hc_characterdatainsertdatamiddle.hpp new file mode 100644 index 00000000..de6d2ded --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatainsertdatamiddle.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatainsertdatamiddle +#define test_hc_characterdatainsertdatamiddle + +#include "dom_conf_test.hpp" + +/** + * The "insertData(offset,arg)" method will insert a string + * at the specified character offset. Insert the data in + * the middle of the character data. + * + * Retrieve the character data from the second child of + * the first employee. The "insertData(offset,arg)" + * method is then called with offset=9 and arg="Ann". + * The method should insert the string "Ann" at position 9. + * The new value of the character data should be + * "Margaret Ann Martin". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ + +template +class hc_characterdatainsertdatamiddle : public DOMTestCase +{ + public: + hc_characterdatainsertdatamiddle(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.insertData(9, SA::construct_from_utf8("Ann ")); + childData = child.getData(); + assertEquals("Margaret Ann Martin", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdatamiddle"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatareplacedatabegining.hpp b/tests/DOM/conformance/level1/core/hc_characterdatareplacedatabegining.hpp new file mode 100644 index 00000000..df7bacf4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatareplacedatabegining.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatareplacedatabegining +#define test_hc_characterdatareplacedatabegining + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method replaces the + * characters starting at the specified offset with the + * specified string. Test for replacement in the + * middle of the data. + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=5 and count=5 and + * arg="South". The method should replace characters five + * thru 9 of the character data with "South". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class hc_characterdatareplacedatabegining : public DOMTestCase +{ + public: + hc_characterdatareplacedatabegining(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(0, 4, SA::construct_from_utf8("2500")); + childData = child.getData(); + assertEquals("2500 North Ave. Dallas, Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedatabegining"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatareplacedataend.hpp b/tests/DOM/conformance/level1/core/hc_characterdatareplacedataend.hpp new file mode 100644 index 00000000..8464d685 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatareplacedataend.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatareplacedataend +#define test_hc_characterdatareplacedataend + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method replaces the + * characters starting at the specified offset with the + * specified string. Test for replacement at the + * end of the data. + * + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=30 and count=5 and + * arg="98665". The method should replace characters 30 + * thru 34 of the character data with "98665". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class hc_characterdatareplacedataend : public DOMTestCase +{ + public: + hc_characterdatareplacedataend(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(30, 5, SA::construct_from_utf8("98665")); + childData = child.getData(); + assertEquals("1230 North Ave. Dallas, Texas 98665", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataend"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatareplacedataexceedslengthofarg.hpp b/tests/DOM/conformance/level1/core/hc_characterdatareplacedataexceedslengthofarg.hpp new file mode 100644 index 00000000..87245f67 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatareplacedataexceedslengthofarg.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatareplacedataexceedslengthofarg +#define test_hc_characterdatareplacedataexceedslengthofarg + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method replaces the + * characters starting at the specified offset with the + * specified string. Test the situation where the length + * of the arg string is greater than the specified offset. + * + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=0 and count=4 and + * arg="260030". The method should replace characters one + * thru four with "260030". Note that the length of the + * specified string is greater that the specified offset. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class hc_characterdatareplacedataexceedslengthofarg : public DOMTestCase +{ + public: + hc_characterdatareplacedataexceedslengthofarg(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(0, 4, SA::construct_from_utf8("260030")); + childData = child.getData(); + assertEquals("260030 North Ave. Dallas, Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataexceedslengthofarg"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatareplacedataexceedslengthofdata.hpp b/tests/DOM/conformance/level1/core/hc_characterdatareplacedataexceedslengthofdata.hpp new file mode 100644 index 00000000..fd157a1e --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatareplacedataexceedslengthofdata.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatareplacedataexceedslengthofdata +#define test_hc_characterdatareplacedataexceedslengthofdata + +#include "dom_conf_test.hpp" + +/** + * If the sum of the offset and count exceeds the length then + * all the characters to the end of the data are replaced. + * + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=0 and count=50 and + * arg="2600". The method should replace all the characters + * with "2600". This is because the sum of the offset and + * count exceeds the length of the character data. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class hc_characterdatareplacedataexceedslengthofdata : public DOMTestCase +{ + public: + hc_characterdatareplacedataexceedslengthofdata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(0, 50, SA::construct_from_utf8("2600")); + childData = child.getData(); + assertEquals("2600", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataexceedslengthofdata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatareplacedatamiddle.hpp b/tests/DOM/conformance/level1/core/hc_characterdatareplacedatamiddle.hpp new file mode 100644 index 00000000..ea892da4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatareplacedatamiddle.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatareplacedatamiddle +#define test_hc_characterdatareplacedatamiddle + +#include "dom_conf_test.hpp" + +/** + * The "replaceData(offset,count,arg)" method replaces the + * characters starting at the specified offset with the + * specified string. Test for replacement in the + * middle of the data. + * + * Retrieve the character data from the last child of the + * first employee. The "replaceData(offset,count,arg)" + * method is then called with offset=5 and count=5 and + * arg="South". The method should replace characters five + * thru 9 of the character data with "South". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ + +template +class hc_characterdatareplacedatamiddle : public DOMTestCase +{ + public: + hc_characterdatareplacedatamiddle(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.replaceData(5, 5, SA::construct_from_utf8("South")); + childData = child.getData(); + assertEquals("1230 South Ave. Dallas, Texas 98551", childData); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedatamiddle"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatasetnodevalue.hpp b/tests/DOM/conformance/level1/core/hc_characterdatasetnodevalue.hpp new file mode 100644 index 00000000..cd6b18a0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatasetnodevalue.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatasetnodevalue +#define test_hc_characterdatasetnodevalue + +#include "dom_conf_test.hpp" + +/** + * The "setNodeValue()" method changes the character data + * currently stored in the node. + * Retrieve the character data from the second child + * of the first employee and invoke the "setNodeValue()" + * method, call "getData()" and compare. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +*/ + +template +class hc_characterdatasetnodevalue : public DOMTestCase +{ + public: + hc_characterdatasetnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String childData; + String childValue; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + child.setNodeValue(SA::construct_from_utf8("Marilyn Martin")); + childData = child.getData(); + assertEquals("Marilyn Martin", childData); + childValue = child.getNodeValue(); + assertEquals("Marilyn Martin", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasetnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatasubstringexceedsvalue.hpp b/tests/DOM/conformance/level1/core/hc_characterdatasubstringexceedsvalue.hpp new file mode 100644 index 00000000..5724791f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatasubstringexceedsvalue.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatasubstringexceedsvalue +#define test_hc_characterdatasubstringexceedsvalue + +#include "dom_conf_test.hpp" + +/** + * If the sum of the "offset" and "count" exceeds the + * "length" then the "substringData(offset,count)" method + * returns all the characters to the end of the data. + * + * Retrieve the character data from the second child + * of the first employee and access part of the data + * by using the substringData(offset,count) method + * with offset=9 and count=10. The method should return + * the substring "Martin" since offset+count > length + * (19 > 15). +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +*/ + +template +class hc_characterdatasubstringexceedsvalue : public DOMTestCase +{ + public: + hc_characterdatasubstringexceedsvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String substring; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + substring = child.substringData(9, 10); + assertEquals("Martin", substring); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasubstringexceedsvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_characterdatasubstringvalue.hpp b/tests/DOM/conformance/level1/core/hc_characterdatasubstringvalue.hpp new file mode 100644 index 00000000..7de78b42 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_characterdatasubstringvalue.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_characterdatasubstringvalue +#define test_hc_characterdatasubstringvalue + +#include "dom_conf_test.hpp" + +/** + * The "substringData(offset,count)" method returns the + * specified string. + * + * Retrieve the character data from the second child + * of the first employee and access part of the data + * by using the substringData(offset,count) method. The + * method should return the specified substring starting + * at position "offset" and extract "count" characters. + * The method should return the string "Margaret". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +*/ + +template +class hc_characterdatasubstringvalue : public DOMTestCase +{ + public: + hc_characterdatasubstringvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + CharacterData child; + String substring; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(0); + child = (CharacterData) nameNode.getFirstChild(); + substring = child.substringData(0, 8); + assertEquals("Margaret", substring); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasubstringvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_commentgetcomment.hpp b/tests/DOM/conformance/level1/core/hc_commentgetcomment.hpp new file mode 100644 index 00000000..0ba937b2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_commentgetcomment.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_commentgetcomment +#define test_hc_commentgetcomment + +#include "dom_conf_test.hpp" + +/** + * A comment is all the characters between the starting + * '' + * Retrieve the nodes of the DOM document. Search for a + * comment node and the content is its value. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=509 +*/ + +template +class hc_commentgetcomment : public DOMTestCase +{ + public: + hc_commentgetcomment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node child; + String childName; + String childValue; + int commentCount = 0; + int childType; + NamedNodeMap attributes; + doc = (Document) load("hc_staff", false); + elementList = doc.getChildNodes(); + for (int indexN65630 = 0; indexN65630 != elementList.getLength(); indexN65630++) { + child = (Node) elementList.item(indexN65630); + childType = (int) child.getNodeType(); + + if (equals(8, childType)) { + childName = child.getNodeName(); + assertEquals("#comment", childName); + childValue = child.getNodeValue(); + assertEquals(" This is comment number 1.", childValue); + attributes = child.getAttributes(); + assertNull(attributes); + commentCount += 1; + } + } + assertTrue((commentCount < 2)); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_commentgetcomment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentcreateattribute.hpp b/tests/DOM/conformance/level1/core/hc_documentcreateattribute.hpp new file mode 100644 index 00000000..364063ce --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentcreateattribute.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentcreateattribute +#define test_hc_documentcreateattribute + +#include "dom_conf_test.hpp" + +/** + * Retrieve the entire DOM document and invoke its + * "createAttribute(name)" method. It should create a + * new Attribute node with the given name. The name, value + * and type of the newly created object are retrieved and + * output. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_documentcreateattribute : public DOMTestCase +{ + public: + hc_documentcreateattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr newAttrNode; + String attrValue; + String attrName; + int attrType; + doc = (Document) load("hc_staff", true); + newAttrNode = doc.createAttribute(SA::construct_from_utf8("title")); + attrValue = newAttrNode.getNodeValue(); + assertEquals("", attrValue); + attrName = newAttrNode.getNodeName(); + assertEquals("title", attrName); + attrType = (int) newAttrNode.getNodeType(); + assertEquals(2, attrType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentcreatecomment.hpp b/tests/DOM/conformance/level1/core/hc_documentcreatecomment.hpp new file mode 100644 index 00000000..83ab7ea2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentcreatecomment.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentcreatecomment +#define test_hc_documentcreatecomment + +#include "dom_conf_test.hpp" + +/** + * The "createComment(data)" method creates a new Comment + * node given the specified string. + * Retrieve the entire DOM document and invoke its + * "createComment(data)" method. It should create a new + * Comment node whose "data" is the specified string. + * The content, name and type are retrieved and output. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328 +*/ + +template +class hc_documentcreatecomment : public DOMTestCase +{ + public: + hc_documentcreatecomment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Comment newCommentNode; + String newCommentValue; + String newCommentName; + int newCommentType; + doc = (Document) load("hc_staff", true); + newCommentNode = doc.createComment(SA::construct_from_utf8("This is a new Comment node")); + newCommentValue = newCommentNode.getNodeValue(); + assertEquals("This is a new Comment node", newCommentValue); + newCommentName = newCommentNode.getNodeName(); + assertEquals("#comment", newCommentName); + newCommentType = (int) newCommentNode.getNodeType(); + assertEquals(8, newCommentType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatecomment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentcreatedocumentfragment.hpp b/tests/DOM/conformance/level1/core/hc_documentcreatedocumentfragment.hpp new file mode 100644 index 00000000..8f43b526 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentcreatedocumentfragment.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentcreatedocumentfragment +#define test_hc_documentcreatedocumentfragment + +#include "dom_conf_test.hpp" + +/** + * The "createDocumentFragment()" method creates an empty + * DocumentFragment object. + * Retrieve the entire DOM document and invoke its + * "createDocumentFragment()" method. The content, name, + * type and value of the newly created object are output. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5 +*/ + +template +class hc_documentcreatedocumentfragment : public DOMTestCase +{ + public: + hc_documentcreatedocumentfragment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment newDocFragment; + NodeList children; + int length; + String newDocFragmentName; + int newDocFragmentType; + String newDocFragmentValue; + doc = (Document) load("hc_staff", true); + newDocFragment = doc.createDocumentFragment(); + children = newDocFragment.getChildNodes(); + length = (int) children.getLength(); + assertEquals(0, length); + newDocFragmentName = newDocFragment.getNodeName(); + assertEquals("#document-fragment", newDocFragmentName); + newDocFragmentType = (int) newDocFragment.getNodeType(); + assertEquals(11, newDocFragmentType); + newDocFragmentValue = newDocFragment.getNodeValue(); + assertNull(newDocFragmentValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatedocumentfragment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentcreateelement.hpp b/tests/DOM/conformance/level1/core/hc_documentcreateelement.hpp new file mode 100644 index 00000000..14896d58 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentcreateelement.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentcreateelement +#define test_hc_documentcreateelement + +#include "dom_conf_test.hpp" + +/** + * The "createElement(tagName)" method creates an Element + * of the type specified. + * Retrieve the entire DOM document and invoke its + * "createElement(tagName)" method with tagName="acronym". + * The method should create an instance of an Element node + * whose tagName is "acronym". The NodeName, NodeType + * and NodeValue are returned. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +*/ + +template +class hc_documentcreateelement : public DOMTestCase +{ + public: + hc_documentcreateelement(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element newElement; + String newElementName; + int newElementType; + String newElementValue; + doc = (Document) load("hc_staff", true); + newElement = doc.createElement(SA::construct_from_utf8("acronym")); + newElementName = newElement.getNodeName(); + assertEquals("acronym", newElementName); + newElementType = (int) newElement.getNodeType(); + assertEquals(1, newElementType); + newElementValue = newElement.getNodeValue(); + assertNull(newElementValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateelement"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentcreateelementcasesensitive.hpp b/tests/DOM/conformance/level1/core/hc_documentcreateelementcasesensitive.hpp new file mode 100644 index 00000000..a0e3535f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentcreateelementcasesensitive.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentcreateelementcasesensitive +#define test_hc_documentcreateelementcasesensitive + +#include "dom_conf_test.hpp" + +/** + * The tagName parameter in the "createElement(tagName)" + * method is case-sensitive for XML documents. + * Retrieve the entire DOM document and invoke its + * "createElement(tagName)" method twice. Once for tagName + * equal to "acronym" and once for tagName equal to "ACRONYM" + * Each call should create a distinct Element node. The + * newly created Elements are then assigned attributes + * that are retrieved. + * Modified on 27 June 2003 to avoid setting an invalid style + * values and checked the node names to see if they matched expectations. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_documentcreateelementcasesensitive : public DOMTestCase +{ + public: + hc_documentcreateelementcasesensitive(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element newElement1; + Element newElement2; + String attribute1; + String attribute2; + String nodeName1; + String nodeName2; + doc = (Document) load("hc_staff", true); + newElement1 = doc.createElement(SA::construct_from_utf8("ACRONYM")); + newElement2 = doc.createElement(SA::construct_from_utf8("acronym")); + newElement1.setAttribute(SA::construct_from_utf8("lang"), SA::construct_from_utf8("EN")); + newElement2.setAttribute(SA::construct_from_utf8("title"), SA::construct_from_utf8("Dallas")); + attribute1 = newElement1.getAttribute(SA::construct_from_utf8("lang")); + attribute2 = newElement2.getAttribute(SA::construct_from_utf8("title")); + assertEquals("EN", attribute1); + assertEquals("Dallas", attribute2); + nodeName1 = newElement1.getNodeName(); + nodeName2 = newElement2.getNodeName(); + assertEquals("ACRONYM", nodeName1); + assertEquals("acronym", nodeName2); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateelementcasesensitive"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentcreatetextnode.hpp b/tests/DOM/conformance/level1/core/hc_documentcreatetextnode.hpp new file mode 100644 index 00000000..61bbf9a0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentcreatetextnode.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentcreatetextnode +#define test_hc_documentcreatetextnode + +#include "dom_conf_test.hpp" + +/** + * The "createTextNode(data)" method creates a Text node + * given the specfied string. + * Retrieve the entire DOM document and invoke its + * "createTextNode(data)" method. It should create a + * new Text node whose "data" is the specified string. + * The NodeName and NodeType are also checked. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1975348127 +*/ + +template +class hc_documentcreatetextnode : public DOMTestCase +{ + public: + hc_documentcreatetextnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Text newTextNode; + String newTextName; + String newTextValue; + int newTextType; + doc = (Document) load("hc_staff", true); + newTextNode = doc.createTextNode(SA::construct_from_utf8("This is a new Text node")); + newTextValue = newTextNode.getNodeValue(); + assertEquals("This is a new Text node", newTextValue); + newTextName = newTextNode.getNodeName(); + assertEquals("#text", newTextName); + newTextType = (int) newTextNode.getNodeType(); + assertEquals(3, newTextType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatetextnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentgetdoctype.hpp b/tests/DOM/conformance/level1/core/hc_documentgetdoctype.hpp new file mode 100644 index 00000000..2495d0e6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentgetdoctype.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentgetdoctype +#define test_hc_documentgetdoctype + +#include "dom_conf_test.hpp" + +/** + * Access Document.doctype for hc_staff, if not text/html should return DocumentType node. + * HTML implementations may return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +*/ + +template +class hc_documentgetdoctype : public DOMTestCase +{ + public: + hc_documentgetdoctype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + String docTypeName; + String nodeValue; + NamedNodeMap attributes; + doc = (Document) load("hc_staff", false); + docType = doc.getDoctype(); + + if ( + !(("text/html" == getContentType())) +) { + assertNotNull(docType); + } + + if ((notNull(docType))) { + docTypeName = docType.getName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", docTypeName); + } else { + assertEquals("html", docTypeName); + } + + nodeValue = docType.getNodeValue(); + assertNull(nodeValue); + attributes = docType.getAttributes(); + assertNull(attributes); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetdoctype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnamelength.hpp b/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnamelength.hpp new file mode 100644 index 00000000..0d9a7a39 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnamelength.hpp @@ -0,0 +1,95 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentgetelementsbytagnamelength +#define test_hc_documentgetelementsbytagnamelength + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(tagName)" method returns a + * NodeList of all the Elements with a given tagName. + * + * Retrieve the entire DOM document and invoke its + * "getElementsByTagName(tagName)" method with tagName + * equal to "strong". The method should return a NodeList + * that contains 5 elements. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +*/ + +template +class hc_documentgetelementsbytagnamelength : public DOMTestCase +{ + public: + hc_documentgetelementsbytagnamelength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList nameList; + doc = (Document) load("hc_staff", false); + nameList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + assertSize(5, nameList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnamelength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnametotallength.hpp b/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnametotallength.hpp new file mode 100644 index 00000000..ef217fd3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnametotallength.hpp @@ -0,0 +1,197 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentgetelementsbytagnametotallength +#define test_hc_documentgetelementsbytagnametotallength + +#include "dom_conf_test.hpp" + +/** + * Retrieve the entire DOM document and invoke its + * "getElementsByTagName(tagName)" method with tagName + * equal to "*". The method should return a NodeList + * that contains all the elements of the document. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class hc_documentgetelementsbytagnametotallength : public DOMTestCase +{ + public: + hc_documentgetelementsbytagnametotallength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList nameList; + std::vector expectedNames; + expectedNames.push_back(SA::construct_from_utf8("html")); + expectedNames.push_back(SA::construct_from_utf8("head")); + expectedNames.push_back(SA::construct_from_utf8("meta")); + expectedNames.push_back(SA::construct_from_utf8("title")); + expectedNames.push_back(SA::construct_from_utf8("script")); + expectedNames.push_back(SA::construct_from_utf8("script")); + expectedNames.push_back(SA::construct_from_utf8("script")); + expectedNames.push_back(SA::construct_from_utf8("body")); + expectedNames.push_back(SA::construct_from_utf8("p")); + expectedNames.push_back(SA::construct_from_utf8("em")); + expectedNames.push_back(SA::construct_from_utf8("strong")); + expectedNames.push_back(SA::construct_from_utf8("code")); + expectedNames.push_back(SA::construct_from_utf8("sup")); + expectedNames.push_back(SA::construct_from_utf8("var")); + expectedNames.push_back(SA::construct_from_utf8("acronym")); + expectedNames.push_back(SA::construct_from_utf8("p")); + expectedNames.push_back(SA::construct_from_utf8("em")); + expectedNames.push_back(SA::construct_from_utf8("strong")); + expectedNames.push_back(SA::construct_from_utf8("code")); + expectedNames.push_back(SA::construct_from_utf8("sup")); + expectedNames.push_back(SA::construct_from_utf8("var")); + expectedNames.push_back(SA::construct_from_utf8("acronym")); + expectedNames.push_back(SA::construct_from_utf8("p")); + expectedNames.push_back(SA::construct_from_utf8("em")); + expectedNames.push_back(SA::construct_from_utf8("strong")); + expectedNames.push_back(SA::construct_from_utf8("code")); + expectedNames.push_back(SA::construct_from_utf8("sup")); + expectedNames.push_back(SA::construct_from_utf8("var")); + expectedNames.push_back(SA::construct_from_utf8("acronym")); + expectedNames.push_back(SA::construct_from_utf8("p")); + expectedNames.push_back(SA::construct_from_utf8("em")); + expectedNames.push_back(SA::construct_from_utf8("strong")); + expectedNames.push_back(SA::construct_from_utf8("code")); + expectedNames.push_back(SA::construct_from_utf8("sup")); + expectedNames.push_back(SA::construct_from_utf8("var")); + expectedNames.push_back(SA::construct_from_utf8("acronym")); + expectedNames.push_back(SA::construct_from_utf8("p")); + expectedNames.push_back(SA::construct_from_utf8("em")); + expectedNames.push_back(SA::construct_from_utf8("strong")); + expectedNames.push_back(SA::construct_from_utf8("code")); + expectedNames.push_back(SA::construct_from_utf8("sup")); + expectedNames.push_back(SA::construct_from_utf8("var")); + expectedNames.push_back(SA::construct_from_utf8("acronym")); + + std::vector svgExpectedNames; + svgExpectedNames.push_back(SA::construct_from_utf8("svg")); + svgExpectedNames.push_back(SA::construct_from_utf8("rect")); + svgExpectedNames.push_back(SA::construct_from_utf8("script")); + svgExpectedNames.push_back(SA::construct_from_utf8("head")); + svgExpectedNames.push_back(SA::construct_from_utf8("meta")); + svgExpectedNames.push_back(SA::construct_from_utf8("title")); + svgExpectedNames.push_back(SA::construct_from_utf8("body")); + svgExpectedNames.push_back(SA::construct_from_utf8("p")); + svgExpectedNames.push_back(SA::construct_from_utf8("em")); + svgExpectedNames.push_back(SA::construct_from_utf8("strong")); + svgExpectedNames.push_back(SA::construct_from_utf8("code")); + svgExpectedNames.push_back(SA::construct_from_utf8("sup")); + svgExpectedNames.push_back(SA::construct_from_utf8("var")); + svgExpectedNames.push_back(SA::construct_from_utf8("acronym")); + svgExpectedNames.push_back(SA::construct_from_utf8("p")); + svgExpectedNames.push_back(SA::construct_from_utf8("em")); + svgExpectedNames.push_back(SA::construct_from_utf8("strong")); + svgExpectedNames.push_back(SA::construct_from_utf8("code")); + svgExpectedNames.push_back(SA::construct_from_utf8("sup")); + svgExpectedNames.push_back(SA::construct_from_utf8("var")); + svgExpectedNames.push_back(SA::construct_from_utf8("acronym")); + svgExpectedNames.push_back(SA::construct_from_utf8("p")); + svgExpectedNames.push_back(SA::construct_from_utf8("em")); + svgExpectedNames.push_back(SA::construct_from_utf8("strong")); + svgExpectedNames.push_back(SA::construct_from_utf8("code")); + svgExpectedNames.push_back(SA::construct_from_utf8("sup")); + svgExpectedNames.push_back(SA::construct_from_utf8("var")); + svgExpectedNames.push_back(SA::construct_from_utf8("acronym")); + svgExpectedNames.push_back(SA::construct_from_utf8("p")); + svgExpectedNames.push_back(SA::construct_from_utf8("em")); + svgExpectedNames.push_back(SA::construct_from_utf8("strong")); + svgExpectedNames.push_back(SA::construct_from_utf8("code")); + svgExpectedNames.push_back(SA::construct_from_utf8("sup")); + svgExpectedNames.push_back(SA::construct_from_utf8("var")); + svgExpectedNames.push_back(SA::construct_from_utf8("acronym")); + svgExpectedNames.push_back(SA::construct_from_utf8("p")); + svgExpectedNames.push_back(SA::construct_from_utf8("em")); + svgExpectedNames.push_back(SA::construct_from_utf8("strong")); + svgExpectedNames.push_back(SA::construct_from_utf8("code")); + svgExpectedNames.push_back(SA::construct_from_utf8("sup")); + svgExpectedNames.push_back(SA::construct_from_utf8("var")); + svgExpectedNames.push_back(SA::construct_from_utf8("acronym")); + + std::vector actualNames; + + Element thisElement; + String thisTag; + doc = (Document) load("hc_staff", false); + nameList = doc.getElementsByTagName(SA::construct_from_utf8("*")); + for (int indexN65864 = 0; indexN65864 != nameList.getLength(); indexN65864++) { + thisElement = (Element) nameList.item(indexN65864); + thisTag = thisElement.getTagName(); + actualNames.push_back(thisTag); + } + + if (("image/svg+xml" == getContentType())) { + assertEquals(svgExpectedNames, actualNames); + } else { + assertEquals(expectedNames, actualNames); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnametotallength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnamevalue.hpp b/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnamevalue.hpp new file mode 100644 index 00000000..61053bb5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentgetelementsbytagnamevalue.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentgetelementsbytagnamevalue +#define test_hc_documentgetelementsbytagnamevalue + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(tagName)" method returns a + * NodeList of all the Elements with a given tagName + * in a pre-order traversal of the tree. + * + * Retrieve the entire DOM document and invoke its + * "getElementsByTagName(tagName)" method with tagName + * equal to "strong". The method should return a NodeList + * that contains 5 elements. The FOURTH item in the + * list is retrieved and output. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +*/ + +template +class hc_documentgetelementsbytagnamevalue : public DOMTestCase +{ + public: + hc_documentgetelementsbytagnamevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList nameList; + Node nameNode; + Node firstChild; + String childValue; + doc = (Document) load("hc_staff", false); + nameList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = nameList.item(3); + firstChild = nameNode.getFirstChild(); + childValue = firstChild.getNodeValue(); + assertEquals("Jeny Oconnor", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnamevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentgetimplementation.hpp b/tests/DOM/conformance/level1/core/hc_documentgetimplementation.hpp new file mode 100644 index 00000000..a491b52b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentgetimplementation.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentgetimplementation +#define test_hc_documentgetimplementation + +#include "dom_conf_test.hpp" + +/** + * Retrieve the entire DOM document and invoke its + * "getImplementation()" method. If contentType="text/html", + * DOMImplementation.hasFeature("HTML","1.0") should be true. + * Otherwise, DOMImplementation.hasFeature("XML", "1.0") + * should be true. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1B793EBA +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=245 +*/ + +template +class hc_documentgetimplementation : public DOMTestCase +{ + public: + hc_documentgetimplementation(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DOMImplementation docImpl; + boolean xmlstate; + boolean htmlstate; + doc = (Document) load("hc_staff", false); + docImpl = doc.getImplementation(); + xmlstate = docImpl.hasFeature(SA::construct_from_utf8("XML"), SA::construct_from_utf8("1.0")); +htmlstate = docImpl.hasFeature(SA::construct_from_utf8("HTML"), SA::construct_from_utf8("1.0")); + + if (("text/html" == getContentType())) { + assertTrue(htmlstate); + } else { + assertTrue(xmlstate); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetimplementation"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentgetrootnode.hpp b/tests/DOM/conformance/level1/core/hc_documentgetrootnode.hpp new file mode 100644 index 00000000..7e0382dd --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentgetrootnode.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentgetrootnode +#define test_hc_documentgetrootnode + +#include "dom_conf_test.hpp" + +/** + * Load a document and invoke its + * "getDocumentElement()" method. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-87CD092 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class hc_documentgetrootnode : public DOMTestCase +{ + public: + hc_documentgetrootnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element root; + String rootName; + doc = (Document) load("hc_staff", false); + root = doc.getDocumentElement(); + rootName = root.getNodeName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", rootName); + } else { + assertEquals("html", rootName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetrootnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.hpp b/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.hpp new file mode 100644 index 00000000..204e1e2a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentinvalidcharacterexceptioncreateattribute +#define test_hc_documentinvalidcharacterexceptioncreateattribute + +#include "dom_conf_test.hpp" + +/** + * The "createAttribute(tagName)" method raises an + * INVALID_CHARACTER_ERR DOMException if the specified + * tagName contains an invalid character. + * + * Retrieve the entire DOM document and invoke its + * "createAttribute(tagName)" method with the tagName equal + * to the string "invalid^Name". Due to the invalid + * character the desired EXCEPTION should be raised. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_documentinvalidcharacterexceptioncreateattribute : public DOMTestCase +{ + public: + hc_documentinvalidcharacterexceptioncreateattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr createdAttr; + doc = (Document) load("hc_staff", true); + + { + boolean success = false; + try { + createdAttr = doc.createAttribute(SA::construct_from_utf8("invalid^Name")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.hpp b/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.hpp new file mode 100644 index 00000000..c6d33708 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentinvalidcharacterexceptioncreateattribute1 +#define test_hc_documentinvalidcharacterexceptioncreateattribute1 + +#include "dom_conf_test.hpp" + +/** + * Creating an attribute with an empty name should cause an INVALID_CHARACTER_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ + +template +class hc_documentinvalidcharacterexceptioncreateattribute1 : public DOMTestCase +{ + public: + hc_documentinvalidcharacterexceptioncreateattribute1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr createdAttr; + doc = (Document) load("hc_staff", true); + + { + boolean success = false; + try { + createdAttr = doc.createAttribute(SA::construct_from_utf8("")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateelement.hpp b/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateelement.hpp new file mode 100644 index 00000000..bdb26217 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateelement.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentinvalidcharacterexceptioncreateelement +#define test_hc_documentinvalidcharacterexceptioncreateelement + +#include "dom_conf_test.hpp" + +/** + * The "createElement(tagName)" method raises an + * INVALID_CHARACTER_ERR DOMException if the specified + * tagName contains an invalid character. + * + * Retrieve the entire DOM document and invoke its + * "createElement(tagName)" method with the tagName equal + * to the string "invalid^Name". Due to the invalid + * character the desired EXCEPTION should be raised. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_documentinvalidcharacterexceptioncreateelement : public DOMTestCase +{ + public: + hc_documentinvalidcharacterexceptioncreateelement(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element badElement; + doc = (Document) load("hc_staff", true); + + { + boolean success = false; + try { + badElement = doc.createElement(SA::construct_from_utf8("invalid^Name")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.hpp b/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.hpp new file mode 100644 index 00000000..e1e4ea50 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_documentinvalidcharacterexceptioncreateelement1 +#define test_hc_documentinvalidcharacterexceptioncreateelement1 + +#include "dom_conf_test.hpp" + +/** + * Creating an element with an empty name should cause an INVALID_CHARACTER_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ + +template +class hc_documentinvalidcharacterexceptioncreateelement1 : public DOMTestCase +{ + public: + hc_documentinvalidcharacterexceptioncreateelement1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element badElement; + doc = (Document) load("hc_staff", true); + + { + boolean success = false; + try { + badElement = doc.createElement(SA::construct_from_utf8("")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_domimplementationfeaturenoversion.hpp b/tests/DOM/conformance/level1/core/hc_domimplementationfeaturenoversion.hpp new file mode 100644 index 00000000..e40ed19b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_domimplementationfeaturenoversion.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_domimplementationfeaturenoversion +#define test_hc_domimplementationfeaturenoversion + +#include "dom_conf_test.hpp" + +/** + * Load a document and invoke its + * "getImplementation()" method. This should create a + * DOMImplementation object whose "hasFeature(feature, + * version)" method is invoked with version equal to "". + * If the version is not specified, supporting any version + * feature will cause the method to return "true". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +* @see http://www.w3.org/2000/11/DOM-Level-2-errata#core-14 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=245 +*/ + +template +class hc_domimplementationfeaturenoversion : public DOMTestCase +{ + public: + hc_domimplementationfeaturenoversion(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DOMImplementation domImpl; + boolean state; + doc = (Document) load("hc_staff", false); + domImpl = doc.getImplementation(); + + if (("text/html" == getContentType())) { + state = domImpl.hasFeature(SA::construct_from_utf8("HTML"), SA::construct_from_utf8("")); +} else { + state = domImpl.hasFeature(SA::construct_from_utf8("XML"), SA::construct_from_utf8("")); +} + + assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturenoversion"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_domimplementationfeaturenull.hpp b/tests/DOM/conformance/level1/core/hc_domimplementationfeaturenull.hpp new file mode 100644 index 00000000..c98698dd --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_domimplementationfeaturenull.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_domimplementationfeaturenull +#define test_hc_domimplementationfeaturenull + +#include "dom_conf_test.hpp" + +/** + * Load a document and invoke its + * "getImplementation()" method. This should create a + * DOMImplementation object whose "hasFeature(feature, + * version)" method is invoked with version equal to null. + * If the version is not specified, supporting any version + * feature will cause the method to return "true". +* @author Curt Arnold +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +* @see http://www.w3.org/2000/11/DOM-Level-2-errata#core-14 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=245 +*/ + +template +class hc_domimplementationfeaturenull : public DOMTestCase +{ + public: + hc_domimplementationfeaturenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DOMImplementation domImpl; + boolean state; + doc = (Document) load("hc_staff", false); + domImpl = doc.getImplementation(); + + if (("text/html" == getContentType())) { + state = domImpl.hasFeature(SA::construct_from_utf8("HTML"), SA::construct_from_utf8("")); +assertTrue(state); + } else { + state = domImpl.hasFeature(SA::construct_from_utf8("XML"), SA::construct_from_utf8("")); +assertTrue(state); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_domimplementationfeaturexml.hpp b/tests/DOM/conformance/level1/core/hc_domimplementationfeaturexml.hpp new file mode 100644 index 00000000..060ef538 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_domimplementationfeaturexml.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_domimplementationfeaturexml +#define test_hc_domimplementationfeaturexml + +#include "dom_conf_test.hpp" + +/** + * Retrieve the entire DOM document and invoke its + * "getImplementation()" method. This should create a + * DOMImplementation object whose "hasFeature(feature, + * version)" method is invoked with "feature" equal to "html" or "xml". + * The method should return a boolean "true". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=245 +*/ + +template +class hc_domimplementationfeaturexml : public DOMTestCase +{ + public: + hc_domimplementationfeaturexml(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DOMImplementation domImpl; + boolean state; + doc = (Document) load("hc_staff", false); + domImpl = doc.getImplementation(); + + if (("text/html" == getContentType())) { + state = domImpl.hasFeature(SA::construct_from_utf8("html"), SA::construct_from_utf8("1.0")); +assertTrue(state); + } else { + state = domImpl.hasFeature(SA::construct_from_utf8("xml"), SA::construct_from_utf8("1.0")); +assertTrue(state); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturexml"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementaddnewattribute.hpp b/tests/DOM/conformance/level1/core/hc_elementaddnewattribute.hpp new file mode 100644 index 00000000..ade8bd81 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementaddnewattribute.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementaddnewattribute +#define test_hc_elementaddnewattribute + +#include "dom_conf_test.hpp" + +/** + * The "setAttribute(name,value)" method adds a new attribute + * to the Element + * + * Retrieve the last child of the last employee, then + * add an attribute to it by invoking the + * "setAttribute(name,value)" method. It should create + * a "strong" attribute with an assigned value equal to + * "value". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_elementaddnewattribute : public DOMTestCase +{ + public: + hc_elementaddnewattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + String attrValue; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(4); + testEmployee.setAttribute(SA::construct_from_utf8("lang"), SA::construct_from_utf8("EN-us")); + attrValue = testEmployee.getAttribute(SA::construct_from_utf8("lang")); + assertEquals("EN-us", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementaddnewattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementassociatedattribute.hpp b/tests/DOM/conformance/level1/core/hc_elementassociatedattribute.hpp new file mode 100644 index 00000000..e07898c6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementassociatedattribute.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementassociatedattribute +#define test_hc_elementassociatedattribute + +#include "dom_conf_test.hpp" + +/** + * Retrieve the first attribute from the last child of + * the first employee and invoke the "getSpecified()" + * method. This test is only intended to show that + * Elements can actually have attributes. This test uses + * the "getNamedItem(name)" method from the NamedNodeMap + * interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class hc_elementassociatedattribute : public DOMTestCase +{ + public: + hc_elementassociatedattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Attr domesticAttr; + boolean specified; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = elementList.item(0); + attributes = testEmployee.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + specified = domesticAttr.getSpecified(); + assertTrue(specified); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementassociatedattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementchangeattributevalue.hpp b/tests/DOM/conformance/level1/core/hc_elementchangeattributevalue.hpp new file mode 100644 index 00000000..6e3b4ecb --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementchangeattributevalue.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementchangeattributevalue +#define test_hc_elementchangeattributevalue + +#include "dom_conf_test.hpp" + +/** + * The "setAttribute(name,value)" method adds a new attribute + * to the Element. If the "strong" is already present, then + * its value should be changed to the new one that is in + * the "value" parameter. + * + * Retrieve the last child of the fourth employee, then add + * an attribute to it by invoking the + * "setAttribute(name,value)" method. Since the name of the + * used attribute("class") is already present in this + * element, then its value should be changed to the new one + * of the "value" parameter. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +*/ + +template +class hc_elementchangeattributevalue : public DOMTestCase +{ + public: + hc_elementchangeattributevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + String attrValue; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(3); + testEmployee.setAttribute(SA::construct_from_utf8("class"), SA::construct_from_utf8("Neither")); + attrValue = testEmployee.getAttribute(SA::construct_from_utf8("class")); + assertEquals("Neither", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementchangeattributevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementcreatenewattribute.hpp b/tests/DOM/conformance/level1/core/hc_elementcreatenewattribute.hpp new file mode 100644 index 00000000..9168c161 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementcreatenewattribute.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementcreatenewattribute +#define test_hc_elementcreatenewattribute + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method adds a new + * attribute to the Element. + * + * Retrieve first address element and add + * a new attribute node to it by invoking its + * "setAttributeNode(newAttr)" method. This test makes use + * of the "createAttribute(name)" method from the Document + * interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_elementcreatenewattribute : public DOMTestCase +{ + public: + hc_elementcreatenewattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddress; + Attr newAttribute; + Attr oldAttr; + Attr districtAttr; + String attrVal; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = (Element) elementList.item(0); + newAttribute = doc.createAttribute(SA::construct_from_utf8("lang")); + oldAttr = testAddress.setAttributeNode(newAttribute); + assertNull(oldAttr); + districtAttr = testAddress.getAttributeNode(SA::construct_from_utf8("lang")); + assertNotNull(districtAttr); + attrVal = testAddress.getAttribute(SA::construct_from_utf8("lang")); + assertEquals("", attrVal); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementcreatenewattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementgetattributenode.hpp b/tests/DOM/conformance/level1/core/hc_elementgetattributenode.hpp new file mode 100644 index 00000000..1073eb7c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementgetattributenode.hpp @@ -0,0 +1,98 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementgetattributenode +#define test_hc_elementgetattributenode + +#include "dom_conf_test.hpp" + +/** + * Retrieve the attribute "title" from the last child + * of the first "p" element and check its node name. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +*/ + +template +class hc_elementgetattributenode : public DOMTestCase +{ + public: + hc_elementgetattributenode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr domesticAttr; + String nodeName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(0); + domesticAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("title")); + nodeName = domesticAttr.getNodeName(); + assertEquals("title", nodeName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetattributenode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementgetattributenodenull.hpp b/tests/DOM/conformance/level1/core/hc_elementgetattributenodenull.hpp new file mode 100644 index 00000000..d0dd6bca --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementgetattributenodenull.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementgetattributenodenull +#define test_hc_elementgetattributenodenull + +#include "dom_conf_test.hpp" + +/** + * The "getAttributeNode(name)" method retrieves an + * attribute node by name. It should return null if the + * "strong" attribute does not exist. + * + * Retrieve the last child of the first employee and attempt + * to retrieve a non-existing attribute. The method should + * return "null". The non-existing attribute to be used + * is "invalidAttribute". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8 +*/ + +template +class hc_elementgetattributenodenull : public DOMTestCase +{ + public: + hc_elementgetattributenodenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr domesticAttr; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(0); + domesticAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("invalidAttribute")); + assertNull(domesticAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetattributenodenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementgetelementempty.hpp b/tests/DOM/conformance/level1/core/hc_elementgetelementempty.hpp new file mode 100644 index 00000000..8a3667d7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementgetelementempty.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementgetelementempty +#define test_hc_elementgetelementempty + +#include "dom_conf_test.hpp" + +/** + * The "getAttribute(name)" method returns an empty + * string if no value was assigned to an attribute and + * no default value was given in the DTD file. + * + * Retrieve the last child of the last employee, then + * invoke "getAttribute(name)" method, where "strong" is an + * attribute without a specified or DTD default value. + * The "getAttribute(name)" method should return the empty + * string. This method makes use of the + * "createAttribute(newAttr)" method from the Document + * interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_elementgetelementempty : public DOMTestCase +{ + public: + hc_elementgetelementempty(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr newAttribute; + NodeList elementList; + Element testEmployee; + Attr domesticAttr; + String attrValue; + doc = (Document) load("hc_staff", true); + newAttribute = doc.createAttribute(SA::construct_from_utf8("lang")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(3); + domesticAttr = testEmployee.setAttributeNode(newAttribute); + attrValue = testEmployee.getAttribute(SA::construct_from_utf8("lang")); + assertEquals("", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementempty"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagname.hpp b/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagname.hpp new file mode 100644 index 00000000..9ad2c0ac --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagname.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementgetelementsbytagname +#define test_hc_elementgetelementsbytagname + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(name)" method returns a list + * of all descendant Elements with the given tag name. + * Test for an empty list. + * Create a NodeList of all the descendant elements + * using the string "noMatch" as the tagName. + * The method should return a NodeList whose length is + * "0" since there are not any descendant elements + * that match the given tag name. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ + +template +class hc_elementgetelementsbytagname : public DOMTestCase +{ + public: + hc_elementgetelementsbytagname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + assertSize(5, elementList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnameaccessnodelist.hpp b/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnameaccessnodelist.hpp new file mode 100644 index 00000000..94e21c48 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnameaccessnodelist.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementgetelementsbytagnameaccessnodelist +#define test_hc_elementgetelementsbytagnameaccessnodelist + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(name)" method returns a list + * of all descendant Elements in the order the children + * were encountered in a pre order traversal of the element + * tree. + * Create a NodeList of all the descendant elements + * using the string "p" as the tagName. + * The method should return a NodeList whose length is + * "5" in the order the children were encountered. + * Access the FOURTH element in the NodeList. The FOURTH + * element, the first or second should be an "em" node with + * the content "EMP0004". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_elementgetelementsbytagnameaccessnodelist : public DOMTestCase +{ + public: + hc_elementgetelementsbytagnameaccessnodelist(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Node firstC; + String childName; + int nodeType; + CharacterData employeeIDNode; + String employeeID; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + testEmployee = (Element) elementList.item(3); + firstC = testEmployee.getFirstChild(); + nodeType = (int) firstC.getNodeType(); + + while (equals(3, nodeType)) { + firstC = firstC.getNextSibling(); + nodeType = (int) firstC.getNodeType(); + + } +childName = firstC.getNodeName(); + assertEquals("em", childName); + employeeIDNode = (CharacterData) firstC.getFirstChild(); + employeeID = employeeIDNode.getNodeValue(); + assertEquals("EMP0004", employeeID); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnameaccessnodelist"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnamenomatch.hpp b/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnamenomatch.hpp new file mode 100644 index 00000000..cebfed2f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnamenomatch.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementgetelementsbytagnamenomatch +#define test_hc_elementgetelementsbytagnamenomatch + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(name)" method returns a list + * of all descendant Elements with the given tag name. + * Create a NodeList of all the descendant elements + * using the string "employee" as the tagName. + * The method should return a NodeList whose length is + * "5". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ + +template +class hc_elementgetelementsbytagnamenomatch : public DOMTestCase +{ + public: + hc_elementgetelementsbytagnamenomatch(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("noMatch")); + assertSize(0, elementList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamenomatch"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnamespecialvalue.hpp b/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnamespecialvalue.hpp new file mode 100644 index 00000000..61b3f0eb --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementgetelementsbytagnamespecialvalue.hpp @@ -0,0 +1,116 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementgetelementsbytagnamespecialvalue +#define test_hc_elementgetelementsbytagnamespecialvalue + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName(name)" method may use the + * special value "*" to match all tags in the element + * tree. + * Create a NodeList of all the descendant elements + * of the last employee by using the special value "*". + * The method should return all the descendant children(6) + * in the order the children were encountered. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ + +template +class hc_elementgetelementsbytagnamespecialvalue : public DOMTestCase +{ + public: + hc_elementgetelementsbytagnamespecialvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element lastEmployee; + NodeList lastempList; + Node child; + String childName; + std::vector result; + + std::vector expectedResult; + expectedResult.push_back(SA::construct_from_utf8("em")); + expectedResult.push_back(SA::construct_from_utf8("strong")); + expectedResult.push_back(SA::construct_from_utf8("code")); + expectedResult.push_back(SA::construct_from_utf8("sup")); + expectedResult.push_back(SA::construct_from_utf8("var")); + expectedResult.push_back(SA::construct_from_utf8("acronym")); + + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + lastEmployee = (Element) elementList.item(4); + lastempList = lastEmployee.getElementsByTagName(SA::construct_from_utf8("*")); + for (int indexN65639 = 0; indexN65639 != lastempList.getLength(); indexN65639++) { + child = (Node) lastempList.item(indexN65639); + childName = child.getNodeName(); + result.push_back(childName); + } + assertEquals(expectedResult, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamespecialvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementgettagname.hpp b/tests/DOM/conformance/level1/core/hc_elementgettagname.hpp new file mode 100644 index 00000000..be50ef1b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementgettagname.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementgettagname +#define test_hc_elementgettagname + +#include "dom_conf_test.hpp" + +/** + * Invoke the "getTagName()" method one the + * root node. The value returned should be "html" or "svg". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class hc_elementgettagname : public DOMTestCase +{ + public: + hc_elementgettagname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element root; + String tagname; + doc = (Document) load("hc_staff", false); + root = doc.getDocumentElement(); + tagname = root.getTagName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", tagname); + } else { + assertEquals("html", tagname); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgettagname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementinuseattributeerr.hpp b/tests/DOM/conformance/level1/core/hc_elementinuseattributeerr.hpp new file mode 100644 index 00000000..0a579391 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementinuseattributeerr.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementinuseattributeerr +#define test_hc_elementinuseattributeerr + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method raises an + * "INUSE_ATTRIBUTE_ERR DOMException if the "newAttr" + * is already an attribute of another element. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=244 +*/ + +template +class hc_elementinuseattributeerr : public DOMTestCase +{ + public: + hc_elementinuseattributeerr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr newAttribute; + NodeList addressElementList; + Element testAddress; + Element newElement; + Attr attrAddress; + Node appendedChild; + Attr setAttr1; + Attr setAttr2; + doc = (Document) load("hc_staff", true); + addressElementList = doc.getElementsByTagName(SA::construct_from_utf8("body")); + testAddress = (Element) addressElementList.item(0); + newElement = doc.createElement(SA::construct_from_utf8("p")); + appendedChild = testAddress.appendChild(newElement); + newAttribute = doc.createAttribute(SA::construct_from_utf8("title")); + setAttr1 = newElement.setAttributeNode(newAttribute); + + { + boolean success = false; + try { + setAttr2 = testAddress.setAttributeNode(newAttribute); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INUSE_ATTRIBUTE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinuseattributeerr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementinvalidcharacterexception.hpp b/tests/DOM/conformance/level1/core/hc_elementinvalidcharacterexception.hpp new file mode 100644 index 00000000..0b3c0571 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementinvalidcharacterexception.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementinvalidcharacterexception +#define test_hc_elementinvalidcharacterexception + +#include "dom_conf_test.hpp" + +/** + * The "setAttribute(name,value)" method raises an + * "INVALID_CHARACTER_ERR DOMException if the specified + * name contains an invalid character. + * Retrieve the last child of the first employee and + * call its "setAttribute(name,value)" method with + * "strong" containing an invalid character. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_elementinvalidcharacterexception : public DOMTestCase +{ + public: + hc_elementinvalidcharacterexception(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddress; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = (Element) elementList.item(0); + + { + boolean success = false; + try { + testAddress.setAttribute(SA::construct_from_utf8("invalid^Name"), SA::construct_from_utf8("value")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinvalidcharacterexception"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementinvalidcharacterexception1.hpp b/tests/DOM/conformance/level1/core/hc_elementinvalidcharacterexception1.hpp new file mode 100644 index 00000000..de12c89d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementinvalidcharacterexception1.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementinvalidcharacterexception1 +#define test_hc_elementinvalidcharacterexception1 + +#include "dom_conf_test.hpp" + +/** + * Calling Element.setAttribute with an empty name will cause an INVALID_CHARACTER_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ + +template +class hc_elementinvalidcharacterexception1 : public DOMTestCase +{ + public: + hc_elementinvalidcharacterexception1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddress; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = (Element) elementList.item(0); + + { + boolean success = false; + try { + testAddress.setAttribute(SA::construct_from_utf8(""), SA::construct_from_utf8("value")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INVALID_CHARACTER_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinvalidcharacterexception1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementnormalize.hpp b/tests/DOM/conformance/level1/core/hc_elementnormalize.hpp new file mode 100644 index 00000000..2bcea71a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementnormalize.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementnormalize +#define test_hc_elementnormalize + +#include "dom_conf_test.hpp" + +/** + * Append a couple of text nodes to the first sup element, normalize the + * document element and check that the element has been normalized. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=546 +*/ + +template +class hc_elementnormalize : public DOMTestCase +{ + public: + hc_elementnormalize(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element root; + NodeList elementList; + Element testName; + Node firstChild; + String childValue; + Text textNode; + Node retNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("sup")); + testName = (Element) elementList.item(0); + textNode = doc.createTextNode(SA::construct_from_utf8("")); + retNode = testName.appendChild(textNode); + textNode = doc.createTextNode(SA::construct_from_utf8(",000")); + retNode = testName.appendChild(textNode); + root = doc.getDocumentElement(); + root.normalize(); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("sup")); + testName = (Element) elementList.item(0); + firstChild = testName.getFirstChild(); + childValue = firstChild.getNodeValue(); + assertEquals("56,000,000", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementnormalize2.hpp b/tests/DOM/conformance/level1/core/hc_elementnormalize2.hpp new file mode 100644 index 00000000..8c7c4b88 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementnormalize2.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementnormalize2 +#define test_hc_elementnormalize2 + +#include "dom_conf_test.hpp" + +/** + * Add an empty text node to an existing attribute node, normalize the containing element + * and check that the attribute node has eliminated the empty text. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=482 +*/ + +template +class hc_elementnormalize2 : public DOMTestCase +{ + public: + hc_elementnormalize2(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element root; + NodeList elementList; + Element element; + Node firstChild; + Node secondChild; + String childValue; + Text emptyText; + Attr attrNode; + Node retval; + doc = (Document) load("hc_staff", true); + root = doc.getDocumentElement(); + emptyText = doc.createTextNode(SA::construct_from_utf8("")); + elementList = root.getElementsByTagName(SA::construct_from_utf8("acronym")); + element = (Element) elementList.item(0); + attrNode = element.getAttributeNode(SA::construct_from_utf8("title")); + retval = attrNode.appendChild(emptyText); + element.normalize(); + attrNode = element.getAttributeNode(SA::construct_from_utf8("title")); + firstChild = attrNode.getFirstChild(); + childValue = firstChild.getNodeValue(); + assertEquals("Yes", childValue); + secondChild = firstChild.getNextSibling(); + assertNull(secondChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize2"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementnotfounderr.hpp b/tests/DOM/conformance/level1/core/hc_elementnotfounderr.hpp new file mode 100644 index 00000000..a7f593a2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementnotfounderr.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementnotfounderr +#define test_hc_elementnotfounderr + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method raises a + * NOT_FOUND_ERR DOMException if the "oldAttr" attribute + * is not an attribute of the element. + * + * Retrieve the last employee and attempt to remove + * a non existing attribute node. This should cause the + * intended exception to be raised. This test makes use + * of the "createAttribute(name)" method from the Document + * interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_elementnotfounderr : public DOMTestCase +{ + public: + hc_elementnotfounderr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Attr oldAttribute; + NodeList addressElementList; + Element testAddress; + Attr attrAddress; + doc = (Document) load("hc_staff", true); + addressElementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = (Element) addressElementList.item(4); + oldAttribute = doc.createAttribute(SA::construct_from_utf8("title")); + + { + boolean success = false; + try { + attrAddress = testAddress.removeAttributeNode(oldAttribute); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnotfounderr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementremoveattribute.hpp b/tests/DOM/conformance/level1/core/hc_elementremoveattribute.hpp new file mode 100644 index 00000000..fb362f0b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementremoveattribute.hpp @@ -0,0 +1,98 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementremoveattribute +#define test_hc_elementremoveattribute + +#include "dom_conf_test.hpp" + +/** + * The "removeAttribute(name)" removes an attribute by name. + * If the attribute has a default value, it is immediately + * replaced. However, there is no default values in the HTML + * compatible tests, so its value is "". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class hc_elementremoveattribute : public DOMTestCase +{ + public: + hc_elementremoveattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + String attrValue; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(3); + testEmployee.removeAttribute(SA::construct_from_utf8("class")); + attrValue = testEmployee.getAttribute(SA::construct_from_utf8("class")); + assertEquals("", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementremoveattributeaftercreate.hpp b/tests/DOM/conformance/level1/core/hc_elementremoveattributeaftercreate.hpp new file mode 100644 index 00000000..1506b659 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementremoveattributeaftercreate.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementremoveattributeaftercreate +#define test_hc_elementremoveattributeaftercreate + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method removes the + * specified attribute. + * + * Retrieve the last child of the third employee, add a + * new "lang" attribute to it and then try to remove it. + * To verify that the node was removed use the + * "getNamedItem(name)" method from the NamedNodeMap + * interface. It also uses the "getAttributes()" method + * from the Node interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_elementremoveattributeaftercreate : public DOMTestCase +{ + public: + hc_elementremoveattributeaftercreate(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr newAttribute; + NamedNodeMap attributes; + Attr districtAttr; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("lang")); + districtAttr = testEmployee.setAttributeNode(newAttribute); + districtAttr = testEmployee.removeAttributeNode(newAttribute); + attributes = testEmployee.getAttributes(); + districtAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("lang")); + assertNull(districtAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattributeaftercreate"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementremoveattributenode.hpp b/tests/DOM/conformance/level1/core/hc_elementremoveattributenode.hpp new file mode 100644 index 00000000..2bb5272e --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementremoveattributenode.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementremoveattributenode +#define test_hc_elementremoveattributenode + +#include "dom_conf_test.hpp" + +/** + * The "removeAttributeNode(oldAttr)" method returns the + * node that was removed. + * + * Retrieve the last child of the third employee and + * remove its "class" Attr node. The method should + * return the old attribute node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +*/ + +template +class hc_elementremoveattributenode : public DOMTestCase +{ + public: + hc_elementremoveattributenode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr streetAttr; + Attr removedAttr; + String removedValue; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(2); + streetAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("class")); + removedAttr = testEmployee.removeAttributeNode(streetAttr); + assertNotNull(removedAttr); + removedValue = removedAttr.getValue(); + assertEquals("No", removedValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattributenode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementreplaceattributewithself.hpp b/tests/DOM/conformance/level1/core/hc_elementreplaceattributewithself.hpp new file mode 100644 index 00000000..54f9b0ee --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementreplaceattributewithself.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementreplaceattributewithself +#define test_hc_elementreplaceattributewithself + +#include "dom_conf_test.hpp" + +/** + * This test calls setAttributeNode to replace an attribute with itself. + * Since the node is not an attribute of another Element, it would + * be inappropriate to throw an INUSE_ATTRIBUTE_ERR. + * This test was derived from elementinuserattributeerr which + * inadvertanly made this test. +* @author Curt Arnold +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ + +template +class hc_elementreplaceattributewithself : public DOMTestCase +{ + public: + hc_elementreplaceattributewithself(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr streetAttr; + Attr replacedAttr; + String value; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(2); + streetAttr = testEmployee.getAttributeNode(SA::construct_from_utf8("class")); + replacedAttr = testEmployee.setAttributeNode(streetAttr); + assertSame(streetAttr, replacedAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceattributewithself"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementreplaceexistingattribute.hpp b/tests/DOM/conformance/level1/core/hc_elementreplaceexistingattribute.hpp new file mode 100644 index 00000000..bada24f4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementreplaceexistingattribute.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementreplaceexistingattribute +#define test_hc_elementreplaceexistingattribute + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method adds a new + * attribute to the Element. If the "newAttr" Attr node is + * already present in this element, it should replace the + * existing one. + * + * Retrieve the last child of the third employee and add a + * new attribute node by invoking the "setAttributeNode(new + * Attr)" method. The new attribute node to be added is + * "class", which is already present in this element. The + * method should replace the existing Attr node with the + * new one. This test uses the "createAttribute(name)" + * method from the Document interface. +* @author Curt Arnold +*/ + +template +class hc_elementreplaceexistingattribute : public DOMTestCase +{ + public: + hc_elementreplaceexistingattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr newAttribute; + String strong; + Attr setAttr; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("class")); + setAttr = testEmployee.setAttributeNode(newAttribute); + strong = testEmployee.getAttribute(SA::construct_from_utf8("class")); + assertEquals("", strong); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceexistingattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementreplaceexistingattributegevalue.hpp b/tests/DOM/conformance/level1/core/hc_elementreplaceexistingattributegevalue.hpp new file mode 100644 index 00000000..661c2d2e --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementreplaceexistingattributegevalue.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementreplaceexistingattributegevalue +#define test_hc_elementreplaceexistingattributegevalue + +#include "dom_conf_test.hpp" + +/** + * If the "setAttributeNode(newAttr)" method replaces an + * existing Attr node with the same name, then it should + * return the previously existing Attr node. + * Retrieve the last child of the third employee and add a + * new attribute node. The new attribute node is "class", + * which is already present in this Element. The method + * should return the existing Attr node(old "class" Attr). + * This test uses the "createAttribute(name)" method + * from the Document interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ + +template +class hc_elementreplaceexistingattributegevalue : public DOMTestCase +{ + public: + hc_elementreplaceexistingattributegevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr newAttribute; + Attr streetAttr; + String value; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("class")); + streetAttr = testEmployee.setAttributeNode(newAttribute); + assertNotNull(streetAttr); + value = streetAttr.getValue(); + assertEquals("No", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceexistingattributegevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementretrieveallattributes.hpp b/tests/DOM/conformance/level1/core/hc_elementretrieveallattributes.hpp new file mode 100644 index 00000000..adfa5c26 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementretrieveallattributes.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementretrieveallattributes +#define test_hc_elementretrieveallattributes + +#include "dom_conf_test.hpp" + +/** + * Create a list of all the attributes of the last child + * of the first "p" element by using the "getAttributes()" + * method. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ + +template +class hc_elementretrieveallattributes : public DOMTestCase +{ + public: + hc_elementretrieveallattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList addressList; + Node testAddress; + NamedNodeMap attributes; + Attr attribute; + String attributeName; + std::vector actual; + + std::vector htmlExpected; + htmlExpected.push_back(SA::construct_from_utf8("title")); + + std::vector expected; + expected.push_back(SA::construct_from_utf8("title")); + expected.push_back(SA::construct_from_utf8("dir")); + + doc = (Document) load("hc_staff", false); + addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = addressList.item(0); + attributes = testAddress.getAttributes(); + for (int indexN65643 = 0; indexN65643 != attributes.getLength(); indexN65643++) { + attribute = (Attr) attributes.item(indexN65643); + attributeName = attribute.getNodeName(); + actual.push_back(attributeName); + } + + if (("text/html" == getContentType())) { + assertEquals(htmlExpected, actual); + } else { + assertEquals(expected, actual); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrieveallattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementretrieveattrvalue.hpp b/tests/DOM/conformance/level1/core/hc_elementretrieveattrvalue.hpp new file mode 100644 index 00000000..36a3fb03 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementretrieveattrvalue.hpp @@ -0,0 +1,98 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementretrieveattrvalue +#define test_hc_elementretrieveattrvalue + +#include "dom_conf_test.hpp" + +/** + * The "getAttribute(name)" method returns an attribute + * value by name. + * + * Retrieve the second address element, then + * invoke the 'getAttribute("class")' method. This should + * return the value of the attribute("No"). +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9 +*/ + +template +class hc_elementretrieveattrvalue : public DOMTestCase +{ + public: + hc_elementretrieveattrvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddress; + String attrValue; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = (Element) elementList.item(2); + attrValue = testAddress.getAttribute(SA::construct_from_utf8("class")); + assertEquals("No", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrieveattrvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementretrievetagname.hpp b/tests/DOM/conformance/level1/core/hc_elementretrievetagname.hpp new file mode 100644 index 00000000..fd73c187 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementretrievetagname.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementretrievetagname +#define test_hc_elementretrievetagname + +#include "dom_conf_test.hpp" + +/** + * The "getElementsByTagName()" method returns a NodeList + * of all descendant elements with a given tagName. + * + * Invoke the "getElementsByTagName()" method and create + * a NodeList of "code" elements. Retrieve the second + * "code" element in the list and return the NodeName. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815 +*/ + +template +class hc_elementretrievetagname : public DOMTestCase +{ + public: + hc_elementretrievetagname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + String strong; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("code")); + testEmployee = elementList.item(1); + strong = testEmployee.getNodeName(); + assertEquals("code", strong); + strong = ((Element) /*Node */testEmployee).getTagName(); + assertEquals("code", strong); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrievetagname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementsetattributenodenull.hpp b/tests/DOM/conformance/level1/core/hc_elementsetattributenodenull.hpp new file mode 100644 index 00000000..b3635919 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementsetattributenodenull.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementsetattributenodenull +#define test_hc_elementsetattributenodenull + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method returns the + * null value if no previously existing Attr node with the + * same name was replaced. + * + * Retrieve the last child of the third employee and add a + * new attribute to it. The new attribute node added is + * "lang", which is not part of this Element. The + * method should return the null value. + * This test uses the "createAttribute(name)" + * method from the Document interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_elementsetattributenodenull : public DOMTestCase +{ + public: + hc_elementsetattributenodenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + Attr newAttribute; + Attr districtAttr; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("lang")); + districtAttr = testEmployee.setAttributeNode(newAttribute); + assertNull(districtAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementsetattributenodenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_elementwrongdocumenterr.hpp b/tests/DOM/conformance/level1/core/hc_elementwrongdocumenterr.hpp new file mode 100644 index 00000000..78a11bdf --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_elementwrongdocumenterr.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_elementwrongdocumenterr +#define test_hc_elementwrongdocumenterr + +#include "dom_conf_test.hpp" + +/** + * The "setAttributeNode(newAttr)" method raises an + * "WRONG_DOCUMENT_ERR DOMException if the "newAttr" + * was created from a different document than the one that + * created this document. + * Retrieve the last employee and attempt to set a new + * attribute node for its "employee" element. The new + * attribute was created from a document other than the + * one that created this element, therefore a + * WRONG_DOCUMENT_ERR DOMException should be raised. + * This test uses the "createAttribute(newAttr)" method + * from the Document interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_elementwrongdocumenterr : public DOMTestCase +{ + public: + hc_elementwrongdocumenterr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + Attr newAttribute; + NodeList addressElementList; + Element testAddress; + Attr attrAddress; + doc1 = (Document) load("hc_staff", true); + doc2 = (Document) load("hc_staff", false); + newAttribute = doc2.createAttribute(SA::construct_from_utf8("newAttribute")); + addressElementList = doc1.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = (Element) addressElementList.item(4); + + { + boolean success = false; + try { + attrAddress = testAddress.setAttributeNode(newAttribute); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementwrongdocumenterr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_entitiesremovenameditem1.hpp b/tests/DOM/conformance/level1/core/hc_entitiesremovenameditem1.hpp new file mode 100644 index 00000000..53ee5dd7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_entitiesremovenameditem1.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_entitiesremovenameditem1 +#define test_hc_entitiesremovenameditem1 + +#include "dom_conf_test.hpp" + +/** + * An attempt to add remove an entity should result in a NO_MODIFICATION_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +*/ + +template +class hc_entitiesremovenameditem1 : public DOMTestCase +{ + public: + hc_entitiesremovenameditem1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NamedNodeMap entities; + DocumentType docType; + Node retval; + doc = (Document) load("hc_staff", true); + docType = doc.getDoctype(); + + if ( + !(("text/html" == getContentType())) +) { + assertNotNull(docType); + entities = docType.getEntities(); + assertNotNull(entities); + + { + boolean success = false; + try { + retval = entities.removeNamedItem(SA::construct_from_utf8("alpha")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } +} + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiesremovenameditem1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_entitiessetnameditem1.hpp b/tests/DOM/conformance/level1/core/hc_entitiessetnameditem1.hpp new file mode 100644 index 00000000..8330fa60 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_entitiessetnameditem1.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_entitiessetnameditem1 +#define test_hc_entitiessetnameditem1 + +#include "dom_conf_test.hpp" + +/** + * An attempt to add an element to the named node map returned by entities should + * result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +*/ + +template +class hc_entitiessetnameditem1 : public DOMTestCase +{ + public: + hc_entitiessetnameditem1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NamedNodeMap entities; + DocumentType docType; + Node retval; + Element elem; + doc = (Document) load("hc_staff", true); + docType = doc.getDoctype(); + + if ( + !(("text/html" == getContentType())) +) { + assertNotNull(docType); + entities = docType.getEntities(); + assertNotNull(entities); + elem = doc.createElement(SA::construct_from_utf8("br")); + + try { + retval = entities.setNamedItem(elem); + fail("throw_HIER_OR_NO_MOD_ERR"); + + } catch (DOMException ex) { + switch (ex.code()) { + case 3 : + break; + case 7 : + break; + default: + throw ex; + } + } +} + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiessetnameditem1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapchildnoderange.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapchildnoderange.hpp new file mode 100644 index 00000000..9221468f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapchildnoderange.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapchildnoderange +#define test_hc_namednodemapchildnoderange + +#include "dom_conf_test.hpp" + +/** + * Create a NamedNodeMap object from the attributes of the + * last child of the third "p" element and traverse the + * list from index 0 thru length -1. All indices should + * be valid. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=250 +*/ + +template +class hc_namednodemapchildnoderange : public DOMTestCase +{ + public: + hc_namednodemapchildnoderange(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Node child; + String strong; + int length; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = elementList.item(2); + attributes = testEmployee.getAttributes(); + length = (int) attributes.getLength(); + + if (("text/html" == getContentType())) { + assertEquals(2, length); + } else { + assertEquals(3, length); + child = attributes.item(2); + assertNotNull(child); + } + + child = attributes.item(0); + assertNotNull(child); + child = attributes.item(1); + assertNotNull(child); + child = attributes.item(3); + assertNull(child); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapchildnoderange"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapgetnameditem.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapgetnameditem.hpp new file mode 100644 index 00000000..ea815544 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapgetnameditem.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapgetnameditem +#define test_hc_namednodemapgetnameditem + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second "p" element and create a NamedNodeMap + * listing of the attributes of the last child. Once the + * list is created an invocation of the "getNamedItem(name)" + * method is done with name="title". This should result + * in the title Attr node being returned. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +*/ + +template +class hc_namednodemapgetnameditem : public DOMTestCase +{ + public: + hc_namednodemapgetnameditem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Attr domesticAttr; + String attrName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title")); + attrName = domesticAttr.getNodeName(); + assertEquals("title", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapgetnameditem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapinuseattributeerr.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapinuseattributeerr.hpp new file mode 100644 index 00000000..f6b923a8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapinuseattributeerr.hpp @@ -0,0 +1,120 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapinuseattributeerr +#define test_hc_namednodemapinuseattributeerr + +#include "dom_conf_test.hpp" + +/** + * The "setNamedItem(arg)" method raises a + * INUSE_ATTRIBUTE_ERR DOMException if "arg" is an + * Attr that is already in an attribute of another Element. + * Create a NamedNodeMap object from the attributes of the + * last child of the third employee and attempt to add + * an attribute that is already being used by the first + * employee. This should raise the desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_namednodemapinuseattributeerr : public DOMTestCase +{ + public: + hc_namednodemapinuseattributeerr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element firstNode; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + Attr setAttr; + Node setNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + firstNode = (Element) elementList.item(0); + domesticAttr = doc.createAttribute(SA::construct_from_utf8("title")); + domesticAttr.setValue(SA::construct_from_utf8("Yα")); + setAttr = firstNode.setAttributeNode(domesticAttr); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testNode = elementList.item(2); + attributes = testNode.getAttributes(); + + { + boolean success = false; + try { + setNode = attributes.setNamedItem(domesticAttr); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INUSE_ATTRIBUTE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapinuseattributeerr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapnotfounderr.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapnotfounderr.hpp new file mode 100644 index 00000000..1402a182 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapnotfounderr.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapnotfounderr +#define test_hc_namednodemapnotfounderr + +#include "dom_conf_test.hpp" + +/** + * The "removeNamedItem(name)" method raises a + * NOT_FOUND_ERR DOMException if there is not a node + * named "strong" in the map. + * + * Create a NamedNodeMap object from the attributes of the + * last child of the third employee and attempt to remove + * the "lang" attribute. There is not a node named + * "lang" in the list and therefore the desired + * exception should be raised. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D58B193')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_namednodemapnotfounderr : public DOMTestCase +{ + public: + hc_namednodemapnotfounderr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + NamedNodeMap attributes; + Node removedNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = (Element) elementList.item(2); + attributes = testEmployee.getAttributes(); + + { + boolean success = false; + try { + removedNode = attributes.removeNamedItem(SA::construct_from_utf8("lang")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapnotfounderr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapnumberofnodes.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapnumberofnodes.hpp new file mode 100644 index 00000000..5a4eb7f5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapnumberofnodes.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapnumberofnodes +#define test_hc_namednodemapnumberofnodes + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second "p" element and evaluate Node.attributes.length. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=250 +*/ + +template +class hc_namednodemapnumberofnodes : public DOMTestCase +{ + public: + hc_namednodemapnumberofnodes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + int length; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = elementList.item(2); + attributes = testEmployee.getAttributes(); + length = (int) attributes.getLength(); + + if (("text/html" == getContentType())) { + assertEquals(2, length); + } else { + assertEquals(3, length); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapnumberofnodes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapremovenameditem.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapremovenameditem.hpp new file mode 100644 index 00000000..aacfff51 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapremovenameditem.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapremovenameditem +#define test_hc_namednodemapremovenameditem + +#include "dom_conf_test.hpp" + +/** + * The "removeNamedItem(name)" method removes a node + * specified by name. + * + * Retrieve the third employee and create a NamedNodeMap + * object of the attributes of the last child. Once the + * list is created invoke the "removeNamedItem(name)" + * method with name="class". This should result + * in the removal of the specified attribute. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class hc_namednodemapremovenameditem : public DOMTestCase +{ + public: + hc_namednodemapremovenameditem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Attr streetAttr; + Node removedNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = elementList.item(2); + attributes = testAddress.getAttributes(); + removedNode = attributes.removeNamedItem(SA::construct_from_utf8("class")); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); + assertNull(streetAttr); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapremovenameditem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapreturnattrnode.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapreturnattrnode.hpp new file mode 100644 index 00000000..90b56f02 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapreturnattrnode.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapreturnattrnode +#define test_hc_namednodemapreturnattrnode + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second p element and create a NamedNodeMap + * listing of the attributes of the last child. Once the + * list is created an invocation of the "getNamedItem(name)" + * method is done with name="class". This should result + * in the method returning an Attr node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +*/ + +template +class hc_namednodemapreturnattrnode : public DOMTestCase +{ + public: + hc_namednodemapreturnattrnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Node streetAttr; + String attrName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + streetAttr = attributes.getNamedItem(SA::construct_from_utf8("class")); + static_cast(streetAttr); // this will throw if the type is wrong +attrName = streetAttr.getNodeName(); + assertEquals("class", attrName); + attrName = ((Attr) /*Node */streetAttr).getName(); + assertEquals("class", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnattrnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapreturnfirstitem.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapreturnfirstitem.hpp new file mode 100644 index 00000000..3690563e --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapreturnfirstitem.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapreturnfirstitem +#define test_hc_namednodemapreturnfirstitem + +#include "dom_conf_test.hpp" + +/** + * The "item(index)" method returns the indexth item in + * the map(test for first item). + * + * Retrieve the second "acronym" get the NamedNodeMap of the attributes. Since the + * DOM does not specify an order of these nodes the contents + * of the FIRST node can contain either "title", "class" or "dir". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ + +template +class hc_namednodemapreturnfirstitem : public DOMTestCase +{ + public: + hc_namednodemapreturnfirstitem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testAddress; + NamedNodeMap attributes; + Node child; + String nodeName; + std::vector htmlExpected; + htmlExpected.push_back(SA::construct_from_utf8("title")); + htmlExpected.push_back(SA::construct_from_utf8("class")); + + std::vector expected; + expected.push_back(SA::construct_from_utf8("title")); + expected.push_back(SA::construct_from_utf8("class")); + expected.push_back(SA::construct_from_utf8("dir")); + + std::vector actual; + + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = elementList.item(1); + attributes = testAddress.getAttributes(); + for (int indexN65648 = 0; indexN65648 != attributes.getLength(); indexN65648++) { + child = (Node) attributes.item(indexN65648); + nodeName = child.getNodeName(); + actual.push_back(nodeName); + } + + if (("text/html" == getContentType())) { + assertEquals(htmlExpected, actual); + } else { + assertEquals(expected, actual); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnfirstitem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapreturnlastitem.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapreturnlastitem.hpp new file mode 100644 index 00000000..6152f989 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapreturnlastitem.hpp @@ -0,0 +1,127 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapreturnlastitem +#define test_hc_namednodemapreturnlastitem + +#include "dom_conf_test.hpp" + +/** + * The "item(index)" method returns the indexth item in + * the map(test for last item). + * + * Retrieve the second "acronym" and get the attribute name. Since the + * DOM does not specify an order of these nodes the contents + * of the LAST node can contain either "title" or "class". + * The test should return "true" if the LAST node is either + * of these values. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ + +template +class hc_namednodemapreturnlastitem : public DOMTestCase +{ + public: + hc_namednodemapreturnlastitem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Node child; + String nodeName; + std::vector htmlExpected; + htmlExpected.push_back(SA::construct_from_utf8("title")); + htmlExpected.push_back(SA::construct_from_utf8("class")); + + std::vector expected; + expected.push_back(SA::construct_from_utf8("title")); + expected.push_back(SA::construct_from_utf8("class")); + expected.push_back(SA::construct_from_utf8("dir")); + + std::vector actual; + + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + for (int indexN65648 = 0; indexN65648 != attributes.getLength(); indexN65648++) { + child = (Node) attributes.item(indexN65648); + nodeName = child.getNodeName(); + actual.push_back(nodeName); + } + + if (("text/html" == getContentType())) { + assertEquals(htmlExpected, actual); + } else { + assertEquals(expected, actual); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnlastitem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapreturnnull.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapreturnnull.hpp new file mode 100644 index 00000000..8645126c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapreturnnull.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapreturnnull +#define test_hc_namednodemapreturnnull + +#include "dom_conf_test.hpp" + +/** + * The "getNamedItem(name)" method returns null of the + * specified name did not identify any node in the map. + * + * Retrieve the second employee and create a NamedNodeMap + * listing of the attributes of the last child. Once the + * list is created an invocation of the "getNamedItem(name)" + * method is done with name="lang". This name does not + * match any names in the list therefore the method should + * return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_namednodemapreturnnull : public DOMTestCase +{ + public: + hc_namednodemapreturnnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Attr districtNode; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + districtNode = (Attr) attributes.getNamedItem(SA::construct_from_utf8("lang")); + assertNull(districtNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditem.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditem.hpp new file mode 100644 index 00000000..ea4ef7ac --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditem.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapsetnameditem +#define test_hc_namednodemapsetnameditem + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second "p" element and create a NamedNodeMap + * object from the attributes of the last child by + * invoking the "getAttributes()" method. Once the + * list is created an invocation of the "setNamedItem(arg)" + * method is done with arg=newAttr, where newAttr is a + * new Attr Node previously created. The "setNamedItem(arg)" + * method should add then new node to the NamedNodeItem + * object by using its "nodeName" attribute("lang'). + * This node is then retrieved using the "getNamedItem(name)" + * method. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_namednodemapsetnameditem : public DOMTestCase +{ + public: + hc_namednodemapsetnameditem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Attr districtNode; + String attrName; + Node setNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = elementList.item(1); + newAttribute = doc.createAttribute(SA::construct_from_utf8("lang")); + attributes = testAddress.getAttributes(); + setNode = attributes.setNamedItem(newAttribute); + districtNode = (Attr) attributes.getNamedItem(SA::construct_from_utf8("lang")); + attrName = districtNode.getNodeName(); + assertEquals("lang", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemreturnvalue.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemreturnvalue.hpp new file mode 100644 index 00000000..f34a75f5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemreturnvalue.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapsetnameditemreturnvalue +#define test_hc_namednodemapsetnameditemreturnvalue + +#include "dom_conf_test.hpp" + +/** + * If the "setNamedItem(arg)" method replaces an already + * existing node with the same name then the already + * existing node is returned. + * + * Retrieve the third employee and create a NamedNodeMap + * object from the attributes of the last child by + * invoking the "getAttributes()" method. Once the + * list is created an invocation of the "setNamedItem(arg)" + * method is done with arg=newAttr, where newAttr is a + * new Attr Node previously created and whose node name + * already exists in the map. The "setNamedItem(arg)" + * method should replace the already existing node with + * the new one and return the existing node. + * This test uses the "createAttribute(name)" method from + * the document interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class hc_namednodemapsetnameditemreturnvalue : public DOMTestCase +{ + public: + hc_namednodemapsetnameditemreturnvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Node newNode; + String attrValue; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("class")); + attributes = testAddress.getAttributes(); + newNode = attributes.setNamedItem(newAttribute); + assertNotNull(newNode); + attrValue = newNode.getNodeValue(); + assertEquals("No", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemreturnvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemthatexists.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemthatexists.hpp new file mode 100644 index 00000000..54082306 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemthatexists.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapsetnameditemthatexists +#define test_hc_namednodemapsetnameditemthatexists + +#include "dom_conf_test.hpp" + +/** + * If the node to be added by the "setNamedItem(arg)" method + * already exists in the NamedNodeMap, it is replaced by + * the new one. + * + * Retrieve the second employee and create a NamedNodeMap + * object from the attributes of the last child by + * invoking the "getAttributes()" method. Once the + * list is created an invocation of the "setNamedItem(arg)" + * method is done with arg=newAttr, where newAttr is a + * new Attr Node previously created and whose node name + * already exists in the map. The "setNamedItem(arg)" + * method should replace the already existing node with + * the new one. + * This node is then retrieved using the "getNamedItem(name)" + * method. This test uses the "createAttribute(name)" + * method from the document interface +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class hc_namednodemapsetnameditemthatexists : public DOMTestCase +{ + public: + hc_namednodemapsetnameditemthatexists(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Attr districtNode; + String attrValue; + Node setNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = elementList.item(1); + newAttribute = doc.createAttribute(SA::construct_from_utf8("class")); + attributes = testAddress.getAttributes(); + setNode = attributes.setNamedItem(newAttribute); + districtNode = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); + attrValue = districtNode.getNodeValue(); + assertEquals("", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemthatexists"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemwithnewvalue.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemwithnewvalue.hpp new file mode 100644 index 00000000..78d52fee --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapsetnameditemwithnewvalue.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapsetnameditemwithnewvalue +#define test_hc_namednodemapsetnameditemwithnewvalue + +#include "dom_conf_test.hpp" + +/** + * If the "setNamedItem(arg)" method does not replace an + * existing node with the same name then it returns null. + * + * Retrieve the third employee and create a NamedNodeMap + * object from the attributes of the last child. + * Once the list is created the "setNamedItem(arg)" method + * is invoked with arg=newAttr, where newAttr is a + * newly created Attr Node and whose node name + * already exists in the map. The "setNamedItem(arg)" + * method should add the new node and return null. + * This test uses the "createAttribute(name)" method from + * the document interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ + +template +class hc_namednodemapsetnameditemwithnewvalue : public DOMTestCase +{ + public: + hc_namednodemapsetnameditemwithnewvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Node newNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("lang")); + attributes = testAddress.getAttributes(); + newNode = attributes.setNamedItem(newAttribute); + assertNull(newNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemwithnewvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_namednodemapwrongdocumenterr.hpp b/tests/DOM/conformance/level1/core/hc_namednodemapwrongdocumenterr.hpp new file mode 100644 index 00000000..025f9b41 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_namednodemapwrongdocumenterr.hpp @@ -0,0 +1,122 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_namednodemapwrongdocumenterr +#define test_hc_namednodemapwrongdocumenterr + +#include "dom_conf_test.hpp" + +/** + * The "setNamedItem(arg)" method raises a + * WRONG_DOCUMENT_ERR DOMException if "arg" was created + * from a different document than the one that created + * the NamedNodeMap. + * + * Create a NamedNodeMap object from the attributes of the + * last child of the third employee and attempt to add + * another Attr node to it that was created from a + * different DOM document. This should raise the desired + * exception. This method uses the "createAttribute(name)" + * method from the Document interface. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_namednodemapwrongdocumenterr : public DOMTestCase +{ + public: + hc_namednodemapwrongdocumenterr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + NodeList elementList; + Node testAddress; + NamedNodeMap attributes; + Node newAttribute; + String strong; + Node setNode; + doc1 = (Document) load("hc_staff", true); + doc2 = (Document) load("hc_staff", true); + elementList = doc1.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddress = elementList.item(2); + newAttribute = doc2.createAttribute(SA::construct_from_utf8("newAttribute")); + attributes = testAddress.getAttributes(); + + { + boolean success = false; + try { + setNode = attributes.setNamedItem(newAttribute); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapwrongdocumenterr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeappendchild.hpp b/tests/DOM/conformance/level1/core/hc_nodeappendchild.hpp new file mode 100644 index 00000000..8315ee09 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeappendchild.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeappendchild +#define test_hc_nodeappendchild + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second "p" and append a "br" Element + * node to the list of children. The last node in the list + * is then retrieved and its NodeName examined. The + * "getNodeName()" method should return "br". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeappendchild : public DOMTestCase +{ + public: + hc_nodeappendchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node createdNode; + Node lchild; + String childName; + Node appendedChild; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + createdNode = doc.createElement(SA::construct_from_utf8("br")); + appendedChild = employeeNode.appendChild(createdNode); + lchild = employeeNode.getLastChild(); + childName = lchild.getNodeName(); + assertEquals("br", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeappendchildchildexists.hpp b/tests/DOM/conformance/level1/core/hc_nodeappendchildchildexists.hpp new file mode 100644 index 00000000..a6070882 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeappendchildchildexists.hpp @@ -0,0 +1,136 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeappendchildchildexists +#define test_hc_nodeappendchildchildexists + +#include "dom_conf_test.hpp" + +/** + * If the "newChild" is already in the tree, it is first + * removed before the new one is appended. + * + * Retrieve the "em" second employee and + * append the first child to the end of the list. After + * the "appendChild(newChild)" method is invoked the first + * child should be the one that was second and the last + * child should be the one that was first. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodeappendchildchildexists : public DOMTestCase +{ + public: + hc_nodeappendchildchildexists(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + NodeList childList; + Node childNode; + Node newChild; + Node memberNode; + String memberName; + std::vector refreshedActual; + + std::vector actual; + + int nodeType; + std::vector expected; + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("acronym")); + expected.push_back(SA::construct_from_utf8("em")); + + Node appendedChild; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + childNode = elementList.item(1); + childList = ((Element) /*Node */childNode).getElementsByTagName(SA::construct_from_utf8("*")); + newChild = childList.item(0); + appendedChild = childNode.appendChild(newChild); + for (int indexN65669 = 0; indexN65669 != childList.getLength(); indexN65669++) { + memberNode = (Node) childList.item(indexN65669); + memberName = memberNode.getNodeName(); + actual.push_back(memberName); + } + assertEquals(expected, actual); + childList = childNode.getChildNodes(); + for (int indexN65692 = 0; indexN65692 != childList.getLength(); indexN65692++) { + memberNode = (Node) childList.item(indexN65692); + nodeType = (int) memberNode.getNodeType(); + + if (equals(1, nodeType)) { + memberName = memberNode.getNodeName(); + refreshedActual.push_back(memberName); + } + } + assertEquals(expected, refreshedActual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildchildexists"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeappendchilddocfragment.hpp b/tests/DOM/conformance/level1/core/hc_nodeappendchilddocfragment.hpp new file mode 100644 index 00000000..afb196f1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeappendchilddocfragment.hpp @@ -0,0 +1,136 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeappendchilddocfragment +#define test_hc_nodeappendchilddocfragment + +#include "dom_conf_test.hpp" + +/** + * If the "newChild" is a DocumentFragment object then + * all its content is added to the child list of this node. + * + * Create and populate a new DocumentFragment object and + * append it to the second employee. After the + * "appendChild(newChild)" method is invoked retrieve the + * new nodes at the end of the list, they should be the + * two Element nodes from the DocumentFragment. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeappendchilddocfragment : public DOMTestCase +{ + public: + hc_nodeappendchilddocfragment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + DocumentFragment newdocFragment; + Node newChild1; + Node newChild2; + Node child; + String childName; + std::vector result; + + Node appendedChild; + int nodeType; + std::vector expected; + expected.push_back(SA::construct_from_utf8("em")); + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("acronym")); + expected.push_back(SA::construct_from_utf8("br")); + expected.push_back(SA::construct_from_utf8("b")); + + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + newdocFragment = doc.createDocumentFragment(); + newChild1 = doc.createElement(SA::construct_from_utf8("br")); + newChild2 = doc.createElement(SA::construct_from_utf8("b")); + appendedChild = newdocFragment.appendChild(newChild1); + appendedChild = newdocFragment.appendChild(newChild2); + appendedChild = employeeNode.appendChild(newdocFragment); + for (int indexN65698 = 0; indexN65698 != childList.getLength(); indexN65698++) { + child = (Node) childList.item(indexN65698); + nodeType = (int) child.getNodeType(); + + if (equals(1, nodeType)) { + childName = child.getNodeName(); + result.push_back(childName); + } + } + assertEquals(expected, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchilddocfragment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeappendchildgetnodename.hpp b/tests/DOM/conformance/level1/core/hc_nodeappendchildgetnodename.hpp new file mode 100644 index 00000000..ff0c1d35 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeappendchildgetnodename.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeappendchildgetnodename +#define test_hc_nodeappendchildgetnodename + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method returns the node + * added. + * + * Append a newly created node to the child list of the + * second employee and check the NodeName returned. The + * "getNodeName()" method should return "br". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeappendchildgetnodename : public DOMTestCase +{ + public: + hc_nodeappendchildgetnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node newChild; + Node appendNode; + String childName; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + newChild = doc.createElement(SA::construct_from_utf8("br")); + appendNode = employeeNode.appendChild(newChild); + childName = appendNode.getNodeName(); + assertEquals("br", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildgetnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeappendchildinvalidnodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodeappendchildinvalidnodetype.hpp new file mode 100644 index 00000000..1c1f611d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeappendchildinvalidnodetype.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeappendchildinvalidnodetype +#define test_hc_nodeappendchildinvalidnodetype + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if this node is of + * a type that does not allow children of the type "newChild" + * to be inserted. + * + * Retrieve the root node and attempt to append a newly + * created Attr node. An Element node cannot have children + * of the "Attr" type, therefore the desired exception + * should be raised. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_nodeappendchildinvalidnodetype : public DOMTestCase +{ + public: + hc_nodeappendchildinvalidnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + Node newChild; + Node appendedChild; + doc = (Document) load("hc_staff", true); + rootNode = doc.getDocumentElement(); + newChild = doc.createAttribute(SA::construct_from_utf8("newAttribute")); + + { + boolean success = false; + try { + appendedChild = rootNode.appendChild(newChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildinvalidnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeappendchildnewchilddiffdocument.hpp b/tests/DOM/conformance/level1/core/hc_nodeappendchildnewchilddiffdocument.hpp new file mode 100644 index 00000000..0ea2db7d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeappendchildnewchilddiffdocument.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeappendchildnewchilddiffdocument +#define test_hc_nodeappendchildnewchilddiffdocument + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method raises a + * WRONG_DOCUMENT_ERR DOMException if the "newChild" was + * created from a different document than the one that + * created this node. + * + * Retrieve the second employee and attempt to append + * a node created from a different document. An attempt + * to make such a replacement should raise the desired + * exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeappendchildnewchilddiffdocument : public DOMTestCase +{ + public: + hc_nodeappendchildnewchilddiffdocument(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + Node newChild; + NodeList elementList; + Node elementNode; + Node appendedChild; + doc1 = (Document) load("hc_staff", false); + doc2 = (Document) load("hc_staff", true); + newChild = doc1.createElement(SA::construct_from_utf8("br")); + elementList = doc2.getElementsByTagName(SA::construct_from_utf8("p")); + elementNode = elementList.item(1); + + { + boolean success = false; + try { + appendedChild = elementNode.appendChild(newChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnewchilddiffdocument"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeappendchildnodeancestor.hpp b/tests/DOM/conformance/level1/core/hc_nodeappendchildnodeancestor.hpp new file mode 100644 index 00000000..868373ea --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeappendchildnodeancestor.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeappendchildnodeancestor +#define test_hc_nodeappendchildnodeancestor + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if the node to + * append is one of this node's ancestors. + * + * Retrieve the second employee and attempt to append + * an ancestor node(root node) to it. + * An attempt to make such an addition should raise the + * desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class hc_nodeappendchildnodeancestor : public DOMTestCase +{ + public: + hc_nodeappendchildnodeancestor(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newChild; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node appendedChild; + doc = (Document) load("hc_staff", true); + newChild = doc.getDocumentElement(); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + + { + boolean success = false; + try { + appendedChild = employeeNode.appendChild(newChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnodeancestor"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeattributenodeattribute.hpp b/tests/DOM/conformance/level1/core/hc_nodeattributenodeattribute.hpp new file mode 100644 index 00000000..5670db40 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeattributenodeattribute.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeattributenodeattribute +#define test_hc_nodeattributenodeattribute + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on an Attribute + * Node returns null. + * Retrieve the first attribute from the last child of the + * first employee and invoke the "getAttributes()" method + * on the Attribute Node. It should return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ + +template +class hc_nodeattributenodeattribute : public DOMTestCase +{ + public: + hc_nodeattributenodeattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + NamedNodeMap addrAttr; + Node attrNode; + NamedNodeMap attrList; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributes(); + attrNode = addrAttr.item(0); + attrList = attrNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodeattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeattributenodename.hpp b/tests/DOM/conformance/level1/core/hc_nodeattributenodename.hpp new file mode 100644 index 00000000..69cf1d90 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeattributenodename.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeattributenodename +#define test_hc_nodeattributenodename + +#include "dom_conf_test.hpp" + +/** + * Retrieve the Attribute named "title" from the last + * child of the first p element and check the string returned + * by the "getNodeName()" method. It should be equal to + * "title". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +*/ + +template +class hc_nodeattributenodename : public DOMTestCase +{ + public: + hc_nodeattributenodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Attr addrAttr; + String attrName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributeNode(SA::construct_from_utf8("title")); + attrName = addrAttr.getNodeName(); + assertEquals("title", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeattributenodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodeattributenodetype.hpp new file mode 100644 index 00000000..9f4cdfe1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeattributenodetype.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeattributenodetype +#define test_hc_nodeattributenodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for an Attribute Node + * returns the constant value 2. + * + * Retrieve the first attribute from the last child of + * the first employee and invoke the "getNodeType()" + * method. The method should return 2. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class hc_nodeattributenodetype : public DOMTestCase +{ + public: + hc_nodeattributenodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Attr addrAttr; + int nodeType; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributeNode(SA::construct_from_utf8("title")); + nodeType = (int) addrAttr.getNodeType(); + assertEquals(2, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeattributenodevalue.hpp b/tests/DOM/conformance/level1/core/hc_nodeattributenodevalue.hpp new file mode 100644 index 00000000..1394168b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeattributenodevalue.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeattributenodevalue +#define test_hc_nodeattributenodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for an + * Attribute Node is the value of the Attribute. + * + * Retrieve the Attribute named "title" from the last + * child of the first "p" and check the string returned + * by the "getNodeValue()" method. It should be equal to + * "Yes". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class hc_nodeattributenodevalue : public DOMTestCase +{ + public: + hc_nodeattributenodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Attr addrAttr; + String attrValue; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributeNode(SA::construct_from_utf8("title")); + attrValue = addrAttr.getNodeValue(); + assertEquals("Yes", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodechildnodes.hpp b/tests/DOM/conformance/level1/core/hc_nodechildnodes.hpp new file mode 100644 index 00000000..085dfe35 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodechildnodes.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodechildnodes +#define test_hc_nodechildnodes + +#include "dom_conf_test.hpp" + +/** + * + * The "getChildNodes()" method returns a NodeList + * that contains all children of this node. + * + * Retrieve the second employee and check the NodeList + * returned by the "getChildNodes()" method. The + * length of the list should be 13. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodechildnodes : public DOMTestCase +{ + public: + hc_nodechildnodes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node childNode; + NodeList childNodes; + int nodeType; + String childName; + std::vector actual; + + std::vector expected; + expected.push_back(SA::construct_from_utf8("em")); + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("acronym")); + + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childNodes = employeeNode.getChildNodes(); + for (int indexN65644 = 0; indexN65644 != childNodes.getLength(); indexN65644++) { + childNode = (Node) childNodes.item(indexN65644); + nodeType = (int) childNode.getNodeType(); + childName = childNode.getNodeName(); + + if (equals(1, nodeType)) { + actual.push_back(childName); + } else { + assertEquals(3, nodeType); + } + + } + assertEquals(expected, actual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodechildnodesappendchild.hpp b/tests/DOM/conformance/level1/core/hc_nodechildnodesappendchild.hpp new file mode 100644 index 00000000..27c0ba9f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodechildnodesappendchild.hpp @@ -0,0 +1,135 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodechildnodesappendchild +#define test_hc_nodechildnodesappendchild + +#include "dom_conf_test.hpp" + +/** + * The NodeList returned by the "getChildNodes()" method + * is live. Changes on the node's children are immediately + * reflected on the nodes returned in the NodeList. + * + * Create a NodeList of the children of the second employee + * and then add a newly created element that was created + * by the "createElement()" method(Document Interface) to + * the second employee by using the "appendChild()" method. + * The length of the NodeList should reflect this new + * addition to the child list. It should return the value 14. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodechildnodesappendchild : public DOMTestCase +{ + public: + hc_nodechildnodesappendchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node createdNode; + Node childNode; + String childName; + int childType; + Node textNode; + std::vector actual; + + std::vector expected; + expected.push_back(SA::construct_from_utf8("em")); + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("acronym")); + expected.push_back(SA::construct_from_utf8("br")); + + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + createdNode = doc.createElement(SA::construct_from_utf8("br")); + employeeNode = employeeNode.appendChild(createdNode); + for (int indexN65671 = 0; indexN65671 != childList.getLength(); indexN65671++) { + childNode = (Node) childList.item(indexN65671); + childName = childNode.getNodeName(); + childType = (int) childNode.getNodeType(); + + if (equals(1, childType)) { + actual.push_back(childName); + } else { + assertEquals(3, childType); + } + + } + assertEquals(expected, actual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodesappendchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodechildnodesempty.hpp b/tests/DOM/conformance/level1/core/hc_nodechildnodesempty.hpp new file mode 100644 index 00000000..d6dd8488 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodechildnodesempty.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodechildnodesempty +#define test_hc_nodechildnodesempty + +#include "dom_conf_test.hpp" + +/** + * The "getChildNodes()" method returns a NodeList + * that contains all children of this node. If there + * are not any children, this is a NodeList that does not + * contain any nodes. + * Retrieve the character data of the second "em" node and + * invoke the "getChildNodes()" method. The + * NodeList returned should not have any nodes. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodechildnodesempty : public DOMTestCase +{ + public: + hc_nodechildnodesempty(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + NodeList childList; + Node employeeNode; + Node textNode; + int length; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("em")); + employeeNode = elementList.item(1); + textNode = employeeNode.getFirstChild(); + childList = textNode.getChildNodes(); + length = (int) childList.getLength(); + assertEquals(0, length); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodesempty"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodecloneattributescopied.hpp b/tests/DOM/conformance/level1/core/hc_nodecloneattributescopied.hpp new file mode 100644 index 00000000..10cd6763 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodecloneattributescopied.hpp @@ -0,0 +1,124 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodecloneattributescopied +#define test_hc_nodecloneattributescopied + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second acronym element and invoke + * the cloneNode method. The + * duplicate node returned by the method should copy the + * attributes associated with this node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ + +template +class hc_nodecloneattributescopied : public DOMTestCase +{ + public: + hc_nodecloneattributescopied(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node addressNode; + Node clonedNode; + NamedNodeMap attributes; + Node attributeNode; + String attributeName; + std::vector result; + + std::vector htmlExpected; + htmlExpected.push_back(SA::construct_from_utf8("class")); + htmlExpected.push_back(SA::construct_from_utf8("title")); + + std::vector expected; + expected.push_back(SA::construct_from_utf8("class")); + expected.push_back(SA::construct_from_utf8("title")); + expected.push_back(SA::construct_from_utf8("dir")); + + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + addressNode = elementList.item(1); + clonedNode = addressNode.cloneNode(false); + attributes = clonedNode.getAttributes(); + for (int indexN65654 = 0; indexN65654 != attributes.getLength(); indexN65654++) { + attributeNode = (Node) attributes.item(indexN65654); + attributeName = attributeNode.getNodeName(); + result.push_back(attributeName); + } + + if (("text/html" == getContentType())) { + assertEquals(htmlExpected, result); + } else { + assertEquals(expected, result); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecloneattributescopied"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeclonefalsenocopytext.hpp b/tests/DOM/conformance/level1/core/hc_nodeclonefalsenocopytext.hpp new file mode 100644 index 00000000..7ca2d061 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeclonefalsenocopytext.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeclonefalsenocopytext +#define test_hc_nodeclonefalsenocopytext + +#include "dom_conf_test.hpp" + +/** + * The "cloneNode(deep)" method does not copy text unless it + * is deep cloned.(Test for deep=false) + * + * Retrieve the fourth child of the second employee and + * the "cloneNode(deep)" method with deep=false. The + * duplicate node returned by the method should not copy + * any text data contained in this node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class hc_nodeclonefalsenocopytext : public DOMTestCase +{ + public: + hc_nodeclonefalsenocopytext(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node childNode; + Node clonedNode; + Node lastChildNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + childNode = childList.item(3); + clonedNode = childNode.cloneNode(false); + lastChildNode = clonedNode.getLastChild(); + assertNull(lastChildNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonefalsenocopytext"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeclonegetparentnull.hpp b/tests/DOM/conformance/level1/core/hc_nodeclonegetparentnull.hpp new file mode 100644 index 00000000..ad8cf256 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeclonegetparentnull.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeclonegetparentnull +#define test_hc_nodeclonegetparentnull + +#include "dom_conf_test.hpp" + +/** + * The duplicate node returned by the "cloneNode(deep)" + * method does not have a ParentNode. + * + * Retrieve the second employee and invoke the + * "cloneNode(deep)" method with deep=false. The + * duplicate node returned should return null when the + * "getParentNode()" is invoked. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class hc_nodeclonegetparentnull : public DOMTestCase +{ + public: + hc_nodeclonegetparentnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node clonedNode; + Node parentNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + clonedNode = employeeNode.cloneNode(false); + parentNode = clonedNode.getParentNode(); + assertNull(parentNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonegetparentnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeclonenodefalse.hpp b/tests/DOM/conformance/level1/core/hc_nodeclonenodefalse.hpp new file mode 100644 index 00000000..504e4590 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeclonenodefalse.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeclonenodefalse +#define test_hc_nodeclonenodefalse + +#include "dom_conf_test.hpp" + +/** + * The "cloneNode(deep)" method returns a copy of the node + * only if deep=false. + * + * Retrieve the second employee and invoke the + * "cloneNode(deep)" method with deep=false. The + * method should only clone this node. The NodeName and + * length of the NodeList are checked. The "getNodeName()" + * method should return "employee" and the "getLength()" + * method should return 0. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class hc_nodeclonenodefalse : public DOMTestCase +{ + public: + hc_nodeclonenodefalse(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node clonedNode; + String cloneName; + NodeList cloneChildren; + int length; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + clonedNode = employeeNode.cloneNode(false); + cloneName = clonedNode.getNodeName(); + assertEquals("p", cloneName); + cloneChildren = clonedNode.getChildNodes(); + length = (int) cloneChildren.getLength(); + assertEquals(0, length); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonenodefalse"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeclonenodetrue.hpp b/tests/DOM/conformance/level1/core/hc_nodeclonenodetrue.hpp new file mode 100644 index 00000000..8556646f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeclonenodetrue.hpp @@ -0,0 +1,124 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeclonenodetrue +#define test_hc_nodeclonenodetrue + +#include "dom_conf_test.hpp" + +/** + * The "cloneNode(deep)" method returns a copy of the node + * and the subtree under it if deep=true. + * + * Retrieve the second employee and invoke the + * "cloneNode(deep)" method with deep=true. The + * method should clone this node and the subtree under it. + * The NodeName of each child in the returned node is + * checked to insure the entire subtree under the second + * employee was cloned. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodeclonenodetrue : public DOMTestCase +{ + public: + hc_nodeclonenodetrue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node clonedNode; + NodeList clonedList; + Node clonedChild; + String clonedChildName; + NodeList origList; + Node origChild; + String origChildName; + std::vector result; + + std::vector expected; + + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + origList = employeeNode.getChildNodes(); + for (int indexN65637 = 0; indexN65637 != origList.getLength(); indexN65637++) { + origChild = (Node) origList.item(indexN65637); + origChildName = origChild.getNodeName(); + expected.push_back(origChildName); + } + clonedNode = employeeNode.cloneNode(true); + clonedList = clonedNode.getChildNodes(); + for (int indexN65659 = 0; indexN65659 != clonedList.getLength(); indexN65659++) { + clonedChild = (Node) clonedList.item(indexN65659); + clonedChildName = clonedChild.getNodeName(); + result.push_back(clonedChildName); + } + assertEquals(expected, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonenodetrue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeclonetruecopytext.hpp b/tests/DOM/conformance/level1/core/hc_nodeclonetruecopytext.hpp new file mode 100644 index 00000000..2af4f8c4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeclonetruecopytext.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeclonetruecopytext +#define test_hc_nodeclonetruecopytext + +#include "dom_conf_test.hpp" + +/** + * The "cloneNode(deep)" method does not copy text unless it + * is deep cloned.(Test for deep=true) + * + * Retrieve the eighth child of the second employee and + * the "cloneNode(deep)" method with deep=true. The + * duplicate node returned by the method should copy + * any text data contained in this node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodeclonetruecopytext : public DOMTestCase +{ + public: + hc_nodeclonetruecopytext(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node childNode; + Node clonedNode; + Node lastChildNode; + String childValue; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("sup")); + childNode = elementList.item(1); + clonedNode = childNode.cloneNode(true); + lastChildNode = clonedNode.getLastChild(); + childValue = lastChildNode.getNodeValue(); + assertEquals("35,000", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonetruecopytext"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodecommentnodeattributes.hpp b/tests/DOM/conformance/level1/core/hc_nodecommentnodeattributes.hpp new file mode 100644 index 00000000..c4781fb9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodecommentnodeattributes.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodecommentnodeattributes +#define test_hc_nodecommentnodeattributes + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a Comment + * Node returns null. + * Find any comment that is an immediate child of the root + * and assert that Node.attributes is null. Then create + * a new comment node (in case they had been omitted) and + * make the assertion. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=263 +*/ + +template +class hc_nodecommentnodeattributes : public DOMTestCase +{ + public: + hc_nodecommentnodeattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node commentNode; + NodeList nodeList; + NamedNodeMap attrList; + int nodeType; + doc = (Document) load("hc_staff", false); + nodeList = doc.getChildNodes(); + for (int indexN65603 = 0; indexN65603 != nodeList.getLength(); indexN65603++) { + commentNode = (Node) nodeList.item(indexN65603); + nodeType = (int) commentNode.getNodeType(); + + if (equals(8, nodeType)) { + attrList = commentNode.getAttributes(); + assertNull(attrList); + } + } + commentNode = doc.createComment(SA::construct_from_utf8("This is a comment")); + attrList = commentNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodeattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodecommentnodename.hpp b/tests/DOM/conformance/level1/core/hc_nodecommentnodename.hpp new file mode 100644 index 00000000..5a501c21 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodecommentnodename.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodecommentnodename +#define test_hc_nodecommentnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * Comment Node is "#comment". + * + * Retrieve the Comment node in the XML file + * and check the string returned by the "getNodeName()" + * method. It should be equal to "#comment". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +*/ + +template +class hc_nodecommentnodename : public DOMTestCase +{ + public: + hc_nodecommentnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node commentNode; + int nodeType; + String commentName; + String commentNodeName; + doc = (Document) load("hc_staff", false); + elementList = doc.getChildNodes(); + for (int indexN65604 = 0; indexN65604 != elementList.getLength(); indexN65604++) { + commentNode = (Node) elementList.item(indexN65604); + nodeType = (int) commentNode.getNodeType(); + + if (equals(8, nodeType)) { + commentNodeName = commentNode.getNodeName(); + assertEquals("#comment", commentNodeName); + } + } + commentNode = doc.createComment(SA::construct_from_utf8("This is a comment")); + commentNodeName = commentNode.getNodeName(); + assertEquals("#comment", commentNodeName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodecommentnodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodecommentnodetype.hpp new file mode 100644 index 00000000..9a5e3765 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodecommentnodetype.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodecommentnodetype +#define test_hc_nodecommentnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a Comment Node + * returns the constant value 8. + * + * Retrieve the nodes from the document and check for + * a comment node and invoke the "getNodeType()" method. This should + * return 8. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +*/ + +template +class hc_nodecommentnodetype : public DOMTestCase +{ + public: + hc_nodecommentnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList testList; + Node commentNode; + String commentNodeName; + int nodeType; + doc = (Document) load("hc_staff", false); + testList = doc.getChildNodes(); + for (int indexN65600 = 0; indexN65600 != testList.getLength(); indexN65600++) { + commentNode = (Node) testList.item(indexN65600); + commentNodeName = commentNode.getNodeName(); + + if (equals("#comment", commentNodeName)) { + nodeType = (int) commentNode.getNodeType(); + assertEquals(8, nodeType); + } + } + commentNode = doc.createComment(SA::construct_from_utf8("This is a comment")); + nodeType = (int) commentNode.getNodeType(); + assertEquals(8, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodecommentnodevalue.hpp b/tests/DOM/conformance/level1/core/hc_nodecommentnodevalue.hpp new file mode 100644 index 00000000..d855046f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodecommentnodevalue.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodecommentnodevalue +#define test_hc_nodecommentnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * Comment Node is the content of the comment. + * + * Retrieve the comment in the XML file and + * check the string returned by the "getNodeValue()" method. + * It should be equal to "This is comment number 1". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +*/ + +template +class hc_nodecommentnodevalue : public DOMTestCase +{ + public: + hc_nodecommentnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node commentNode; + String commentName; + String commentValue; + doc = (Document) load("hc_staff", false); + elementList = doc.getChildNodes(); + for (int indexN65600 = 0; indexN65600 != elementList.getLength(); indexN65600++) { + commentNode = (Node) elementList.item(indexN65600); + commentName = commentNode.getNodeName(); + + if (equals("#comment", commentName)) { + commentValue = commentNode.getNodeValue(); + assertEquals(" This is comment number 1.", commentValue); + } + } + commentNode = doc.createComment(SA::construct_from_utf8(" This is a comment")); + commentValue = commentNode.getNodeValue(); + assertEquals(" This is a comment", commentValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodename.hpp b/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodename.hpp new file mode 100644 index 00000000..6107ea3d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodename.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodedocumentfragmentnodename +#define test_hc_nodedocumentfragmentnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * DocumentFragment Node is "#document-frament". + * Retrieve the DOM document and invoke the + * "createDocumentFragment()" method and check the string + * returned by the "getNodeName()" method. It should be + * equal to "#document-fragment". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ + +template +class hc_nodedocumentfragmentnodename : public DOMTestCase +{ + public: + hc_nodedocumentfragmentnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment docFragment; + String documentFragmentName; + doc = (Document) load("hc_staff", true); + docFragment = doc.createDocumentFragment(); + documentFragmentName = docFragment.getNodeName(); + assertEquals("#document-fragment", documentFragmentName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodetype.hpp new file mode 100644 index 00000000..cf382dea --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodetype.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodedocumentfragmentnodetype +#define test_hc_nodedocumentfragmentnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a DocumentFragment Node + * returns the constant value 11. + * Invoke the "createDocumentFragment()" method and + * examine the NodeType of the document fragment + * returned by the "getNodeType()" method. The method + * should return 11. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ + +template +class hc_nodedocumentfragmentnodetype : public DOMTestCase +{ + public: + hc_nodedocumentfragmentnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment documentFragmentNode; + int nodeType; + doc = (Document) load("hc_staff", true); + documentFragmentNode = doc.createDocumentFragment(); + nodeType = (int) documentFragmentNode.getNodeType(); + assertEquals(11, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodevalue.hpp b/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodevalue.hpp new file mode 100644 index 00000000..59c71157 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodedocumentfragmentnodevalue.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodedocumentfragmentnodevalue +#define test_hc_nodedocumentfragmentnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * DocumentFragment Node is null. + * + * Retrieve the DOM document and invoke the + * "createDocumentFragment()" method and check the string + * returned by the "getNodeValue()" method. It should be + * equal to null. +* @author Curt Arnold +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class hc_nodedocumentfragmentnodevalue : public DOMTestCase +{ + public: + hc_nodedocumentfragmentnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment docFragment; + NamedNodeMap attrList; + String value; + doc = (Document) load("hc_staff", true); + docFragment = doc.createDocumentFragment(); + attrList = docFragment.getAttributes(); + assertNull(attrList); + value = docFragment.getNodeValue(); + assertNull(value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodedocumentnodeattribute.hpp b/tests/DOM/conformance/level1/core/hc_nodedocumentnodeattribute.hpp new file mode 100644 index 00000000..8d1771b0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodedocumentnodeattribute.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodedocumentnodeattribute +#define test_hc_nodedocumentnodeattribute + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a Document + * Node returns null. + * Retrieve the DOM Document and invoke the + * "getAttributes()" method on the Document Node. + * It should return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ + +template +class hc_nodedocumentnodeattribute : public DOMTestCase +{ + public: + hc_nodedocumentnodeattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NamedNodeMap attrList; + doc = (Document) load("hc_staff", false); + attrList = doc.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodeattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodedocumentnodename.hpp b/tests/DOM/conformance/level1/core/hc_nodedocumentnodename.hpp new file mode 100644 index 00000000..4901b1d7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodedocumentnodename.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodedocumentnodename +#define test_hc_nodedocumentnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * Document Node is "#document". + * Retrieve the DOM document and check the string returned + * by the "getNodeName()" method. It should be equal to + * "#document". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class hc_nodedocumentnodename : public DOMTestCase +{ + public: + hc_nodedocumentnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + String documentName; + doc = (Document) load("hc_staff", false); + documentName = doc.getNodeName(); + assertEquals("#document", documentName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodedocumentnodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodedocumentnodetype.hpp new file mode 100644 index 00000000..920cf6ab --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodedocumentnodetype.hpp @@ -0,0 +1,93 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodedocumentnodetype +#define test_hc_nodedocumentnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a Document Node + * returns the constant value 9. + * Retrieve the document and invoke the "getNodeType()" + * method. The method should return 9. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class hc_nodedocumentnodetype : public DOMTestCase +{ + public: + hc_nodedocumentnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + int nodeType; + doc = (Document) load("hc_staff", false); + nodeType = (int) doc.getNodeType(); + assertEquals(9, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodedocumentnodevalue.hpp b/tests/DOM/conformance/level1/core/hc_nodedocumentnodevalue.hpp new file mode 100644 index 00000000..2f0896e0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodedocumentnodevalue.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodedocumentnodevalue +#define test_hc_nodedocumentnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * Document Node is null. + * Retrieve the DOM Document and check the string returned + * by the "getNodeValue()" method. It should be equal to + * null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class hc_nodedocumentnodevalue : public DOMTestCase +{ + public: + hc_nodedocumentnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + String documentValue; + doc = (Document) load("hc_staff", false); + documentValue = doc.getNodeValue(); + assertNull(documentValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeelementnodeattributes.hpp b/tests/DOM/conformance/level1/core/hc_nodeelementnodeattributes.hpp new file mode 100644 index 00000000..66cbcbff --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeelementnodeattributes.hpp @@ -0,0 +1,120 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeelementnodeattributes +#define test_hc_nodeelementnodeattributes + +#include "dom_conf_test.hpp" + +/** + * Retrieve the third "acronym" element and evaluate Node.attributes. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ + +template +class hc_nodeelementnodeattributes : public DOMTestCase +{ + public: + hc_nodeelementnodeattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + NamedNodeMap addrAttr; + Node attrNode; + String attrName; + std::vector attrList; + + std::vector htmlExpected; + htmlExpected.push_back(SA::construct_from_utf8("title")); + htmlExpected.push_back(SA::construct_from_utf8("class")); + + std::vector expected; + expected.push_back(SA::construct_from_utf8("title")); + expected.push_back(SA::construct_from_utf8("class")); + expected.push_back(SA::construct_from_utf8("dir")); + + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = (Element) elementList.item(2); + addrAttr = testAddr.getAttributes(); + for (int indexN65648 = 0; indexN65648 != addrAttr.getLength(); indexN65648++) { + attrNode = (Node) addrAttr.item(indexN65648); + attrName = attrNode.getNodeName(); + attrList.push_back(attrName); + } + + if (("text/html" == getContentType())) { + assertEquals(htmlExpected, attrList); + } else { + assertEquals(expected, attrList); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodeattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeelementnodename.hpp b/tests/DOM/conformance/level1/core/hc_nodeelementnodename.hpp new file mode 100644 index 00000000..cd00ff69 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeelementnodename.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeelementnodename +#define test_hc_nodeelementnodename + +#include "dom_conf_test.hpp" + +/** + * Retrieve the first Element Node(Root Node) of the + * DOM object and check the string returned by the + * "getNodeName()" method. It should be equal to its + * tagName. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class hc_nodeelementnodename : public DOMTestCase +{ + public: + hc_nodeelementnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element elementNode; + String elementName; + doc = (Document) load("hc_staff", false); + elementNode = doc.getDocumentElement(); + elementName = elementNode.getNodeName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", elementName); + } else { + assertEquals("html", elementName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeelementnodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodeelementnodetype.hpp new file mode 100644 index 00000000..5b2cfaac --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeelementnodetype.hpp @@ -0,0 +1,95 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeelementnodetype +#define test_hc_nodeelementnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for an Element Node + * returns the constant value 1. + * + * Retrieve the root node and invoke the "getNodeType()" + * method. The method should return 1. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class hc_nodeelementnodetype : public DOMTestCase +{ + public: + hc_nodeelementnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + int nodeType; + doc = (Document) load("hc_staff", false); + rootNode = doc.getDocumentElement(); + nodeType = (int) rootNode.getNodeType(); + assertEquals(1, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeelementnodevalue.hpp b/tests/DOM/conformance/level1/core/hc_nodeelementnodevalue.hpp new file mode 100644 index 00000000..b7cf1820 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeelementnodevalue.hpp @@ -0,0 +1,92 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeelementnodevalue +#define test_hc_nodeelementnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for an + * Element Node is null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class hc_nodeelementnodevalue : public DOMTestCase +{ + public: + hc_nodeelementnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element elementNode; + String elementValue; + doc = (Document) load("hc_staff", false); + elementNode = doc.getDocumentElement(); + elementValue = elementNode.getNodeValue(); + assertNull(elementValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetfirstchild.hpp b/tests/DOM/conformance/level1/core/hc_nodegetfirstchild.hpp new file mode 100644 index 00000000..26a0ed64 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetfirstchild.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetfirstchild +#define test_hc_nodegetfirstchild + +#include "dom_conf_test.hpp" + +/** + * The "getFirstChild()" method returns the first child + * of this node. + * + * Retrieve the second employee and invoke the + * "getFirstChild()" method. The NodeName returned + * should be "#text" or "EM". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodegetfirstchild : public DOMTestCase +{ + public: + hc_nodegetfirstchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node fchildNode; + String childName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + fchildNode = employeeNode.getFirstChild(); + childName = fchildNode.getNodeName(); + + if (equals("#text", childName)) { + assertEquals("#text", childName); + } else { + assertEquals("em", childName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetfirstchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetfirstchildnull.hpp b/tests/DOM/conformance/level1/core/hc_nodegetfirstchildnull.hpp new file mode 100644 index 00000000..0fba2b7e --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetfirstchildnull.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetfirstchildnull +#define test_hc_nodegetfirstchildnull + +#include "dom_conf_test.hpp" + +/** + * If there is not a first child then the "getFirstChild()" + * method returns null. + * Retrieve the text of the first "em" element and invoke the "getFirstChild()" method. It + * should return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodegetfirstchildnull : public DOMTestCase +{ + public: + hc_nodegetfirstchildnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList emList; + Node emNode; + CharacterData emText; + Node nullChild; + doc = (Document) load("hc_staff", false); + emList = doc.getElementsByTagName(SA::construct_from_utf8("em")); + emNode = emList.item(0); + emText = (CharacterData) emNode.getFirstChild(); + nullChild = emText.getFirstChild(); + assertNull(nullChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetfirstchildnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetlastchild.hpp b/tests/DOM/conformance/level1/core/hc_nodegetlastchild.hpp new file mode 100644 index 00000000..20486542 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetlastchild.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetlastchild +#define test_hc_nodegetlastchild + +#include "dom_conf_test.hpp" + +/** + * The "getLastChild()" method returns the last child + * of this node. + * + * Retrieve the second employee and invoke the + * "getLastChild()" method. The NodeName returned + * should be "#text". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB +*/ + +template +class hc_nodegetlastchild : public DOMTestCase +{ + public: + hc_nodegetlastchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node lchildNode; + String childName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + lchildNode = employeeNode.getLastChild(); + childName = lchildNode.getNodeName(); + assertEquals("#text", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetlastchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetlastchildnull.hpp b/tests/DOM/conformance/level1/core/hc_nodegetlastchildnull.hpp new file mode 100644 index 00000000..4c3c1a12 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetlastchildnull.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetlastchildnull +#define test_hc_nodegetlastchildnull + +#include "dom_conf_test.hpp" + +/** + * If there is not a last child then the "getLastChild()" + * method returns null. + * Retrieve the text of the first "em" element and invoke the "getFirstChild()" method. It + * should return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodegetlastchildnull : public DOMTestCase +{ + public: + hc_nodegetlastchildnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList emList; + Node emNode; + CharacterData emText; + Node nullChild; + doc = (Document) load("hc_staff", false); + emList = doc.getElementsByTagName(SA::construct_from_utf8("em")); + emNode = emList.item(0); + emText = (CharacterData) emNode.getFirstChild(); + nullChild = emText.getLastChild(); + assertNull(nullChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetlastchildnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetnextsibling.hpp b/tests/DOM/conformance/level1/core/hc_nodegetnextsibling.hpp new file mode 100644 index 00000000..b1a06cd6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetnextsibling.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetnextsibling +#define test_hc_nodegetnextsibling + +#include "dom_conf_test.hpp" + +/** + * The "getNextSibling()" method returns the node immediately + * following this node. + * + * Retrieve the first child of the second employee and + * invoke the "getNextSibling()" method. It should return + * a node with the NodeName of "#text". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +*/ + +template +class hc_nodegetnextsibling : public DOMTestCase +{ + public: + hc_nodegetnextsibling(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node emNode; + Node nsNode; + String nsName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("em")); + emNode = elementList.item(1); + nsNode = emNode.getNextSibling(); + nsName = nsNode.getNodeName(); + assertEquals("#text", nsName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetnextsibling"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetnextsiblingnull.hpp b/tests/DOM/conformance/level1/core/hc_nodegetnextsiblingnull.hpp new file mode 100644 index 00000000..11965dce --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetnextsiblingnull.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetnextsiblingnull +#define test_hc_nodegetnextsiblingnull + +#include "dom_conf_test.hpp" + +/** + * If there is not a node immediately following this node the + * "getNextSibling()" method returns null. + * + * Retrieve the first child of the second employee and + * invoke the "getNextSibling()" method. It should + * be set to null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +*/ + +template +class hc_nodegetnextsiblingnull : public DOMTestCase +{ + public: + hc_nodegetnextsiblingnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node lcNode; + Node nsNode; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + lcNode = employeeNode.getLastChild(); + nsNode = lcNode.getNextSibling(); + assertNull(nsNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetnextsiblingnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetownerdocument.hpp b/tests/DOM/conformance/level1/core/hc_nodegetownerdocument.hpp new file mode 100644 index 00000000..bb692961 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetownerdocument.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetownerdocument +#define test_hc_nodegetownerdocument + +#include "dom_conf_test.hpp" + +/** + * Evaluate Node.ownerDocument on the second "p" element. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class hc_nodegetownerdocument : public DOMTestCase +{ + public: + hc_nodegetownerdocument(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node docNode; + Document ownerDocument; + Element docElement; + String elementName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + docNode = elementList.item(1); + ownerDocument = docNode.getOwnerDocument(); + docElement = ownerDocument.getDocumentElement(); + elementName = docElement.getNodeName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", elementName); + } else { + assertEquals("html", elementName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetownerdocument"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetownerdocumentnull.hpp b/tests/DOM/conformance/level1/core/hc_nodegetownerdocumentnull.hpp new file mode 100644 index 00000000..3e3b0016 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetownerdocumentnull.hpp @@ -0,0 +1,93 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetownerdocumentnull +#define test_hc_nodegetownerdocumentnull + +#include "dom_conf_test.hpp" + +/** + * The "getOwnerDocument()" method returns null if the target + * node itself is a document. + * + * Invoke the "getOwnerDocument()" method on the master + * document. The Document returned should be null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc +*/ + +template +class hc_nodegetownerdocumentnull : public DOMTestCase +{ + public: + hc_nodegetownerdocumentnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Document ownerDocument; + doc = (Document) load("hc_staff", false); + ownerDocument = doc.getOwnerDocument(); + assertNull(ownerDocument); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetownerdocumentnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetprevioussibling.hpp b/tests/DOM/conformance/level1/core/hc_nodegetprevioussibling.hpp new file mode 100644 index 00000000..0fc8bca5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetprevioussibling.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetprevioussibling +#define test_hc_nodegetprevioussibling + +#include "dom_conf_test.hpp" + +/** + * The "getPreviousSibling()" method returns the node + * immediately preceding this node. + * + * Retrieve the second child of the second employee and + * invoke the "getPreviousSibling()" method. It should + * return a node with a NodeName of "#text". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +*/ + +template +class hc_nodegetprevioussibling : public DOMTestCase +{ + public: + hc_nodegetprevioussibling(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Node psNode; + String psName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(1); + psNode = nameNode.getPreviousSibling(); + psName = psNode.getNodeName(); + assertEquals("#text", psName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetprevioussibling"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodegetprevioussiblingnull.hpp b/tests/DOM/conformance/level1/core/hc_nodegetprevioussiblingnull.hpp new file mode 100644 index 00000000..c23d0f04 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodegetprevioussiblingnull.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodegetprevioussiblingnull +#define test_hc_nodegetprevioussiblingnull + +#include "dom_conf_test.hpp" + +/** + * If there is not a node immediately preceding this node the + * "getPreviousSibling()" method returns null. + * + * Retrieve the first child of the second employee and + * invoke the "getPreviousSibling()" method. It should + * be set to null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +*/ + +template +class hc_nodegetprevioussiblingnull : public DOMTestCase +{ + public: + hc_nodegetprevioussiblingnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node fcNode; + Node psNode; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(2); + fcNode = employeeNode.getFirstChild(); + psNode = fcNode.getPreviousSibling(); + assertNull(psNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetprevioussiblingnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodehaschildnodes.hpp b/tests/DOM/conformance/level1/core/hc_nodehaschildnodes.hpp new file mode 100644 index 00000000..f83986bd --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodehaschildnodes.hpp @@ -0,0 +1,98 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodehaschildnodes +#define test_hc_nodehaschildnodes + +#include "dom_conf_test.hpp" + +/** + * The "hasChildNodes()" method returns true if the node + * has children. + * + * Retrieve the root node("staff") and invoke the + * "hasChildNodes()" method. It should return the boolean + * value "true". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187 +*/ + +template +class hc_nodehaschildnodes : public DOMTestCase +{ + public: + hc_nodehaschildnodes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + boolean state; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + state = employeeNode.hasChildNodes(); + assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodehaschildnodes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodehaschildnodesfalse.hpp b/tests/DOM/conformance/level1/core/hc_nodehaschildnodesfalse.hpp new file mode 100644 index 00000000..50fa62eb --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodehaschildnodesfalse.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodehaschildnodesfalse +#define test_hc_nodehaschildnodesfalse + +#include "dom_conf_test.hpp" + +/** + * The "hasChildNodes()" method returns false if the node + * does not have any children. + * + * Retrieve the text of the first "em" element and invoke the "hasChildNodes()" method. It + * should return false. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodehaschildnodesfalse : public DOMTestCase +{ + public: + hc_nodehaschildnodesfalse(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList emList; + Node emNode; + CharacterData emText; + boolean hasChild; + doc = (Document) load("hc_staff", false); + emList = doc.getElementsByTagName(SA::construct_from_utf8("em")); + emNode = emList.item(0); + emText = (CharacterData) emNode.getFirstChild(); + hasChild = emText.hasChildNodes(); + assertFalse(hasChild); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodehaschildnodesfalse"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbefore.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbefore.hpp new file mode 100644 index 00000000..a3aa530b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbefore.hpp @@ -0,0 +1,130 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbefore +#define test_hc_nodeinsertbefore + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method inserts the + * node "newChild" before the node "refChild". + * + * Insert a newly created Element node before the second + * sup element in the document and check the "newChild" + * and "refChild" after insertion for correct placement. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=261 +*/ + +template +class hc_nodeinsertbefore : public DOMTestCase +{ + public: + hc_nodeinsertbefore(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node newChild; + Node child; + String childName; + Node insertedNode; + std::vector actual; + + std::vector expected; + expected.push_back(SA::construct_from_utf8("em")); + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("br")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("acronym")); + + int nodeType; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("sup")); + refChild = elementList.item(2); + employeeNode = refChild.getParentNode(); + childList = employeeNode.getChildNodes(); + newChild = doc.createElement(SA::construct_from_utf8("br")); + insertedNode = employeeNode.insertBefore(newChild, refChild); + for (int indexN65681 = 0; indexN65681 != childList.getLength(); indexN65681++) { + child = (Node) childList.item(indexN65681); + nodeType = (int) child.getNodeType(); + + if (equals(1, nodeType)) { + childName = child.getNodeName(); + actual.push_back(childName); + } + } + assertEquals(expected, actual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbefore"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbeforedocfragment.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforedocfragment.hpp new file mode 100644 index 00000000..790573f9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforedocfragment.hpp @@ -0,0 +1,123 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbeforedocfragment +#define test_hc_nodeinsertbeforedocfragment + +#include "dom_conf_test.hpp" + +/** + * If the "newChild" is a DocumentFragment object then all + * its children are inserted in the same order before the + * the "refChild". + * + * Create a DocumentFragment object and populate it with + * two Element nodes. Retrieve the second employee and + * insert the newly created DocumentFragment before its + * fourth child. The second employee should now have two + * extra children("newChild1" and "newChild2") at + * positions fourth and fifth respectively. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeinsertbeforedocfragment : public DOMTestCase +{ + public: + hc_nodeinsertbeforedocfragment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + DocumentFragment newdocFragment; + Node newChild1; + Node newChild2; + Node child; + String childName; + Node appendedChild; + Node insertedNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + refChild = childList.item(3); + newdocFragment = doc.createDocumentFragment(); + newChild1 = doc.createElement(SA::construct_from_utf8("br")); + newChild2 = doc.createElement(SA::construct_from_utf8("b")); + appendedChild = newdocFragment.appendChild(newChild1); + appendedChild = newdocFragment.appendChild(newChild2); + insertedNode = employeeNode.insertBefore(newdocFragment, refChild); + child = childList.item(3); + childName = child.getNodeName(); + assertEquals("br", childName); + child = childList.item(4); + childName = child.getNodeName(); + assertEquals("b", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforedocfragment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbeforeinvalidnodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforeinvalidnodetype.hpp new file mode 100644 index 00000000..4a0aca46 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforeinvalidnodetype.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbeforeinvalidnodetype +#define test_hc_nodeinsertbeforeinvalidnodetype + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if this node is of + * a type that does not allow children of the type "newChild" + * to be inserted. + * + * Retrieve the root node and attempt to insert a newly + * created Attr node. An Element node cannot have children + * of the "Attr" type, therefore the desired exception + * should be raised. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=406 +*/ + +template +class hc_nodeinsertbeforeinvalidnodetype : public DOMTestCase +{ + public: + hc_nodeinsertbeforeinvalidnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + Node newChild; + NodeList elementList; + Node refChild; + Node insertedNode; + doc = (Document) load("hc_staff", true); + newChild = doc.createAttribute(SA::construct_from_utf8("title")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + refChild = elementList.item(1); + rootNode = (Element) refChild.getParentNode(); + + { + boolean success = false; + try { + insertedNode = rootNode.insertBefore(newChild, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforeinvalidnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenewchilddiffdocument.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenewchilddiffdocument.hpp new file mode 100644 index 00000000..0dc3e1e4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenewchilddiffdocument.hpp @@ -0,0 +1,120 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbeforenewchilddiffdocument +#define test_hc_nodeinsertbeforenewchilddiffdocument + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method raises a + * WRONG_DOCUMENT_ERR DOMException if the "newChild" was + * created from a different document than the one that + * created this node. + * + * Retrieve the second employee and attempt to insert a new + * child that was created from a different document than the + * one that created the second employee. An attempt to + * insert such a child should raise the desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeinsertbeforenewchilddiffdocument : public DOMTestCase +{ + public: + hc_nodeinsertbeforenewchilddiffdocument(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + Node refChild; + Node newChild; + NodeList elementList; + Node elementNode; + Node insertedNode; + doc1 = (Document) load("hc_staff", false); + doc2 = (Document) load("hc_staff", true); + newChild = doc1.createElement(SA::construct_from_utf8("br")); + elementList = doc2.getElementsByTagName(SA::construct_from_utf8("p")); + elementNode = elementList.item(1); + refChild = elementNode.getFirstChild(); + + { + boolean success = false; + try { + insertedNode = elementNode.insertBefore(newChild, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchilddiffdocument"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenewchildexists.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenewchildexists.hpp new file mode 100644 index 00000000..a64016c1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenewchildexists.hpp @@ -0,0 +1,130 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbeforenewchildexists +#define test_hc_nodeinsertbeforenewchildexists + +#include "dom_conf_test.hpp" + +/** + * If the "newChild" is already in the tree, the + * "insertBefore(newChild,refChild)" method must first + * remove it before the insertion takes place. + * + * Insert a node Element ("em") that is already + * present in the tree. The existing node should be + * removed first and the new one inserted. The node is + * inserted at a different position in the tree to assure + * that it was indeed inserted. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodeinsertbeforenewchildexists : public DOMTestCase +{ + public: + hc_nodeinsertbeforenewchildexists(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node newChild; + Node child; + String childName; + Node insertedNode; + std::vector expected; + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("em")); + expected.push_back(SA::construct_from_utf8("acronym")); + + std::vector result; + + int nodeType; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = ((Element) /*Node */employeeNode).getElementsByTagName(SA::construct_from_utf8("*")); + refChild = childList.item(5); + newChild = childList.item(0); + insertedNode = employeeNode.insertBefore(newChild, refChild); + for (int indexN65676 = 0; indexN65676 != childList.getLength(); indexN65676++) { + child = (Node) childList.item(indexN65676); + nodeType = (int) child.getNodeType(); + + if (equals(1, nodeType)) { + childName = child.getNodeName(); + result.push_back(childName); + } + } + assertEquals(expected, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchildexists"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenodeancestor.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenodeancestor.hpp new file mode 100644 index 00000000..ca5b588b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenodeancestor.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbeforenodeancestor +#define test_hc_nodeinsertbeforenodeancestor + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if the node to be + * inserted is one of this nodes ancestors. + * + * Retrieve the second employee and attempt to insert a + * node that is one of its ancestors(root node). An + * attempt to insert such a node should raise the + * desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class hc_nodeinsertbeforenodeancestor : public DOMTestCase +{ + public: + hc_nodeinsertbeforenodeancestor(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newChild; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node insertedNode; + doc = (Document) load("hc_staff", true); + newChild = doc.getDocumentElement(); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + refChild = childList.item(0); + + { + boolean success = false; + try { + insertedNode = employeeNode.insertBefore(newChild, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenodeancestor"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenodename.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenodename.hpp new file mode 100644 index 00000000..09756055 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforenodename.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbeforenodename +#define test_hc_nodeinsertbeforenodename + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refchild)" method returns + * the node being inserted. + * + * Insert an Element node before the fourth + * child of the second employee and check the node + * returned from the "insertBefore(newChild,refChild)" + * method. The node returned should be "newChild". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeinsertbeforenodename : public DOMTestCase +{ + public: + hc_nodeinsertbeforenodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node newChild; + Node insertedNode; + String childName; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + refChild = childList.item(3); + newChild = doc.createElement(SA::construct_from_utf8("br")); + insertedNode = employeeNode.insertBefore(newChild, refChild); + childName = insertedNode.getNodeName(); + assertEquals("br", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbeforerefchildnonexistent.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforerefchildnonexistent.hpp new file mode 100644 index 00000000..e76e9250 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforerefchildnonexistent.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbeforerefchildnonexistent +#define test_hc_nodeinsertbeforerefchildnonexistent + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method raises a + * NOT_FOUND_ERR DOMException if the reference child is + * not a child of this node. + * + * Retrieve the second employee and attempt to insert a + * new node before a reference node that is not a child + * of this node. An attempt to insert before a non child + * node should raise the desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_nodeinsertbeforerefchildnonexistent : public DOMTestCase +{ + public: + hc_nodeinsertbeforerefchildnonexistent(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node refChild; + Node newChild; + NodeList elementList; + Node elementNode; + Node insertedNode; + doc = (Document) load("hc_staff", true); + newChild = doc.createElement(SA::construct_from_utf8("br")); + refChild = doc.createElement(SA::construct_from_utf8("b")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + elementNode = elementList.item(1); + + { + boolean success = false; + try { + insertedNode = elementNode.insertBefore(newChild, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforerefchildnonexistent"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeinsertbeforerefchildnull.hpp b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforerefchildnull.hpp new file mode 100644 index 00000000..7bd23635 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeinsertbeforerefchildnull.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeinsertbeforerefchildnull +#define test_hc_nodeinsertbeforerefchildnull + +#include "dom_conf_test.hpp" + +/** + * If the "refChild" is null then the + * "insertBefore(newChild,refChild)" method inserts the + * node "newChild" at the end of the list of children. + * + * Retrieve the second employee and invoke the + * "insertBefore(newChild,refChild)" method with + * refChild=null. Since "refChild" is null the "newChild" + * should be added to the end of the list. The last item + * in the list is checked after insertion. The last Element + * node of the list should be "newChild". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeinsertbeforerefchildnull : public DOMTestCase +{ + public: + hc_nodeinsertbeforerefchildnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node newChild; + Node child; + String childName; + Node insertedNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + newChild = doc.createElement(SA::construct_from_utf8("br")); + insertedNode = employeeNode.insertBefore(newChild, refChild); + child = employeeNode.getLastChild(); + childName = child.getNodeName(); + assertEquals("br", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforerefchildnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodelistindexequalzero.hpp b/tests/DOM/conformance/level1/core/hc_nodelistindexequalzero.hpp new file mode 100644 index 00000000..7ee0d53d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodelistindexequalzero.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodelistindexequalzero +#define test_hc_nodelistindexequalzero + +#include "dom_conf_test.hpp" + +/** + * Create a list of all the children elements of the third + * employee and access its first child by using an index + * of 0. This should result in the whitspace before "em" being + * selected (em when ignoring whitespace). + * Further we evaluate its content(by using + * the "getNodeName()" method) to ensure the proper + * element was accessed. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodelistindexequalzero : public DOMTestCase +{ + public: + hc_nodelistindexequalzero(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + int length; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + length = (int) employeeList.getLength(); + child = employeeList.item(0); + childName = child.getNodeName(); + + if (equals(13, length)) { + assertEquals("#text", childName); + } else { + assertEquals("em", childName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexequalzero"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodelistindexgetlength.hpp b/tests/DOM/conformance/level1/core/hc_nodelistindexgetlength.hpp new file mode 100644 index 00000000..db36d864 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodelistindexgetlength.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodelistindexgetlength +#define test_hc_nodelistindexgetlength + +#include "dom_conf_test.hpp" + +/** + * The "getLength()" method returns the number of nodes + * in the list. + * + * Create a list of all the children elements of the third + * employee and invoke the "getLength()" method. + * It should contain the value 13. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodelistindexgetlength : public DOMTestCase +{ + public: + hc_nodelistindexgetlength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + int length; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + length = (int) employeeList.getLength(); + + if (equals(6, length)) { + assertEquals(6, length); + } else { + assertEquals(13, length); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexgetlength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodelistindexgetlengthofemptylist.hpp b/tests/DOM/conformance/level1/core/hc_nodelistindexgetlengthofemptylist.hpp new file mode 100644 index 00000000..9f64773f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodelistindexgetlengthofemptylist.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodelistindexgetlengthofemptylist +#define test_hc_nodelistindexgetlengthofemptylist + +#include "dom_conf_test.hpp" + +/** + * The "getLength()" method returns the number of nodes + * in the list.(Test for EMPTY list) + * + * Create a list of all the children of the Text node + * inside the first child of the third employee and + * invoke the "getLength()" method. It should contain + * the value 0. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodelistindexgetlengthofemptylist : public DOMTestCase +{ + public: + hc_nodelistindexgetlengthofemptylist(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList emList; + Node emNode; + Node textNode; + NodeList textList; + int length; + doc = (Document) load("hc_staff", false); + emList = doc.getElementsByTagName(SA::construct_from_utf8("em")); + emNode = emList.item(2); + textNode = emNode.getFirstChild(); + textList = textNode.getChildNodes(); + length = (int) textList.getLength(); + assertEquals(0, length); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexgetlengthofemptylist"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodelistindexnotzero.hpp b/tests/DOM/conformance/level1/core/hc_nodelistindexnotzero.hpp new file mode 100644 index 00000000..23b2d635 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodelistindexnotzero.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodelistindexnotzero +#define test_hc_nodelistindexnotzero + +#include "dom_conf_test.hpp" + +/** + * The items in the list are accessible via an integral + * index starting from zero. + * (Index not equal 0) + * + * Create a list of all the children elements of the third + * employee and access its fourth child by using an index + * of 3 and calling getNodeName() which should return + * "strong" (no whitespace) or "#text" (with whitespace). +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodelistindexnotzero : public DOMTestCase +{ + public: + hc_nodelistindexnotzero(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + child = employeeList.item(3); + childName = child.getNodeName(); + + if (equals("#text", childName)) { + assertEquals("#text", childName); + } else { + assertEquals("strong", childName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexnotzero"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodelistreturnfirstitem.hpp b/tests/DOM/conformance/level1/core/hc_nodelistreturnfirstitem.hpp new file mode 100644 index 00000000..a9656087 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodelistreturnfirstitem.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodelistreturnfirstitem +#define test_hc_nodelistreturnfirstitem + +#include "dom_conf_test.hpp" + +/** + * Create a list of all the children elements of the third + * employee and access its first child by invoking the + * "item(index)" method with an index=0. This should + * result in node with a nodeName of "#text" or "em". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodelistreturnfirstitem : public DOMTestCase +{ + public: + hc_nodelistreturnfirstitem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + child = employeeList.item(0); + childName = child.getNodeName(); + + if (equals("#text", childName)) { + assertEquals("#text", childName); + } else { + assertEquals("em", childName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistreturnfirstitem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodelistreturnlastitem.hpp b/tests/DOM/conformance/level1/core/hc_nodelistreturnlastitem.hpp new file mode 100644 index 00000000..c88c8a8b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodelistreturnlastitem.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodelistreturnlastitem +#define test_hc_nodelistreturnlastitem + +#include "dom_conf_test.hpp" + +/** + * Create a list of all the children elements of the third + * employee and access its last child by invoking the + * "item(index)" method with an index=length-1. This should + * result in node with nodeName="#text" or acronym. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodelistreturnlastitem : public DOMTestCase +{ + public: + hc_nodelistreturnlastitem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + int index; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + index = (int) employeeList.getLength(); + index -= 1; + child = employeeList.item(((int) /*int */index)); + childName = child.getNodeName(); + + if (equals(12, index)) { + assertEquals("#text", childName); + } else { + assertEquals("acronym", childName); + assertEquals(5, index); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistreturnlastitem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodelisttraverselist.hpp b/tests/DOM/conformance/level1/core/hc_nodelisttraverselist.hpp new file mode 100644 index 00000000..f76ad943 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodelisttraverselist.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodelisttraverselist +#define test_hc_nodelisttraverselist + +#include "dom_conf_test.hpp" + +/** + * The range of valid child node indices is 0 thru length -1 + * + * Create a list of all the children elements of the third + * employee and traverse the list from index=0 thru + * length -1. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodelisttraverselist : public DOMTestCase +{ + public: + hc_nodelisttraverselist(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + int nodeType; + std::vector result; + + std::vector expected; + expected.push_back(SA::construct_from_utf8("em")); + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("acronym")); + + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + for (int indexN65651 = 0; indexN65651 != employeeList.getLength(); indexN65651++) { + child = (Node) employeeList.item(indexN65651); + nodeType = (int) child.getNodeType(); + childName = child.getNodeName(); + + if (equals(1, nodeType)) { + result.push_back(childName); + } else { + assertEquals(3, nodeType); + assertEquals("#text", childName); + } + + } + assertEquals(expected, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelisttraverselist"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeparentnode.hpp b/tests/DOM/conformance/level1/core/hc_nodeparentnode.hpp new file mode 100644 index 00000000..459cb22a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeparentnode.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeparentnode +#define test_hc_nodeparentnode + +#include "dom_conf_test.hpp" + +/** + * The "getParentNode()" method returns the parent + * of this node. + * + * Retrieve the second employee and invoke the + * "getParentNode()" method on this node. It should + * be set to "body". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +*/ + +template +class hc_nodeparentnode : public DOMTestCase +{ + public: + hc_nodeparentnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node parentNode; + String parentName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + parentNode = employeeNode.getParentNode(); + parentName = parentNode.getNodeName(); + assertEquals("body", parentName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeparentnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodeparentnodenull.hpp b/tests/DOM/conformance/level1/core/hc_nodeparentnodenull.hpp new file mode 100644 index 00000000..609e6dc5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodeparentnodenull.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodeparentnodenull +#define test_hc_nodeparentnodenull + +#include "dom_conf_test.hpp" + +/** + * The "getParentNode()" method invoked on a node that has + * just been created and not yet added to the tree is null. + * Create a new "employee" Element node using the + * "createElement(name)" method from the Document interface. + * Since this new node has not yet been added to the tree, + * the "getParentNode()" method will return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodeparentnodenull : public DOMTestCase +{ + public: + hc_nodeparentnodenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element createdNode; + Node parentNode; + doc = (Document) load("hc_staff", false); + createdNode = doc.createElement(SA::construct_from_utf8("br")); + parentNode = createdNode.getParentNode(); + assertNull(parentNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeparentnodenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_noderemovechild.hpp b/tests/DOM/conformance/level1/core/hc_noderemovechild.hpp new file mode 100644 index 00000000..021adc1a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_noderemovechild.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_noderemovechild +#define test_hc_noderemovechild + +#include "dom_conf_test.hpp" + +/** + * The "removeChild(oldChild)" method removes the child node + * indicated by "oldChild" from the list of children and + * returns it. + * + * Remove the first employee by invoking the + * "removeChild(oldChild)" method an checking the + * node returned by the "getParentNode()" method. It + * should be set to null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_noderemovechild : public DOMTestCase +{ + public: + hc_noderemovechild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + NodeList childList; + Node childToRemove; + Node removedChild; + Node parentNode; + doc = (Document) load("hc_staff", true); + rootNode = doc.getDocumentElement(); + childList = rootNode.getChildNodes(); + childToRemove = childList.item(1); + removedChild = rootNode.removeChild(childToRemove); + parentNode = removedChild.getParentNode(); + assertNull(parentNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_noderemovechildgetnodename.hpp b/tests/DOM/conformance/level1/core/hc_noderemovechildgetnodename.hpp new file mode 100644 index 00000000..80918d03 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_noderemovechildgetnodename.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_noderemovechildgetnodename +#define test_hc_noderemovechildgetnodename + +#include "dom_conf_test.hpp" + +/** + * The "removeChild(oldChild)" method returns + * the node being removed. + * + * Remove the first child of the second employee + * and check the NodeName returned by the + * "removeChild(oldChild)" method. The returned node + * should have a NodeName equal to "#text". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_noderemovechildgetnodename : public DOMTestCase +{ + public: + hc_noderemovechildgetnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node removedChild; + String childName; + String oldName; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + oldChild = childList.item(0); + oldName = oldChild.getNodeName(); + removedChild = employeeNode.removeChild(oldChild); + assertNotNull(removedChild); + childName = removedChild.getNodeName(); + assertEquals(oldName, childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildgetnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_noderemovechildnode.hpp b/tests/DOM/conformance/level1/core/hc_noderemovechildnode.hpp new file mode 100644 index 00000000..46337417 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_noderemovechildnode.hpp @@ -0,0 +1,134 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_noderemovechildnode +#define test_hc_noderemovechildnode + +#include "dom_conf_test.hpp" + +/** + * The "removeChild(oldChild)" method removes the node + * indicated by "oldChild". + * + * Retrieve the second p element and remove its first child. + * After the removal, the second p element should have 5 element + * children and the first child should now be the child + * that used to be at the second position in the list. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_noderemovechildnode : public DOMTestCase +{ + public: + hc_noderemovechildnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + NodeList emList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node child; + String childName; + Node removedChild; + String removedName; + int nodeType; + std::vector expected; + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("acronym")); + + std::vector actual; + + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + emList = ((Element) /*Node */employeeNode).getElementsByTagName(SA::construct_from_utf8("em")); + oldChild = emList.item(0); + removedChild = employeeNode.removeChild(oldChild); + removedName = removedChild.getNodeName(); + assertEquals("em", removedName); + for (int indexN65684 = 0; indexN65684 != childList.getLength(); indexN65684++) { + child = (Node) childList.item(indexN65684); + nodeType = (int) child.getNodeType(); + childName = child.getNodeName(); + + if (equals(1, nodeType)) { + actual.push_back(childName); + } else { + assertEquals(3, nodeType); + assertEquals("#text", childName); + } + + } + assertEquals(expected, actual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_noderemovechildoldchildnonexistent.hpp b/tests/DOM/conformance/level1/core/hc_noderemovechildoldchildnonexistent.hpp new file mode 100644 index 00000000..23e0091c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_noderemovechildoldchildnonexistent.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_noderemovechildoldchildnonexistent +#define test_hc_noderemovechildoldchildnonexistent + +#include "dom_conf_test.hpp" + +/** + * The "removeChild(oldChild)" method raises a + * NOT_FOUND_ERR DOMException if the old child is + * not a child of this node. + * + * Retrieve the second employee and attempt to remove a + * node that is not one of its children. An attempt to + * remove such a node should raise the desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_noderemovechildoldchildnonexistent : public DOMTestCase +{ + public: + hc_noderemovechildoldchildnonexistent(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node oldChild; + NodeList elementList; + Node elementNode; + Node removedChild; + doc = (Document) load("hc_staff", true); + oldChild = doc.createElement(SA::construct_from_utf8("br")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + elementNode = elementList.item(1); + + { + boolean success = false; + try { + removedChild = elementNode.removeChild(oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildoldchildnonexistent"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodereplacechild.hpp b/tests/DOM/conformance/level1/core/hc_nodereplacechild.hpp new file mode 100644 index 00000000..4e65b36d --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodereplacechild.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodereplacechild +#define test_hc_nodereplacechild + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method replaces + * the node "oldChild" with the node "newChild". + * + * Replace the first element of the second employee with + * a newly created Element node. Check the first position + * after the replacement operation is completed. The new + * Element should be "newChild". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodereplacechild : public DOMTestCase +{ + public: + hc_nodereplacechild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node newChild; + Node child; + String childName; + Node replacedNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + oldChild = childList.item(0); + newChild = doc.createElement(SA::construct_from_utf8("br")); + replacedNode = employeeNode.replaceChild(newChild, oldChild); + child = childList.item(0); + childName = child.getNodeName(); + assertEquals("br", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodereplacechildinvalidnodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodereplacechildinvalidnodetype.hpp new file mode 100644 index 00000000..96bc74b0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodereplacechildinvalidnodetype.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodereplacechildinvalidnodetype +#define test_hc_nodereplacechildinvalidnodetype + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if this node is of + * a type that does not allow children of the type "newChild" + * to be inserted. + * + * Retrieve the root node and attempt to replace + * one of its children with a newly created Attr node. + * An Element node cannot have children of the "Attr" + * type, therefore the desired exception should be raised. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=406 +*/ + +template +class hc_nodereplacechildinvalidnodetype : public DOMTestCase +{ + public: + hc_nodereplacechildinvalidnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + Node newChild; + NodeList elementList; + Node oldChild; + Node replacedChild; + doc = (Document) load("hc_staff", true); + newChild = doc.createAttribute(SA::construct_from_utf8("lang")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + oldChild = elementList.item(1); + rootNode = (Element) oldChild.getParentNode(); + + { + boolean success = false; + try { + replacedChild = rootNode.replaceChild(newChild, oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildinvalidnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodereplacechildnewchilddiffdocument.hpp b/tests/DOM/conformance/level1/core/hc_nodereplacechildnewchilddiffdocument.hpp new file mode 100644 index 00000000..c205e8aa --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodereplacechildnewchilddiffdocument.hpp @@ -0,0 +1,120 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodereplacechildnewchilddiffdocument +#define test_hc_nodereplacechildnewchilddiffdocument + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method raises a + * WRONG_DOCUMENT_ERR DOMException if the "newChild" was + * created from a different document than the one that + * created this node. + * + * Retrieve the second employee and attempt to replace one + * of its children with a node created from a different + * document. An attempt to make such a replacement + * should raise the desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodereplacechildnewchilddiffdocument : public DOMTestCase +{ + public: + hc_nodereplacechildnewchilddiffdocument(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + Node oldChild; + Node newChild; + NodeList elementList; + Node elementNode; + Node replacedChild; + doc1 = (Document) load("hc_staff", false); + doc2 = (Document) load("hc_staff", true); + newChild = doc1.createElement(SA::construct_from_utf8("br")); + elementList = doc2.getElementsByTagName(SA::construct_from_utf8("p")); + elementNode = elementList.item(1); + oldChild = elementNode.getFirstChild(); + + { + boolean success = false; + try { + replacedChild = elementNode.replaceChild(newChild, oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchilddiffdocument"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodereplacechildnewchildexists.hpp b/tests/DOM/conformance/level1/core/hc_nodereplacechildnewchildexists.hpp new file mode 100644 index 00000000..2d7fdda5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodereplacechildnewchildexists.hpp @@ -0,0 +1,130 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodereplacechildnewchildexists +#define test_hc_nodereplacechildnewchildexists + +#include "dom_conf_test.hpp" + +/** + * If the "newChild" is already in the tree, it is first + * removed before the new one is added. + * + * Retrieve the second "p" and replace "acronym" with its "em". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ + +template +class hc_nodereplacechildnewchildexists : public DOMTestCase +{ + public: + hc_nodereplacechildnewchildexists(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node newChild; + Node child; + String childName; + Node childNode; + std::vector actual; + + std::vector expected; + expected.push_back(SA::construct_from_utf8("strong")); + expected.push_back(SA::construct_from_utf8("code")); + expected.push_back(SA::construct_from_utf8("sup")); + expected.push_back(SA::construct_from_utf8("var")); + expected.push_back(SA::construct_from_utf8("em")); + + Node replacedChild; + int nodeType; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = ((Element) /*Node */employeeNode).getElementsByTagName(SA::construct_from_utf8("*")); + newChild = childList.item(0); + oldChild = childList.item(5); + replacedChild = employeeNode.replaceChild(newChild, oldChild); + assertSame(oldChild, replacedChild); +for (int indexN65684 = 0; indexN65684 != childList.getLength(); indexN65684++) { + childNode = (Node) childList.item(indexN65684); + childName = childNode.getNodeName(); + nodeType = (int) childNode.getNodeType(); + + if (equals(1, nodeType)) { + actual.push_back(childName); + } else { + assertEquals(3, nodeType); + assertEquals("#text", childName); + } + + } + assertEquals(expected, actual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchildexists"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodereplacechildnodeancestor.hpp b/tests/DOM/conformance/level1/core/hc_nodereplacechildnodeancestor.hpp new file mode 100644 index 00000000..00019025 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodereplacechildnodeancestor.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodereplacechildnodeancestor +#define test_hc_nodereplacechildnodeancestor + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if the node to put + * in is one of this node's ancestors. + * + * Retrieve the second employee and attempt to replace + * one of its children with an ancestor node(root node). + * An attempt to make such a replacement should raise the + * desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ + +template +class hc_nodereplacechildnodeancestor : public DOMTestCase +{ + public: + hc_nodereplacechildnodeancestor(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newChild; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node replacedNode; + doc = (Document) load("hc_staff", true); + newChild = doc.getDocumentElement(); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + oldChild = childList.item(0); + + { + boolean success = false; + try { + replacedNode = employeeNode.replaceChild(newChild, oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnodeancestor"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodereplacechildnodename.hpp b/tests/DOM/conformance/level1/core/hc_nodereplacechildnodename.hpp new file mode 100644 index 00000000..e13fb6a4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodereplacechildnodename.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodereplacechildnodename +#define test_hc_nodereplacechildnodename + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method returns + * the node being replaced. + * + * Replace the second Element of the second employee with + * a newly created node Element and check the NodeName + * returned by the "replaceChild(newChild,oldChild)" + * method. The returned node should have a NodeName equal + * to "em". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodereplacechildnodename : public DOMTestCase +{ + public: + hc_nodereplacechildnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node newChild; + Node replacedNode; + String childName; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + employeeNode = elementList.item(1); + childList = ((Element) /*Node */employeeNode).getElementsByTagName(SA::construct_from_utf8("em")); + oldChild = childList.item(0); + newChild = doc.createElement(SA::construct_from_utf8("br")); + replacedNode = employeeNode.replaceChild(newChild, oldChild); + childName = replacedNode.getNodeName(); + assertEquals("em", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodereplacechildoldchildnonexistent.hpp b/tests/DOM/conformance/level1/core/hc_nodereplacechildoldchildnonexistent.hpp new file mode 100644 index 00000000..61bc776e --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodereplacechildoldchildnonexistent.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodereplacechildoldchildnonexistent +#define test_hc_nodereplacechildoldchildnonexistent + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method raises a + * NOT_FOUND_ERR DOMException if the old child is + * not a child of this node. + * + * Retrieve the second employee and attempt to replace a + * node that is not one of its children. An attempt to + * replace such a node should raise the desired exception. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ + +template +class hc_nodereplacechildoldchildnonexistent : public DOMTestCase +{ + public: + hc_nodereplacechildoldchildnonexistent(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node oldChild; + Node newChild; + NodeList elementList; + Node elementNode; + Node replacedNode; + doc = (Document) load("hc_staff", true); + newChild = doc.createElement(SA::construct_from_utf8("br")); + oldChild = doc.createElement(SA::construct_from_utf8("b")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("p")); + elementNode = elementList.item(1); + + { + boolean success = false; + try { + replacedNode = elementNode.replaceChild(newChild, oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildoldchildnonexistent"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodetextnodeattribute.hpp b/tests/DOM/conformance/level1/core/hc_nodetextnodeattribute.hpp new file mode 100644 index 00000000..c0f4769c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodetextnodeattribute.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodetextnodeattribute +#define test_hc_nodetextnodeattribute + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a Text + * Node returns null. + * Retrieve the Text node from the last child of the + * first employee and invoke the "getAttributes()" method + * on the Text Node. It should return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772 +*/ + +template +class hc_nodetextnodeattribute : public DOMTestCase +{ + public: + hc_nodetextnodeattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testAddr; + Node textNode; + NamedNodeMap attrList; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = elementList.item(0); + textNode = testAddr.getFirstChild(); + attrList = textNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodeattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodetextnodename.hpp b/tests/DOM/conformance/level1/core/hc_nodetextnodename.hpp new file mode 100644 index 00000000..a85a7a64 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodetextnodename.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodetextnodename +#define test_hc_nodetextnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * Text Node is "#text". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class hc_nodetextnodename : public DOMTestCase +{ + public: + hc_nodetextnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Node textNode; + String textName; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = (Element) elementList.item(0); + textNode = testAddr.getFirstChild(); + textName = textNode.getNodeName(); + assertEquals("#text", textName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodetextnodetype.hpp b/tests/DOM/conformance/level1/core/hc_nodetextnodetype.hpp new file mode 100644 index 00000000..4a34b6a3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodetextnodetype.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodetextnodetype +#define test_hc_nodetextnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a Text Node + * returns the constant value 3. + * + * Retrieve the Text node from the last child of + * the first employee and invoke the "getNodeType()" + * method. The method should return 3. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class hc_nodetextnodetype : public DOMTestCase +{ + public: + hc_nodetextnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Node textNode; + int nodeType; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = (Element) elementList.item(0); + textNode = testAddr.getFirstChild(); + nodeType = (int) textNode.getNodeType(); + assertEquals(3, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodetextnodevalue.hpp b/tests/DOM/conformance/level1/core/hc_nodetextnodevalue.hpp new file mode 100644 index 00000000..2b3cbf5c --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodetextnodevalue.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodetextnodevalue +#define test_hc_nodetextnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * Text Node is the content of the Text node. + * + * Retrieve the Text node from the last child of the first + * employee and check the string returned by the + * "getNodeValue()" method. It should be equal to + * "1230 North Ave. Dallas, Texas 98551". +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class hc_nodetextnodevalue : public DOMTestCase +{ + public: + hc_nodetextnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Node textNode; + String textValue; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + testAddr = (Element) elementList.item(0); + textNode = testAddr.getFirstChild(); + textValue = textNode.getNodeValue(); + assertEquals("1230 North Ave. Dallas, Texas 98551", textValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodevalue01.hpp b/tests/DOM/conformance/level1/core/hc_nodevalue01.hpp new file mode 100644 index 00000000..ae82fc15 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodevalue01.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodevalue01 +#define test_hc_nodevalue01 + +#include "dom_conf_test.hpp" + +/** + * An element is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ + +template +class hc_nodevalue01 : public DOMTestCase +{ + public: + hc_nodevalue01(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element newNode; + String newValue; + doc = (Document) load("hc_staff", true); + newNode = doc.createElement(SA::construct_from_utf8("acronym")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue01"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodevalue02.hpp b/tests/DOM/conformance/level1/core/hc_nodevalue02.hpp new file mode 100644 index 00000000..403510ea --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodevalue02.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodevalue02 +#define test_hc_nodevalue02 + +#include "dom_conf_test.hpp" + +/** + * An comment is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +*/ + +template +class hc_nodevalue02 : public DOMTestCase +{ + public: + hc_nodevalue02(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("hc_staff", true); + newNode = doc.createComment(SA::construct_from_utf8("This is a new Comment node")); + newValue = newNode.getNodeValue(); + assertEquals("This is a new Comment node", newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have an effect")); + newValue = newNode.getNodeValue(); + assertEquals("This should have an effect", newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue02"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodevalue03.hpp b/tests/DOM/conformance/level1/core/hc_nodevalue03.hpp new file mode 100644 index 00000000..87e9cb0b --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodevalue03.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodevalue03 +#define test_hc_nodevalue03 + +#include "dom_conf_test.hpp" + +/** + * An entity reference is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490 +*/ + +template +class hc_nodevalue03 : public DOMTestCase +{ + public: + hc_nodevalue03(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("hc_staff", true); + + if (("text/html" == getContentType())) { + + { + boolean success = false; + try { + newNode = doc.createEntityReference(SA::construct_from_utf8("ent1")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_SUPPORTED_ERR); + } + assertTrue(success); + } +} else { + newNode = doc.createEntityReference(SA::construct_from_utf8("ent1")); + assertNotNull(newNode); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue03"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodevalue04.hpp b/tests/DOM/conformance/level1/core/hc_nodevalue04.hpp new file mode 100644 index 00000000..123e0310 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodevalue04.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodevalue04 +#define test_hc_nodevalue04 + +#include "dom_conf_test.hpp" + +/** + * An document type accessed, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +*/ + +template +class hc_nodevalue04 : public DOMTestCase +{ + public: + hc_nodevalue04(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("hc_staff", true); + newNode = doc.getDoctype(); + assertTrue( + ((notNull(newNode)) | ("text/html" == getContentType())) +); + + if ((notNull(newNode))) { + assertNotNull(newNode); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue04"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodevalue05.hpp b/tests/DOM/conformance/level1/core/hc_nodevalue05.hpp new file mode 100644 index 00000000..38e58dda --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodevalue05.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodevalue05 +#define test_hc_nodevalue05 + +#include "dom_conf_test.hpp" + +/** + * A document fragment is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ + +template +class hc_nodevalue05 : public DOMTestCase +{ + public: + hc_nodevalue05(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("hc_staff", true); + newNode = doc.createDocumentFragment(); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue05"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodevalue06.hpp b/tests/DOM/conformance/level1/core/hc_nodevalue06.hpp new file mode 100644 index 00000000..c2135381 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodevalue06.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodevalue06 +#define test_hc_nodevalue06 + +#include "dom_conf_test.hpp" + +/** + * An document is accessed, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ + +template +class hc_nodevalue06 : public DOMTestCase +{ + public: + hc_nodevalue06(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document newNode; + String newValue; + newNode = (Document) load("hc_staff", true); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue06"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodevalue07.hpp b/tests/DOM/conformance/level1/core/hc_nodevalue07.hpp new file mode 100644 index 00000000..1e7fd35f --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodevalue07.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodevalue07 +#define test_hc_nodevalue07 + +#include "dom_conf_test.hpp" + +/** + * An Entity is accessed, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2 +*/ + +template +class hc_nodevalue07 : public DOMTestCase +{ + public: + hc_nodevalue07(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + NamedNodeMap nodeMap; + DocumentType docType; + doc = (Document) load("hc_staff", true); + docType = doc.getDoctype(); + + if ( + !(("text/html" == getContentType())) +) { + assertNotNull(docType); + nodeMap = docType.getEntities(); + assertNotNull(nodeMap); + newNode = nodeMap.getNamedItem(SA::construct_from_utf8("alpha")); + assertNotNull(newNode); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue07"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_nodevalue08.hpp b/tests/DOM/conformance/level1/core/hc_nodevalue08.hpp new file mode 100644 index 00000000..58075ccd --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_nodevalue08.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_nodevalue08 +#define test_hc_nodevalue08 + +#include "dom_conf_test.hpp" + +/** + * An notation is accessed, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9 +*/ + +template +class hc_nodevalue08 : public DOMTestCase +{ + public: + hc_nodevalue08(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + Node newNode; + String newValue; + NamedNodeMap nodeMap; + doc = (Document) load("hc_staff", true); + docType = doc.getDoctype(); + + if ( + !(("text/html" == getContentType())) +) { + assertNotNull(docType); + nodeMap = docType.getNotations(); + assertNotNull(nodeMap); + newNode = nodeMap.getNamedItem(SA::construct_from_utf8("notation1")); + assertNotNull(newNode); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue08"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_notationsremovenameditem1.hpp b/tests/DOM/conformance/level1/core/hc_notationsremovenameditem1.hpp new file mode 100644 index 00000000..a0a855b6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_notationsremovenameditem1.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_notationsremovenameditem1 +#define test_hc_notationsremovenameditem1 + +#include "dom_conf_test.hpp" + +/** + * An attempt to add remove an notation should result in a NO_MODIFICATION_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +*/ + +template +class hc_notationsremovenameditem1 : public DOMTestCase +{ + public: + hc_notationsremovenameditem1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NamedNodeMap notations; + DocumentType docType; + Node retval; + doc = (Document) load("hc_staff", true); + docType = doc.getDoctype(); + + if ( + !(("text/html" == getContentType())) +) { + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + + { + boolean success = false; + try { + retval = notations.removeNamedItem(SA::construct_from_utf8("notation1")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } +} + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationsremovenameditem1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_notationssetnameditem1.hpp b/tests/DOM/conformance/level1/core/hc_notationssetnameditem1.hpp new file mode 100644 index 00000000..5d9084c1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_notationssetnameditem1.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_notationssetnameditem1 +#define test_hc_notationssetnameditem1 + +#include "dom_conf_test.hpp" + +/** + * An attempt to add an element to the named node map returned by notations should + * result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +*/ + +template +class hc_notationssetnameditem1 : public DOMTestCase +{ + public: + hc_notationssetnameditem1(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NamedNodeMap notations; + DocumentType docType; + Node retval; + Element elem; + doc = (Document) load("hc_staff", true); + docType = doc.getDoctype(); + + if ( + !(("text/html" == getContentType())) +) { + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + elem = doc.createElement(SA::construct_from_utf8("br")); + + try { + retval = notations.setNamedItem(elem); + fail("throw_HIER_OR_NO_MOD_ERR"); + + } catch (DOMException ex) { + switch (ex.code()) { + case 3 : + break; + case 7 : + break; + default: + throw ex; + } + } +} + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationssetnameditem1"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_textindexsizeerrnegativeoffset.hpp b/tests/DOM/conformance/level1/core/hc_textindexsizeerrnegativeoffset.hpp new file mode 100644 index 00000000..c82b3bd9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_textindexsizeerrnegativeoffset.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_textindexsizeerrnegativeoffset +#define test_hc_textindexsizeerrnegativeoffset + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset is + * negative. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The desired exception should be raised since the offset + * is a negative number. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class hc_textindexsizeerrnegativeoffset : public DOMTestCase +{ + public: + hc_textindexsizeerrnegativeoffset(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + + { + boolean success = false; + try { + splitNode = textNode.splitText(-69); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textindexsizeerrnegativeoffset"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_textindexsizeerroffsetoutofbounds.hpp b/tests/DOM/conformance/level1/core/hc_textindexsizeerroffsetoutofbounds.hpp new file mode 100644 index 00000000..0e2dd7bb --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_textindexsizeerroffsetoutofbounds.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_textindexsizeerroffsetoutofbounds +#define test_hc_textindexsizeerroffsetoutofbounds + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset is + * greater than the number of characters in the Text node. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The desired exception should be raised since the offset + * is a greater than the number of characters in the Text + * node. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class hc_textindexsizeerroffsetoutofbounds : public DOMTestCase +{ + public: + hc_textindexsizeerroffsetoutofbounds(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + + { + boolean success = false; + try { + splitNode = textNode.splitText(300); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textindexsizeerroffsetoutofbounds"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_textparseintolistofelements.hpp b/tests/DOM/conformance/level1/core/hc_textparseintolistofelements.hpp new file mode 100644 index 00000000..41e615d2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_textparseintolistofelements.hpp @@ -0,0 +1,136 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_textparseintolistofelements +#define test_hc_textparseintolistofelements + +#include "dom_conf_test.hpp" + +/** + * Retrieve the textual data from the last child of the + * second employee. That node is composed of two + * EntityReference nodes and two Text nodes. After + * the content node is parsed, the "acronym" Element + * should contain four children with each one of the + * EntityReferences containing one child. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-745549614 +*/ + +template +class hc_textparseintolistofelements : public DOMTestCase +{ + public: + hc_textparseintolistofelements(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node addressNode; + NodeList childList; + Node child; + String value; + Node grandChild; + int length; + std::vector result; + + std::vector expectedNormal; + expectedNormal.push_back(SA::construct_from_utf8("β")); + expectedNormal.push_back(SA::construct_from_utf8(" Dallas, ")); + expectedNormal.push_back(SA::construct_from_utf8("γ")); + expectedNormal.push_back(SA::construct_from_utf8("\n 98554")); + + std::vector expectedExpanded; + expectedExpanded.push_back(SA::construct_from_utf8("β Dallas, γ\n 98554")); + + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + addressNode = elementList.item(1); + childList = addressNode.getChildNodes(); + length = (int) childList.getLength(); + for (int indexN65660 = 0; indexN65660 != childList.getLength(); indexN65660++) { + child = (Node) childList.item(indexN65660); + value = child.getNodeValue(); + + if ((isNull(value))) { + grandChild = child.getFirstChild(); + assertNotNull(grandChild); + value = grandChild.getNodeValue(); + result.push_back(value); + } else { + result.push_back(value); + } + + } + + if (equals(1, length)) { + assertEquals(expectedExpanded, result); + } else { + assertEquals(expectedNormal, result); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textparseintolistofelements"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_textsplittextfour.hpp b/tests/DOM/conformance/level1/core/hc_textsplittextfour.hpp new file mode 100644 index 00000000..dad893bd --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_textsplittextfour.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_textsplittextfour +#define test_hc_textsplittextfour + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method returns the new Text node. + * + * Retrieve the textual data from the last child of the + * first employee and invoke the "splitText(offset)" method. + * The method should return the new Text node. The offset + * value used for this test is 30. The "getNodeValue()" + * method is called to check that the new node now contains + * the characters at and after position 30. + * (Starting count at 0) +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class hc_textsplittextfour : public DOMTestCase +{ + public: + hc_textsplittextfour(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node addressNode; + Text textNode; + Text splitNode; + String value; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); + addressNode = elementList.item(0); + textNode = (Text) addressNode.getFirstChild(); + splitNode = textNode.splitText(30); + value = splitNode.getNodeValue(); + assertEquals("98551", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextfour"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_textsplittextone.hpp b/tests/DOM/conformance/level1/core/hc_textsplittextone.hpp new file mode 100644 index 00000000..3e1182b3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_textsplittextone.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_textsplittextone +#define test_hc_textsplittextone + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method breaks the Text node into + * two Text nodes at the specified offset keeping each node + * as siblings in the tree. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The method splits the Text node into two new sibling + * Text nodes keeping both of them in the tree. This test + * checks the "nextSibling()" method of the original node + * to ensure that the two nodes are indeed siblings. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class hc_textsplittextone : public DOMTestCase +{ + public: + hc_textsplittextone(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + Node secondPart; + String value; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + splitNode = textNode.splitText(7); + secondPart = textNode.getNextSibling(); + value = secondPart.getNodeValue(); + assertEquals("Jones", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextone"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_textsplittextthree.hpp b/tests/DOM/conformance/level1/core/hc_textsplittextthree.hpp new file mode 100644 index 00000000..c28fc9bd --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_textsplittextthree.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_textsplittextthree +#define test_hc_textsplittextthree + +#include "dom_conf_test.hpp" + +/** + * After the "splitText(offset)" method breaks the Text node + * into two Text nodes, the new Text node contains all the + * content at and after the offset point. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The new Text node should contain all the content + * at and after the offset point. The "getNodeValue()" + * method is called to check that the new node now contains + * the characters at and after position seven. + * (Starting count at 0) +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class hc_textsplittextthree : public DOMTestCase +{ + public: + hc_textsplittextthree(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + String value; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + splitNode = textNode.splitText(6); + value = splitNode.getNodeValue(); + assertEquals(" Jones", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextthree"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_textsplittexttwo.hpp b/tests/DOM/conformance/level1/core/hc_textsplittexttwo.hpp new file mode 100644 index 00000000..c3a0c1da --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_textsplittexttwo.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_textsplittexttwo +#define test_hc_textsplittexttwo + +#include "dom_conf_test.hpp" + +/** + * After the "splitText(offset)" method breaks the Text node + * into two Text nodes, the original node contains all the + * content up to the offset point. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The original Text node should contain all the content + * up to the offset point. The "getNodeValue()" method + * is called to check that the original node now contains + * the first five characters. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class hc_textsplittexttwo : public DOMTestCase +{ + public: + hc_textsplittexttwo(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + String value; + doc = (Document) load("hc_staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + splitNode = textNode.splitText(5); + value = textNode.getNodeValue(); + assertEquals("Roger", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittexttwo"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/hc_textwithnomarkup.hpp b/tests/DOM/conformance/level1/core/hc_textwithnomarkup.hpp new file mode 100644 index 00000000..206da34a --- /dev/null +++ b/tests/DOM/conformance/level1/core/hc_textwithnomarkup.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_hc_textwithnomarkup +#define test_hc_textwithnomarkup + +#include "dom_conf_test.hpp" + +/** + * If there is not any markup inside an Element or Attr node + * content, then the text is contained in a single object + * implementing the Text interface that is the only child + * of the element. + * + * Retrieve the textual data from the second child of the + * third employee. That Text node contains a block of + * multiple text lines without markup, so they should be + * treated as a single Text node. The "getNodeValue()" + * method should contain the combination of the two lines. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class hc_textwithnomarkup : public DOMTestCase +{ + public: + hc_textwithnomarkup(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "hc_staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Node nodeV; + String value; + doc = (Document) load("hc_staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("strong")); + nameNode = elementList.item(2); + nodeV = nameNode.getFirstChild(); + value = nodeV.getNodeValue(); + assertEquals("Roger\n Jones", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textwithnomarkup"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapchildnoderange.hpp b/tests/DOM/conformance/level1/core/namednodemapchildnoderange.hpp new file mode 100644 index 00000000..b30647f5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapchildnoderange.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapchildnoderange +#define test_namednodemapchildnoderange + +#include "dom_conf_test.hpp" + +/** + * The range of valid child node indices is 0 to Length -1. + * + * Create a NamedNodeMap object from the attributes of the + * last child of the third employee and traverse the + * list from index 0 thru length -1. All indices should + * be valid. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E +*/ + +template +class namednodemapchildnoderange : public DOMTestCase +{ + public: + namednodemapchildnoderange(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Node child; + int length; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = elementList.item(2); + attributes = testEmployee.getAttributes(); + length = (int) attributes.getLength(); + assertEquals(2, length); + child = attributes.item(0); + child = attributes.item(1); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapchildnoderange"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapgetnameditem.hpp b/tests/DOM/conformance/level1/core/namednodemapgetnameditem.hpp new file mode 100644 index 00000000..b256e1a0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapgetnameditem.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapgetnameditem +#define test_namednodemapgetnameditem + +#include "dom_conf_test.hpp" + +/** + * The "getNamedItem(name)" method retrieves a node + * specified by name. + * + * Retrieve the second employee and create a NamedNodeMap + * listing of the attributes of the last child. Once the + * list is created an invocation of the "getNamedItem(name)" + * method is done with name="domestic". This should result + * in the domestic Attr node being returned. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class namednodemapgetnameditem : public DOMTestCase +{ + public: + namednodemapgetnameditem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Attr domesticAttr; + String attrName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic")); + attrName = domesticAttr.getNodeName(); + assertEquals("domestic", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapgetnameditem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapinuseattributeerr.hpp b/tests/DOM/conformance/level1/core/namednodemapinuseattributeerr.hpp new file mode 100644 index 00000000..b9a02b3b --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapinuseattributeerr.hpp @@ -0,0 +1,121 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapinuseattributeerr +#define test_namednodemapinuseattributeerr + +#include "dom_conf_test.hpp" + +/** + * The "setNamedItem(arg)" method raises a + * INUSE_ATTRIBUTE_ERR DOMException if "arg" is an + * Attr that is already in an attribute of another Element. + * Create a NamedNodeMap object from the attributes of the + * last child of the third employee and attempt to add + * an attribute that is already being used by the first + * employee. This should raise the desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class namednodemapinuseattributeerr : public DOMTestCase +{ + public: + namednodemapinuseattributeerr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element firstNode; + Node testNode; + NamedNodeMap attributes; + Attr domesticAttr; + Attr setAttr; + Node setNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + firstNode = (Element) elementList.item(0); + domesticAttr = doc.createAttribute(SA::construct_from_utf8("domestic")); + domesticAttr.setValue(SA::construct_from_utf8("Yes")); + setAttr = firstNode.setAttributeNode(domesticAttr); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testNode = elementList.item(2); + attributes = testNode.getAttributes(); + + { + boolean success = false; + try { + setNode = attributes.setNamedItem(domesticAttr); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INUSE_ATTRIBUTE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapinuseattributeerr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapnotfounderr.hpp b/tests/DOM/conformance/level1/core/namednodemapnotfounderr.hpp new file mode 100644 index 00000000..2778bd84 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapnotfounderr.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapnotfounderr +#define test_namednodemapnotfounderr + +#include "dom_conf_test.hpp" + +/** + * The "removeNamedItem(name)" method raises a + * NOT_FOUND_ERR DOMException if there is not a node + * named "name" in the map. + * + * Create a NamedNodeMap object from the attributes of the + * last child of the third employee and attempt to remove + * the "district" attribute. There is not a node named + * "district" in the list and therefore the desired + * exception should be raised. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D58B193')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +*/ + +template +class namednodemapnotfounderr : public DOMTestCase +{ + public: + namednodemapnotfounderr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testEmployee; + NamedNodeMap attributes; + Node removedNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = (Element) elementList.item(2); + attributes = testEmployee.getAttributes(); + + { + boolean success = false; + try { + removedNode = attributes.removeNamedItem(SA::construct_from_utf8("district")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapnotfounderr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapnumberofnodes.hpp b/tests/DOM/conformance/level1/core/namednodemapnumberofnodes.hpp new file mode 100644 index 00000000..15ac9570 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapnumberofnodes.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapnumberofnodes +#define test_namednodemapnumberofnodes + +#include "dom_conf_test.hpp" + +/** + * The "getLength()" method returns the number of nodes + * in the map. + * + * Retrieve the second employee and create a NamedNodeMap + * listing of the attributes of the last child. Once the + * list is created an invocation of the "getLength()" + * method is executed. The number of nodes should be 2. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E +*/ + +template +class namednodemapnumberofnodes : public DOMTestCase +{ + public: + namednodemapnumberofnodes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + int length; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = elementList.item(2); + attributes = testEmployee.getAttributes(); + length = (int) attributes.getLength(); + assertEquals(2, length); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapnumberofnodes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapremovenameditem.hpp b/tests/DOM/conformance/level1/core/namednodemapremovenameditem.hpp new file mode 100644 index 00000000..45ae45c1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapremovenameditem.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapremovenameditem +#define test_namednodemapremovenameditem + +#include "dom_conf_test.hpp" + +/** + * The "removeNamedItem(name)" method removes a node + * specified by name. + * + * Retrieve the third employee and create a NamedNodeMap + * object of the attributes of the last child. Once the + * list is created invoke the "removeNamedItem(name)" + * method with name="street". This should result + * in the removal of the specified attribute and + * the "getSpecified()" method should return false. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class namednodemapremovenameditem : public DOMTestCase +{ + public: + namednodemapremovenameditem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testAddress; + NamedNodeMap attributes; + Attr streetAttr; + boolean specified; + Node removedNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = elementList.item(2); + attributes = testAddress.getAttributes(); + assertNotNull(attributes); + removedNode = attributes.removeNamedItem(SA::construct_from_utf8("street")); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + assertNotNull(streetAttr); + specified = streetAttr.getSpecified(); + assertFalse(specified); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapremovenameditem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapremovenameditemgetvalue.hpp b/tests/DOM/conformance/level1/core/namednodemapremovenameditemgetvalue.hpp new file mode 100644 index 00000000..2efe6ace --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapremovenameditemgetvalue.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapremovenameditemgetvalue +#define test_namednodemapremovenameditemgetvalue + +#include "dom_conf_test.hpp" + +/** + * If the node removed by the "removeNamedItem(name)" method + * is an Attr node with a default value it is immediately + * replaced. + * + * Retrieve the third employee and create a NamedNodeMap + * object of the attributes of the last child. Once the + * list is created invoke the "removeNamedItem(name)" + * method with name="street". The "removeNamedItem(name)" + * method should remove the "street" attribute and since + * it has a default value of "Yes", that value should + * immediately be the attributes value. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ + +template +class namednodemapremovenameditemgetvalue : public DOMTestCase +{ + public: + namednodemapremovenameditemgetvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Attr streetAttr; + String value; + Node removedNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = elementList.item(2); + attributes = testEmployee.getAttributes(); + assertNotNull(attributes); + removedNode = attributes.removeNamedItem(SA::construct_from_utf8("street")); + streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + assertNotNull(streetAttr); + value = streetAttr.getValue(); + assertEquals("Yes", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapremovenameditemgetvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapremovenameditemreturnnodevalue.hpp b/tests/DOM/conformance/level1/core/namednodemapremovenameditemreturnnodevalue.hpp new file mode 100644 index 00000000..00be03fd --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapremovenameditemreturnnodevalue.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapremovenameditemreturnnodevalue +#define test_namednodemapremovenameditemreturnnodevalue + +#include "dom_conf_test.hpp" + +/** + * The "removeNamedItem(name)" method returns the node + * removed from the map. + * + * Retrieve the third employee and create a NamedNodeMap + * object of the attributes of the last child. Once the + * list is created invoke the "removeNamedItem(name)" + * method with name="street". The "removeNamedItem(name)" + * method should remove the existing "street" attribute + * and return it. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class namednodemapremovenameditemreturnnodevalue : public DOMTestCase +{ + public: + namednodemapremovenameditemreturnnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testAddress; + NamedNodeMap attributes; + Node removedNode; + String value; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = elementList.item(2); + attributes = testAddress.getAttributes(); + removedNode = attributes.removeNamedItem(SA::construct_from_utf8("street")); + value = removedNode.getNodeValue(); + assertEquals("No", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapremovenameditemreturnnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapreturnattrnode.hpp b/tests/DOM/conformance/level1/core/namednodemapreturnattrnode.hpp new file mode 100644 index 00000000..a3ab4b6e --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapreturnattrnode.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapreturnattrnode +#define test_namednodemapreturnattrnode + +#include "dom_conf_test.hpp" + +/** + * The "getNamedItem(name)" method returns a node of any + * type specified by name. + * + * Retrieve the second employee and create a NamedNodeMap + * listing of the attributes of the last child. Once the + * list is created an invocation of the "getNamedItem(name)" + * method is done with name="street". This should result + * in the method returning an Attr node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403 +*/ + +template +class namednodemapreturnattrnode : public DOMTestCase +{ + public: + namednodemapreturnattrnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Node streetAttr; + String attrName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + streetAttr = attributes.getNamedItem(SA::construct_from_utf8("street")); + static_cast(streetAttr); // this will throw if the type is wrong +attrName = streetAttr.getNodeName(); + assertEquals("street", attrName); + attrName = ((Attr) /*Node */streetAttr).getName(); + assertEquals("street", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapreturnattrnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapreturnfirstitem.hpp b/tests/DOM/conformance/level1/core/namednodemapreturnfirstitem.hpp new file mode 100644 index 00000000..ca71386b --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapreturnfirstitem.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapreturnfirstitem +#define test_namednodemapreturnfirstitem + +#include "dom_conf_test.hpp" + +/** + * The "item(index)" method returns the indexth item in + * the map(test for first item). + * + * Retrieve the second employee and create a NamedNodeMap + * listing of the attributes of the last child. Since the + * DOM does not specify an order of these nodes the contents + * of the FIRST node can contain either "domestic" or "street". + * The test should return "true" if the FIRST node is either + * of these values. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class namednodemapreturnfirstitem : public DOMTestCase +{ + public: + namednodemapreturnfirstitem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testAddress; + NamedNodeMap attributes; + Node child; + String name; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = elementList.item(1); + attributes = testAddress.getAttributes(); + child = attributes.item(0); + name = child.getNodeName(); + assertTrue( + (equals("domestic", name) | equals("street", name)) +); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapreturnfirstitem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapreturnlastitem.hpp b/tests/DOM/conformance/level1/core/namednodemapreturnlastitem.hpp new file mode 100644 index 00000000..f30507c4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapreturnlastitem.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapreturnlastitem +#define test_namednodemapreturnlastitem + +#include "dom_conf_test.hpp" + +/** + * The "item(index)" method returns the indexth item in + * the map(test for last item). + * + * Retrieve the second employee and create a NamedNodeMap + * listing of the attributes of the last child. Since the + * DOM does not specify an order of these nodes the contents + * of the LAST node can contain either "domestic" or "street". + * The test should return "true" if the LAST node is either + * of these values. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class namednodemapreturnlastitem : public DOMTestCase +{ + public: + namednodemapreturnlastitem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Node child; + String name; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + child = attributes.item(1); + name = child.getNodeName(); + assertTrue( + (equals("domestic", name) | equals("street", name)) +); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapreturnlastitem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapreturnnull.hpp b/tests/DOM/conformance/level1/core/namednodemapreturnnull.hpp new file mode 100644 index 00000000..b8b6ef73 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapreturnnull.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapreturnnull +#define test_namednodemapreturnnull + +#include "dom_conf_test.hpp" + +/** + * The "getNamedItem(name)" method returns null of the + * specified name did not identify any node in the map. + * + * Retrieve the second employee and create a NamedNodeMap + * listing of the attributes of the last child. Once the + * list is created an invocation of the "getNamedItem(name)" + * method is done with name="district". This name does not + * match any names in the list therefore the method should + * return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +*/ + +template +class namednodemapreturnnull : public DOMTestCase +{ + public: + namednodemapreturnnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testEmployee; + NamedNodeMap attributes; + Attr districtNode; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testEmployee = elementList.item(1); + attributes = testEmployee.getAttributes(); + districtNode = (Attr) attributes.getNamedItem(SA::construct_from_utf8("district")); + assertNull(districtNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapreturnnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapsetnameditem.hpp b/tests/DOM/conformance/level1/core/namednodemapsetnameditem.hpp new file mode 100644 index 00000000..b0619221 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapsetnameditem.hpp @@ -0,0 +1,116 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapsetnameditem +#define test_namednodemapsetnameditem + +#include "dom_conf_test.hpp" + +/** + * The "setNamedItem(arg)" method adds a node using its + * nodeName attribute. + * + * Retrieve the second employee and create a NamedNodeMap + * object from the attributes of the last child by + * invoking the "getAttributes()" method. Once the + * list is created an invocation of the "setNamedItem(arg)" + * method is done with arg=newAttr, where newAttr is a + * new Attr Node previously created. The "setNamedItem(arg)" + * method should add then new node to the NamedNodeItem + * object by using its "nodeName" attribute("district'). + * This node is then retrieved using the "getNamedItem(name)" + * method. This test uses the "createAttribute(name)" + * method from the document interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class namednodemapsetnameditem : public DOMTestCase +{ + public: + namednodemapsetnameditem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Attr districtNode; + String attrName; + Node setNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = elementList.item(1); + newAttribute = doc.createAttribute(SA::construct_from_utf8("district")); + attributes = testAddress.getAttributes(); + setNode = attributes.setNamedItem(newAttribute); + districtNode = (Attr) attributes.getNamedItem(SA::construct_from_utf8("district")); + attrName = districtNode.getNodeName(); + assertEquals("district", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapsetnameditemreturnvalue.hpp b/tests/DOM/conformance/level1/core/namednodemapsetnameditemreturnvalue.hpp new file mode 100644 index 00000000..7d4ade39 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapsetnameditemreturnvalue.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapsetnameditemreturnvalue +#define test_namednodemapsetnameditemreturnvalue + +#include "dom_conf_test.hpp" + +/** + * If the "setNamedItem(arg)" method replaces an already + * existing node with the same name then the already + * existing node is returned. + * + * Retrieve the third employee and create a NamedNodeMap + * object from the attributes of the last child by + * invoking the "getAttributes()" method. Once the + * list is created an invocation of the "setNamedItem(arg)" + * method is done with arg=newAttr, where newAttr is a + * new Attr Node previously created and whose node name + * already exists in the map. The "setNamedItem(arg)" + * method should replace the already existing node with + * the new one and return the existing node. + * This test uses the "createAttribute(name)" method from + * the document interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class namednodemapsetnameditemreturnvalue : public DOMTestCase +{ + public: + namednodemapsetnameditemreturnvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Node newNode; + String attrValue; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("street")); + attributes = testAddress.getAttributes(); + newNode = attributes.setNamedItem(newAttribute); + attrValue = newNode.getNodeValue(); + assertEquals("No", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemreturnvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapsetnameditemthatexists.hpp b/tests/DOM/conformance/level1/core/namednodemapsetnameditemthatexists.hpp new file mode 100644 index 00000000..50c6c13e --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapsetnameditemthatexists.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapsetnameditemthatexists +#define test_namednodemapsetnameditemthatexists + +#include "dom_conf_test.hpp" + +/** + * If the node to be added by the "setNamedItem(arg)" method + * already exists in the NamedNodeMap, it is replaced by + * the new one. + * + * Retrieve the second employee and create a NamedNodeMap + * object from the attributes of the last child by + * invoking the "getAttributes()" method. Once the + * list is created an invocation of the "setNamedItem(arg)" + * method is done with arg=newAttr, where newAttr is a + * new Attr Node previously created and whose node name + * already exists in the map. The "setNamedItem(arg)" + * method should replace the already existing node with + * the new one. + * This node is then retrieved using the "getNamedItem(name)" + * method. This test uses the "createAttribute(name)" + * method from the document interface +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class namednodemapsetnameditemthatexists : public DOMTestCase +{ + public: + namednodemapsetnameditemthatexists(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Attr districtNode; + String attrValue; + Node setNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = elementList.item(1); + newAttribute = doc.createAttribute(SA::construct_from_utf8("street")); + attributes = testAddress.getAttributes(); + setNode = attributes.setNamedItem(newAttribute); + districtNode = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street")); + attrValue = districtNode.getNodeValue(); + assertEquals("", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemthatexists"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapsetnameditemwithnewvalue.hpp b/tests/DOM/conformance/level1/core/namednodemapsetnameditemwithnewvalue.hpp new file mode 100644 index 00000000..464dfeb1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapsetnameditemwithnewvalue.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapsetnameditemwithnewvalue +#define test_namednodemapsetnameditemwithnewvalue + +#include "dom_conf_test.hpp" + +/** + * If the "setNamedItem(arg)" method does not replace an + * existing node with the same name then it returns null. + * + * Retrieve the third employee and create a NamedNodeMap + * object from the attributes of the last child. + * Once the list is created the "setNamedItem(arg)" method + * is invoked with arg=newAttr, where newAttr is a + * newly created Attr Node and whose node name + * already exists in the map. The "setNamedItem(arg)" + * method should add the new node and return null. + * This test uses the "createAttribute(name)" method from + * the document interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ + +template +class namednodemapsetnameditemwithnewvalue : public DOMTestCase +{ + public: + namednodemapsetnameditemwithnewvalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Attr newAttribute; + Node testAddress; + NamedNodeMap attributes; + Node newNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = elementList.item(2); + newAttribute = doc.createAttribute(SA::construct_from_utf8("district")); + attributes = testAddress.getAttributes(); + newNode = attributes.setNamedItem(newAttribute); + assertNull(newNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemwithnewvalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/namednodemapwrongdocumenterr.hpp b/tests/DOM/conformance/level1/core/namednodemapwrongdocumenterr.hpp new file mode 100644 index 00000000..264865b4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/namednodemapwrongdocumenterr.hpp @@ -0,0 +1,122 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_namednodemapwrongdocumenterr +#define test_namednodemapwrongdocumenterr + +#include "dom_conf_test.hpp" + +/** + * The "setNamedItem(arg)" method raises a + * WRONG_DOCUMENT_ERR DOMException if "arg" was created + * from a different document than the one that created + * the NamedNodeMap. + * + * Create a NamedNodeMap object from the attributes of the + * last child of the third employee and attempt to add + * another Attr node to it that was created from a + * different DOM document. This should raise the desired + * exception. This method uses the "createAttribute(name)" + * method from the Document interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class namednodemapwrongdocumenterr : public DOMTestCase +{ + public: + namednodemapwrongdocumenterr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + NodeList elementList; + Node testAddress; + NamedNodeMap attributes; + Node newAttribute; + Node setNode; + doc1 = (Document) load("staff", true); + doc2 = (Document) load("staff", true); + elementList = doc1.getElementsByTagName(SA::construct_from_utf8("address")); + testAddress = elementList.item(2); + newAttribute = doc2.createAttribute(SA::construct_from_utf8("newAttribute")); + attributes = testAddress.getAttributes(); + + { + boolean success = false; + try { + setNode = attributes.setNamedItem(newAttribute); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapwrongdocumenterr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchild.hpp b/tests/DOM/conformance/level1/core/nodeappendchild.hpp new file mode 100644 index 00000000..4e8ce88e --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchild.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchild +#define test_nodeappendchild + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method adds the node + * "newChild" to the end of the list of children of the + * node. + * + * Retrieve the second employee and append a new Element + * node to the list of children. The last node in the list + * is then retrieved and its NodeName examined. The + * "getNodeName()" method should return "newChild". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class nodeappendchild : public DOMTestCase +{ + public: + nodeappendchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node createdNode; + Node lchild; + String childName; + Node appendedChild; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + createdNode = doc.createElement(SA::construct_from_utf8("newChild")); + appendedChild = employeeNode.appendChild(createdNode); + lchild = employeeNode.getLastChild(); + childName = lchild.getNodeName(); + assertEquals("newChild", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchildchildexists.hpp b/tests/DOM/conformance/level1/core/nodeappendchildchildexists.hpp new file mode 100644 index 00000000..d67ea285 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchildchildexists.hpp @@ -0,0 +1,121 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchildchildexists +#define test_nodeappendchildchildexists + +#include "dom_conf_test.hpp" + +/** + * If the "newChild" is already in the tree, it is first + * removed before the new one is appended. + * + * Retrieve the first child of the second employee and + * append the first child to the end of the list. After + * the "appendChild(newChild)" method is invoked the first + * child should be the one that was second and the last + * child should be the one that was first. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class nodeappendchildchildexists : public DOMTestCase +{ + public: + nodeappendchildchildexists(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node childNode; + Node newChild; + Node lchild; + Node fchild; + String lchildName; + String fchildName; + Node appendedChild; + String initialName; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + childNode = elementList.item(1); + newChild = childNode.getFirstChild(); + initialName = newChild.getNodeName(); + appendedChild = childNode.appendChild(newChild); + fchild = childNode.getFirstChild(); + fchildName = fchild.getNodeName(); + lchild = childNode.getLastChild(); + lchildName = lchild.getNodeName(); + + if (equals("employeeId", initialName)) { + assertEquals("name", fchildName); + assertEquals("employeeId", lchildName); + } else { + assertEquals("employeeId", fchildName); + assertEquals("#text", lchildName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildchildexists"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchilddocfragment.hpp b/tests/DOM/conformance/level1/core/nodeappendchilddocfragment.hpp new file mode 100644 index 00000000..8d38985b --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchilddocfragment.hpp @@ -0,0 +1,132 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchilddocfragment +#define test_nodeappendchilddocfragment + +#include "dom_conf_test.hpp" + +/** + * Create and populate a new DocumentFragment object and + * append it to the second employee. After the + * "appendChild(newChild)" method is invoked retrieve the + * new nodes at the end of the list, they should be the + * two Element nodes from the DocumentFragment. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class nodeappendchilddocfragment : public DOMTestCase +{ + public: + nodeappendchilddocfragment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + DocumentFragment newdocFragment; + Node newChild1; + Node newChild2; + Node child; + String childName; + std::vector result; + + int nodeType; + Node appendedChild; + std::vector expected; + expected.push_back(SA::construct_from_utf8("employeeId")); + expected.push_back(SA::construct_from_utf8("name")); + expected.push_back(SA::construct_from_utf8("position")); + expected.push_back(SA::construct_from_utf8("salary")); + expected.push_back(SA::construct_from_utf8("gender")); + expected.push_back(SA::construct_from_utf8("address")); + expected.push_back(SA::construct_from_utf8("newChild1")); + expected.push_back(SA::construct_from_utf8("newChild2")); + + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + newdocFragment = doc.createDocumentFragment(); + newChild1 = doc.createElement(SA::construct_from_utf8("newChild1")); + newChild2 = doc.createElement(SA::construct_from_utf8("newChild2")); + appendedChild = newdocFragment.appendChild(newChild1); + appendedChild = newdocFragment.appendChild(newChild2); + appendedChild = employeeNode.appendChild(newdocFragment); + for (int indexN65695 = 0; indexN65695 != childList.getLength(); indexN65695++) { + child = (Node) childList.item(indexN65695); + nodeType = (int) child.getNodeType(); + + if (equals(1, nodeType)) { + childName = child.getNodeName(); + result.push_back(childName); + } + } + assertEquals(expected, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchilddocfragment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchildgetnodename.hpp b/tests/DOM/conformance/level1/core/nodeappendchildgetnodename.hpp new file mode 100644 index 00000000..49b33142 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchildgetnodename.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchildgetnodename +#define test_nodeappendchildgetnodename + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method returns the node + * added. + * + * Append a newly created node to the child list of the + * second employee and check the NodeName returned. The + * "getNodeName()" method should return "newChild". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class nodeappendchildgetnodename : public DOMTestCase +{ + public: + nodeappendchildgetnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node newChild; + Node appendNode; + String childName; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + newChild = doc.createElement(SA::construct_from_utf8("newChild")); + appendNode = employeeNode.appendChild(newChild); + childName = appendNode.getNodeName(); + assertEquals("newChild", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildgetnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchildinvalidnodetype.hpp b/tests/DOM/conformance/level1/core/nodeappendchildinvalidnodetype.hpp new file mode 100644 index 00000000..f43d8ef3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchildinvalidnodetype.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchildinvalidnodetype +#define test_nodeappendchildinvalidnodetype + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if this node is of + * a type that does not allow children of the type "newChild" + * to be inserted. + * + * Retrieve the root node and attempt to append a newly + * created Attr node. An Element node cannot have children + * of the "Attr" type, therefore the desired exception + * should be raised. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodeappendchildinvalidnodetype : public DOMTestCase +{ + public: + nodeappendchildinvalidnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + Node newChild; + Node appendedChild; + doc = (Document) load("staff", true); + rootNode = doc.getDocumentElement(); + newChild = doc.createAttribute(SA::construct_from_utf8("newAttribute")); + + { + boolean success = false; + try { + appendedChild = rootNode.appendChild(newChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildinvalidnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchildnewchilddiffdocument.hpp b/tests/DOM/conformance/level1/core/nodeappendchildnewchilddiffdocument.hpp new file mode 100644 index 00000000..315ef2e2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchildnewchilddiffdocument.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchildnewchilddiffdocument +#define test_nodeappendchildnewchilddiffdocument + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method raises a + * WRONG_DOCUMENT_ERR DOMException if the "newChild" was + * created from a different document than the one that + * created this node. + * + * Retrieve the second employee and attempt to append + * a node created from a different document. An attempt + * to make such a replacement should raise the desired + * exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodeappendchildnewchilddiffdocument : public DOMTestCase +{ + public: + nodeappendchildnewchilddiffdocument(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + Node newChild; + NodeList elementList; + Node elementNode; + Node appendedChild; + doc1 = (Document) load("staff", false); + doc2 = (Document) load("staff", true); + newChild = doc1.createElement(SA::construct_from_utf8("newChild")); + elementList = doc2.getElementsByTagName(SA::construct_from_utf8("employee")); + elementNode = elementList.item(1); + + { + boolean success = false; + try { + appendedChild = elementNode.appendChild(newChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnewchilddiffdocument"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchildnodeancestor.hpp b/tests/DOM/conformance/level1/core/nodeappendchildnodeancestor.hpp new file mode 100644 index 00000000..e118a35b --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchildnodeancestor.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchildnodeancestor +#define test_nodeappendchildnodeancestor + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if the node to + * append is one of this node's ancestors. + * + * Retrieve the second employee and attempt to append + * an ancestor node(root node) to it. + * An attempt to make such an addition should raise the + * desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodeappendchildnodeancestor : public DOMTestCase +{ + public: + nodeappendchildnodeancestor(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newChild; + NodeList elementList; + Node employeeNode; + Node appendedChild; + doc = (Document) load("staff", true); + newChild = doc.getDocumentElement(); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + + { + boolean success = false; + try { + appendedChild = employeeNode.appendChild(newChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnodeancestor"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchildnomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/nodeappendchildnomodificationallowederr.hpp new file mode 100644 index 00000000..b12e08a1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchildnomodificationallowederr.hpp @@ -0,0 +1,127 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchildnomodificationallowederr +#define test_nodeappendchildnomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "appendChild(newChild)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class nodeappendchildnomodificationallowederr : public DOMTestCase +{ + public: + nodeappendchildnomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entRef; + Node entElement; + Node createdNode; + Node appendedNode; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entRef = genderNode.getFirstChild(); + assertNotNull(entRef); + nodeType = (int) entRef.getNodeType(); + + if (equals(1, nodeType)) { + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + } + entElement = entRef.getFirstChild(); + assertNotNull(entElement); + createdNode = doc.createElement(SA::construct_from_utf8("text3")); + + { + boolean success = false; + try { + appendedNode = entElement.appendChild(createdNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeappendchildnomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/nodeappendchildnomodificationallowederrEE.hpp new file mode 100644 index 00000000..d6a9d2d1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeappendchildnomodificationallowederrEE.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeappendchildnomodificationallowederrEE +#define test_nodeappendchildnomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "appendChild(newChild)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Create an ent4 entity reference and the "appendChild(newChild)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnomodificationallowederr.xml +*/ + +template +class nodeappendchildnomodificationallowederrEE : public DOMTestCase +{ + public: + nodeappendchildnomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node entRef; + Node createdNode; + Node appendedNode; + doc = (Document) load("staff", true); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + createdNode = doc.createElement(SA::construct_from_utf8("text3")); + + { + boolean success = false; + try { + appendedNode = entRef.appendChild(createdNode); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeappendchildnomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeattributenodeattribute.hpp b/tests/DOM/conformance/level1/core/nodeattributenodeattribute.hpp new file mode 100644 index 00000000..5bb33703 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeattributenodeattribute.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeattributenodeattribute +#define test_nodeattributenodeattribute + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on an Attribute + * Node returns null. + * Retrieve the first attribute from the last child of the + * first employee and invoke the "getAttributes()" method + * on the Attribute Node. It should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ + +template +class nodeattributenodeattribute : public DOMTestCase +{ + public: + nodeattributenodeattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + NamedNodeMap addrAttr; + Node attrNode; + NamedNodeMap attrList; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributes(); + attrNode = addrAttr.item(0); + attrList = attrNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeattributenodeattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeattributenodename.hpp b/tests/DOM/conformance/level1/core/nodeattributenodename.hpp new file mode 100644 index 00000000..a9641da3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeattributenodename.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeattributenodename +#define test_nodeattributenodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for an + * Attribute Node is the name of the Attribute. + * + * Retrieve the Attribute named "domestic" from the last + * child of the first employee and check the string returned + * by the "getNodeName()" method. It should be equal to + * "domestic". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class nodeattributenodename : public DOMTestCase +{ + public: + nodeattributenodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Attr addrAttr; + String attrName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributeNode(SA::construct_from_utf8("domestic")); + attrName = addrAttr.getNodeName(); + assertEquals("domestic", attrName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeattributenodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeattributenodetype.hpp b/tests/DOM/conformance/level1/core/nodeattributenodetype.hpp new file mode 100644 index 00000000..47276a35 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeattributenodetype.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeattributenodetype +#define test_nodeattributenodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for an Attribute Node + * returns the constant value 2. + * + * Retrieve the first attribute from the last child of + * the first employee and invoke the "getNodeType()" + * method. The method should return 2. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodeattributenodetype : public DOMTestCase +{ + public: + nodeattributenodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Attr addrAttr; + int nodeType; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributeNode(SA::construct_from_utf8("domestic")); + nodeType = (int) addrAttr.getNodeType(); + assertEquals(2, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeattributenodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeattributenodevalue.hpp b/tests/DOM/conformance/level1/core/nodeattributenodevalue.hpp new file mode 100644 index 00000000..514253a7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeattributenodevalue.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeattributenodevalue +#define test_nodeattributenodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for an + * Attribute Node is the value of the Attribute. + * + * Retrieve the Attribute named "domestic" from the last + * child of the first employee and check the string returned + * by the "getNodeValue()" method. It should be equal to + * "Yes". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodeattributenodevalue : public DOMTestCase +{ + public: + nodeattributenodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Attr addrAttr; + String attrValue; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = (Element) elementList.item(0); + addrAttr = testAddr.getAttributeNode(SA::construct_from_utf8("domestic")); + attrValue = addrAttr.getNodeValue(); + assertEquals("Yes", attrValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeattributenodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecdatasectionnodeattribute.hpp b/tests/DOM/conformance/level1/core/nodecdatasectionnodeattribute.hpp new file mode 100644 index 00000000..76322892 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecdatasectionnodeattribute.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecdatasectionnodeattribute +#define test_nodecdatasectionnodeattribute + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a CDATASection + * Node returns null. + * Retrieve the CDATASection node contained inside the + * second child of the second employee and invoke the + * "getAttributes()" method on the CDATASection node. + * It should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212 +*/ + +template +class nodecdatasectionnodeattribute : public DOMTestCase +{ + public: + nodecdatasectionnodeattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element cdataName; + Node cdataNode; + NamedNodeMap attrList; + int nodeType; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + cdataName = (Element) elementList.item(1); + cdataNode = cdataName.getLastChild(); + nodeType = (int) cdataNode.getNodeType(); + + if (!equals(4, nodeType)) { + cdataNode = doc.createCDATASection(SA::construct_from_utf8("")); + } + attrList = cdataNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecdatasectionnodeattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecdatasectionnodename.hpp b/tests/DOM/conformance/level1/core/nodecdatasectionnodename.hpp new file mode 100644 index 00000000..6b14329a --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecdatasectionnodename.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecdatasectionnodename +#define test_nodecdatasectionnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * CDATASection Node is #cdata-section". + * + * Retrieve the CDATASection node inside the second child + * of the second employee and check the string returned + * by the "getNodeName()" method. It should be equal to + * "#cdata-section". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212 +*/ + +template +class nodecdatasectionnodename : public DOMTestCase +{ + public: + nodecdatasectionnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element cdataName; + Node cdataNode; + int nodeType; + String cdataNodeName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + cdataName = (Element) elementList.item(1); + cdataNode = cdataName.getLastChild(); + nodeType = (int) cdataNode.getNodeType(); + + if (!equals(4, nodeType)) { + cdataNode = doc.createCDATASection(SA::construct_from_utf8("")); + } + cdataNodeName = cdataNode.getNodeName(); + assertEquals("#cdata-section", cdataNodeName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecdatasectionnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecdatasectionnodetype.hpp b/tests/DOM/conformance/level1/core/nodecdatasectionnodetype.hpp new file mode 100644 index 00000000..5b056882 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecdatasectionnodetype.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecdatasectionnodetype +#define test_nodecdatasectionnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a CDATASection Node + * returns the constant value 4. + * + * Retrieve the CDATASection node contained inside the + * second child of the second employee and invoke the + * "getNodeType()" method. The method should return 4. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212 +*/ + +template +class nodecdatasectionnodetype : public DOMTestCase +{ + public: + nodecdatasectionnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testName; + Node cdataNode; + int nodeType; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + testName = (Element) elementList.item(1); + cdataNode = testName.getLastChild(); + nodeType = (int) cdataNode.getNodeType(); + + if (equals(3, nodeType)) { + cdataNode = doc.createCDATASection(SA::construct_from_utf8("")); + nodeType = (int) cdataNode.getNodeType(); + } + assertEquals(4, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecdatasectionnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecdatasectionnodevalue.hpp b/tests/DOM/conformance/level1/core/nodecdatasectionnodevalue.hpp new file mode 100644 index 00000000..9b5e7195 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecdatasectionnodevalue.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecdatasectionnodevalue +#define test_nodecdatasectionnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * CDATASection Node is the content of the CDATASection. + * + * Retrieve the CDATASection node inside the second child + * of the second employee and check the string returned + * by the "getNodeValue()" method. It should be equal to + * "This is a CDATA Section with EntityReference number 2 + * &ent2;". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-667469212 +*/ + +template +class nodecdatasectionnodevalue : public DOMTestCase +{ + public: + nodecdatasectionnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element cdataName; + NodeList childList; + Node child; + String cdataNodeValue; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + cdataName = (Element) elementList.item(1); + childList = cdataName.getChildNodes(); + child = childList.item(1); + + if ((isNull(child))) { + child = doc.createCDATASection(SA::construct_from_utf8("This is a CDATASection with EntityReference number 2 &ent2;")); + } + cdataNodeValue = child.getNodeValue(); + assertEquals("This is a CDATASection with EntityReference number 2 &ent2;", cdataNodeValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecdatasectionnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodechildnodes.hpp b/tests/DOM/conformance/level1/core/nodechildnodes.hpp new file mode 100644 index 00000000..beaa5d07 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodechildnodes.hpp @@ -0,0 +1,116 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodechildnodes +#define test_nodechildnodes + +#include "dom_conf_test.hpp" + +/** + * Collect the element names from Node.childNodes and check against expectations. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +*/ + +template +class nodechildnodes : public DOMTestCase +{ + public: + nodechildnodes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childNodes; + Node childNode; + int childType; + String childName; + std::vector elementNames; + + std::vector expectedElementNames; + expectedElementNames.push_back(SA::construct_from_utf8("employeeId")); + expectedElementNames.push_back(SA::construct_from_utf8("name")); + expectedElementNames.push_back(SA::construct_from_utf8("position")); + expectedElementNames.push_back(SA::construct_from_utf8("salary")); + expectedElementNames.push_back(SA::construct_from_utf8("gender")); + expectedElementNames.push_back(SA::construct_from_utf8("address")); + + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childNodes = employeeNode.getChildNodes(); + for (int indexN65644 = 0; indexN65644 != childNodes.getLength(); indexN65644++) { + childNode = (Node) childNodes.item(indexN65644); + childType = (int) childNode.getNodeType(); + + if (equals(1, childType)) { + childName = childNode.getNodeName(); + elementNames.push_back(childName); + } + } + assertEquals(expectedElementNames, elementNames); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodechildnodes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodechildnodesappendchild.hpp b/tests/DOM/conformance/level1/core/nodechildnodesappendchild.hpp new file mode 100644 index 00000000..92b6e49a --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodechildnodesappendchild.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodechildnodesappendchild +#define test_nodechildnodesappendchild + +#include "dom_conf_test.hpp" + +/** + * Add an element and check that the previously retrieved childNodes NodeList + * is live. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ + +template +class nodechildnodesappendchild : public DOMTestCase +{ + public: + nodechildnodesappendchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node createdNode; + int expectedLength; + int length; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + expectedLength = (int) childList.getLength(); + expectedLength += 1; + createdNode = doc.createElement(SA::construct_from_utf8("text3")); + employeeNode = employeeNode.appendChild(createdNode); + length = (int) childList.getLength(); + assertEquals(expectedLength, length); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodechildnodesappendchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodechildnodesempty.hpp b/tests/DOM/conformance/level1/core/nodechildnodesempty.hpp new file mode 100644 index 00000000..92b3fc22 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodechildnodesempty.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodechildnodesempty +#define test_nodechildnodesempty + +#include "dom_conf_test.hpp" + +/** + * The "getChildNodes()" method returns a NodeList + * that contains all children of this node. If there + * are not any children, this is a NodeList that does not + * contain any nodes. + * Retrieve the Text node from the second child of the second + * employee and invoke the "getChildNodes()" method. The + * NodeList returned should not have any nodes. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +*/ + +template +class nodechildnodesempty : public DOMTestCase +{ + public: + nodechildnodesempty(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node secondCNode; + Node textNode; + NodeList childNodesList; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + secondCNode = childList.item(1); + textNode = secondCNode.getFirstChild(); + childNodesList = textNode.getChildNodes(); + assertSize(0, childNodesList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodechildnodesempty"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecloneattributescopied.hpp b/tests/DOM/conformance/level1/core/nodecloneattributescopied.hpp new file mode 100644 index 00000000..c2dc622d --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecloneattributescopied.hpp @@ -0,0 +1,116 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecloneattributescopied +#define test_nodecloneattributescopied + +#include "dom_conf_test.hpp" + +/** + * If the cloneNode method is used to clone an + * Element node, all the attributes of the Element are + * copied along with their values. + * + * Retrieve the last child of the second employee and invoke + * the cloneNode method. The + * duplicate node returned by the method should copy the + * attributes associated with this node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class nodecloneattributescopied : public DOMTestCase +{ + public: + nodecloneattributescopied(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node addressNode; + Node clonedNode; + NamedNodeMap attributes; + Node attributeNode; + String attributeName; + std::vector result; + + std::vector expectedResult; + expectedResult.push_back(SA::construct_from_utf8("domestic")); + expectedResult.push_back(SA::construct_from_utf8("street")); + + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + addressNode = elementList.item(1); + clonedNode = addressNode.cloneNode(false); + attributes = clonedNode.getAttributes(); + for (int indexN65637 = 0; indexN65637 != attributes.getLength(); indexN65637++) { + attributeNode = (Node) attributes.item(indexN65637); + attributeName = attributeNode.getNodeName(); + result.push_back(attributeName); + } + assertEquals(expectedResult, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecloneattributescopied"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeclonefalsenocopytext.hpp b/tests/DOM/conformance/level1/core/nodeclonefalsenocopytext.hpp new file mode 100644 index 00000000..8c89a844 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeclonefalsenocopytext.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeclonefalsenocopytext +#define test_nodeclonefalsenocopytext + +#include "dom_conf_test.hpp" + +/** + * The "cloneNode(deep)" method does not copy text unless it + * is deep cloned.(Test for deep=false) + * + * Retrieve the fourth child of the second employee and + * the "cloneNode(deep)" method with deep=false. The + * duplicate node returned by the method should not copy + * any text data contained in this node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class nodeclonefalsenocopytext : public DOMTestCase +{ + public: + nodeclonefalsenocopytext(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node childNode; + Node clonedNode; + Node lastChildNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + childNode = childList.item(3); + clonedNode = childNode.cloneNode(false); + lastChildNode = clonedNode.getLastChild(); + assertNull(lastChildNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonefalsenocopytext"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeclonegetparentnull.hpp b/tests/DOM/conformance/level1/core/nodeclonegetparentnull.hpp new file mode 100644 index 00000000..0c353454 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeclonegetparentnull.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeclonegetparentnull +#define test_nodeclonegetparentnull + +#include "dom_conf_test.hpp" + +/** + * The duplicate node returned by the "cloneNode(deep)" + * method does not have a ParentNode. + * + * Retrieve the second employee and invoke the + * "cloneNode(deep)" method with deep=false. The + * duplicate node returned should return null when the + * "getParentNode()" is invoked. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class nodeclonegetparentnull : public DOMTestCase +{ + public: + nodeclonegetparentnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node clonedNode; + Node parentNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + clonedNode = employeeNode.cloneNode(false); + parentNode = clonedNode.getParentNode(); + assertNull(parentNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonegetparentnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeclonenodefalse.hpp b/tests/DOM/conformance/level1/core/nodeclonenodefalse.hpp new file mode 100644 index 00000000..39f75410 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeclonenodefalse.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeclonenodefalse +#define test_nodeclonenodefalse + +#include "dom_conf_test.hpp" + +/** + * The "cloneNode(deep)" method returns a copy of the node + * only if deep=false. + * + * Retrieve the second employee and invoke the + * "cloneNode(deep)" method with deep=false. The + * method should only clone this node. The NodeName and + * length of the NodeList are checked. The "getNodeName()" + * method should return "employee" and the "getLength()" + * method should return 0. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class nodeclonenodefalse : public DOMTestCase +{ + public: + nodeclonenodefalse(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node clonedNode; + String cloneName; + NodeList cloneChildren; + int length; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + clonedNode = employeeNode.cloneNode(false); + cloneName = clonedNode.getNodeName(); + assertEquals("employee", cloneName); + cloneChildren = clonedNode.getChildNodes(); + length = (int) cloneChildren.getLength(); + assertEquals(0, length); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonenodefalse"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeclonenodetrue.hpp b/tests/DOM/conformance/level1/core/nodeclonenodetrue.hpp new file mode 100644 index 00000000..d3d8c576 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeclonenodetrue.hpp @@ -0,0 +1,146 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeclonenodetrue +#define test_nodeclonenodetrue + +#include "dom_conf_test.hpp" + +/** + * The "cloneNode(deep)" method returns a copy of the node + * and the subtree under it if deep=true. + * + * Retrieve the second employee and invoke the + * "cloneNode(deep)" method with deep=true. The + * method should clone this node and the subtree under it. + * The NodeName of each child in the returned node is + * checked to insure the entire subtree under the second + * employee was cloned. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class nodeclonenodetrue : public DOMTestCase +{ + public: + nodeclonenodetrue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node clonedNode; + NodeList clonedList; + Node clonedChild; + String clonedChildName; + int length; + std::vector result; + + std::vector expectedWhitespace; + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("name")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("position")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("address")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + + std::vector expectedNoWhitespace; + expectedNoWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("name")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("position")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("address")); + + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + length = (int) childList.getLength(); + clonedNode = employeeNode.cloneNode(true); + clonedList = clonedNode.getChildNodes(); + for (int indexN65710 = 0; indexN65710 != clonedList.getLength(); indexN65710++) { + clonedChild = (Node) clonedList.item(indexN65710); + clonedChildName = clonedChild.getNodeName(); + result.push_back(clonedChildName); + } + + if (equals(6, length)) { + assertEquals(expectedNoWhitespace, result); + } else { + assertEquals(expectedWhitespace, result); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonenodetrue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeclonetruecopytext.hpp b/tests/DOM/conformance/level1/core/nodeclonetruecopytext.hpp new file mode 100644 index 00000000..577c2456 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeclonetruecopytext.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeclonetruecopytext +#define test_nodeclonetruecopytext + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second salary and + * the "cloneNode(deep)" method with deep=true. The + * duplicate node returned by the method should copy + * any text data contained in this node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ + +template +class nodeclonetruecopytext : public DOMTestCase +{ + public: + nodeclonetruecopytext(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + NodeList childList; + Node childNode; + Node clonedNode; + Node lastChildNode; + String childValue; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("salary")); + childNode = elementList.item(1); + clonedNode = childNode.cloneNode(true); + lastChildNode = clonedNode.getLastChild(); + childValue = lastChildNode.getNodeValue(); + assertEquals("35,000", childValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonetruecopytext"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecommentnodeattributes.hpp b/tests/DOM/conformance/level1/core/nodecommentnodeattributes.hpp new file mode 100644 index 00000000..7f5fdc87 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecommentnodeattributes.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecommentnodeattributes +#define test_nodecommentnodeattributes + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a Comment + * Node returns null. + * Find any comment that is an immediate child of the root + * and assert that Node.attributes is null. Then create + * a new comment node (in case they had been omitted) and + * make the assertion. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +*/ + +template +class nodecommentnodeattributes : public DOMTestCase +{ + public: + nodecommentnodeattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList childList; + Node childNode; + NamedNodeMap attrList; + int nodeType; + doc = (Document) load("staff", false); + childList = doc.getChildNodes(); + for (int indexN65603 = 0; indexN65603 != childList.getLength(); indexN65603++) { + childNode = (Node) childList.item(indexN65603); + nodeType = (int) childNode.getNodeType(); + + if (equals(8, nodeType)) { + attrList = childNode.getAttributes(); + assertNull(attrList); + } + } + childNode = doc.createComment(SA::construct_from_utf8("This is a comment")); + attrList = childNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecommentnodeattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecommentnodename.hpp b/tests/DOM/conformance/level1/core/nodecommentnodename.hpp new file mode 100644 index 00000000..59ad1a80 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecommentnodename.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecommentnodename +#define test_nodecommentnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * Comment Node is "#comment". + * + * Retrieve the Comment node in the XML file + * and check the string returned by the "getNodeName()" + * method. It should be equal to "#comment". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +*/ + +template +class nodecommentnodename : public DOMTestCase +{ + public: + nodecommentnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node commentNode; + int nodeType; + String commentNodeName; + doc = (Document) load("staff", false); + elementList = doc.getChildNodes(); + for (int indexN65600 = 0; indexN65600 != elementList.getLength(); indexN65600++) { + commentNode = (Node) elementList.item(indexN65600); + nodeType = (int) commentNode.getNodeType(); + + if (equals(8, nodeType)) { + commentNodeName = commentNode.getNodeName(); + assertEquals("#comment", commentNodeName); + } + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecommentnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecommentnodetype.hpp b/tests/DOM/conformance/level1/core/nodecommentnodetype.hpp new file mode 100644 index 00000000..655ec2fb --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecommentnodetype.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecommentnodetype +#define test_nodecommentnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a Comment Node + * returns the constant value 8. + * + * Retrieve the nodes from the document and check for + * a comment node and invoke the "getNodeType()" method. This should + * return 8. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +*/ + +template +class nodecommentnodetype : public DOMTestCase +{ + public: + nodecommentnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList testList; + Node commentNode; + String commentNodeName; + int nodeType; + doc = (Document) load("staff", false); + testList = doc.getChildNodes(); + for (int indexN65600 = 0; indexN65600 != testList.getLength(); indexN65600++) { + commentNode = (Node) testList.item(indexN65600); + commentNodeName = commentNode.getNodeName(); + + if (equals("#comment", commentNodeName)) { + nodeType = (int) commentNode.getNodeType(); + assertEquals(8, nodeType); + } + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecommentnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodecommentnodevalue.hpp b/tests/DOM/conformance/level1/core/nodecommentnodevalue.hpp new file mode 100644 index 00000000..9c5817c3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodecommentnodevalue.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodecommentnodevalue +#define test_nodecommentnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * Comment Node is the content of the comment. + * + * Retrieve the comment in the XML file and + * check the string returned by the "getNodeValue()" method. + * It should be equal to "This is comment number 1". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +*/ + +template +class nodecommentnodevalue : public DOMTestCase +{ + public: + nodecommentnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node commentNode; + String commentName; + String commentValue; + doc = (Document) load("staff", false); + elementList = doc.getChildNodes(); + for (int indexN65600 = 0; indexN65600 != elementList.getLength(); indexN65600++) { + commentNode = (Node) elementList.item(indexN65600); + commentName = commentNode.getNodeName(); + + if (equals("#comment", commentName)) { + commentValue = commentNode.getNodeValue(); + assertEquals(" This is comment number 1.", commentValue); + } + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodecommentnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumentfragmentnodename.hpp b/tests/DOM/conformance/level1/core/nodedocumentfragmentnodename.hpp new file mode 100644 index 00000000..0fc133c7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumentfragmentnodename.hpp @@ -0,0 +1,98 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumentfragmentnodename +#define test_nodedocumentfragmentnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * DocumentFragment Node is "#document-frament". + * Retrieve the DOM document and invoke the + * "createDocumentFragment()" method and check the string + * returned by the "getNodeName()" method. It should be + * equal to "#document-fragment". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ + +template +class nodedocumentfragmentnodename : public DOMTestCase +{ + public: + nodedocumentfragmentnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment docFragment; + String documentFragmentName; + doc = (Document) load("staff", true); + docFragment = doc.createDocumentFragment(); + documentFragmentName = docFragment.getNodeName(); + assertEquals("#document-fragment", documentFragmentName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentfragmentnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumentfragmentnodetype.hpp b/tests/DOM/conformance/level1/core/nodedocumentfragmentnodetype.hpp new file mode 100644 index 00000000..5e12ce1a --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumentfragmentnodetype.hpp @@ -0,0 +1,98 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumentfragmentnodetype +#define test_nodedocumentfragmentnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a DocumentFragment Node + * returns the constant value 11. + * Invoke the "createDocumentFragment()" method and + * examine the NodeType of the document fragment + * returned by the "getNodeType()" method. The method + * should return 11. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ + +template +class nodedocumentfragmentnodetype : public DOMTestCase +{ + public: + nodedocumentfragmentnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment documentFragmentNode; + int nodeType; + doc = (Document) load("staff", true); + documentFragmentNode = doc.createDocumentFragment(); + nodeType = (int) documentFragmentNode.getNodeType(); + assertEquals(11, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentfragmentnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumentfragmentnodevalue.hpp b/tests/DOM/conformance/level1/core/nodedocumentfragmentnodevalue.hpp new file mode 100644 index 00000000..d1a2fa68 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumentfragmentnodevalue.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumentfragmentnodevalue +#define test_nodedocumentfragmentnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * DocumentFragment Node is null. + * + * Retrieve the DOM document and invoke the + * "createDocumentFragment()" method and check the string + * returned by the "getNodeValue()" method. It should be + * equal to null. +* @author NIST +* @author Mary Brady +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class nodedocumentfragmentnodevalue : public DOMTestCase +{ + public: + nodedocumentfragmentnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentFragment docFragment; + NamedNodeMap attrList; + String value; + doc = (Document) load("staff", true); + docFragment = doc.createDocumentFragment(); + attrList = docFragment.getAttributes(); + assertNull(attrList); + value = docFragment.getNodeValue(); + assertNull(value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentfragmentnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumentnodeattribute.hpp b/tests/DOM/conformance/level1/core/nodedocumentnodeattribute.hpp new file mode 100644 index 00000000..7927ffd8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumentnodeattribute.hpp @@ -0,0 +1,92 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumentnodeattribute +#define test_nodedocumentnodeattribute + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a Document + * Node returns null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ + +template +class nodedocumentnodeattribute : public DOMTestCase +{ + public: + nodedocumentnodeattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NamedNodeMap attrList; + doc = (Document) load("staff", false); + attrList = doc.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentnodeattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumentnodename.hpp b/tests/DOM/conformance/level1/core/nodedocumentnodename.hpp new file mode 100644 index 00000000..092da542 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumentnodename.hpp @@ -0,0 +1,95 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumentnodename +#define test_nodedocumentnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * Document Node is "#document". + * Retrieve the DOM document and check the string returned + * by the "getNodeName()" method. It should be equal to + * "#document". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class nodedocumentnodename : public DOMTestCase +{ + public: + nodedocumentnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + String documentName; + doc = (Document) load("staff", false); + documentName = doc.getNodeName(); + assertEquals("#document", documentName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumentnodetype.hpp b/tests/DOM/conformance/level1/core/nodedocumentnodetype.hpp new file mode 100644 index 00000000..3b5a6f37 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumentnodetype.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumentnodetype +#define test_nodedocumentnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a Document Node + * returns the constant value 9. + * Retrieve the document and invoke the "getNodeType()" + * method. The method should return 9. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodedocumentnodetype : public DOMTestCase +{ + public: + nodedocumentnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + int nodeType; + doc = (Document) load("staff", false); + nodeType = (int) doc.getNodeType(); + assertEquals(9, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumentnodevalue.hpp b/tests/DOM/conformance/level1/core/nodedocumentnodevalue.hpp new file mode 100644 index 00000000..464a051b --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumentnodevalue.hpp @@ -0,0 +1,95 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumentnodevalue +#define test_nodedocumentnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * Document Node is null. + * Retrieve the DOM Document and check the string returned + * by the "getNodeValue()" method. It should be equal to + * null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodedocumentnodevalue : public DOMTestCase +{ + public: + nodedocumentnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + String documentValue; + doc = (Document) load("staff", false); + documentValue = doc.getNodeValue(); + assertNull(documentValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumentnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumenttypenodename.hpp b/tests/DOM/conformance/level1/core/nodedocumenttypenodename.hpp new file mode 100644 index 00000000..2d88e490 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumenttypenodename.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumenttypenodename +#define test_nodedocumenttypenodename + +#include "dom_conf_test.hpp" + +/** + * Retrieve the DOCTYPE declaration from the XML file and + * check the string returned by the "getNodeName()" + * method. It should be equal to "staff" or "svg". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class nodedocumenttypenodename : public DOMTestCase +{ + public: + nodedocumenttypenodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + String documentTypeName; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + documentTypeName = docType.getNodeName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", documentTypeName); + } else { + assertEquals("staff", documentTypeName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumenttypenodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumenttypenodetype.hpp b/tests/DOM/conformance/level1/core/nodedocumenttypenodetype.hpp new file mode 100644 index 00000000..4ec5791e --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumenttypenodetype.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumenttypenodetype +#define test_nodedocumenttypenodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a DocumentType Node + * returns the constant value 10. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodedocumenttypenodetype : public DOMTestCase +{ + public: + nodedocumenttypenodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType documentTypeNode; + int nodeType; + doc = (Document) load("staff", false); + documentTypeNode = doc.getDoctype(); + assertNotNull(documentTypeNode); + nodeType = (int) documentTypeNode.getNodeType(); + assertEquals(10, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumenttypenodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodedocumenttypenodevalue.hpp b/tests/DOM/conformance/level1/core/nodedocumenttypenodevalue.hpp new file mode 100644 index 00000000..0a345e2a --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodedocumenttypenodevalue.hpp @@ -0,0 +1,93 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodedocumenttypenodevalue +#define test_nodedocumenttypenodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * DocumentType Node is null. +* @author NIST +* @author Mary Brady +*/ + +template +class nodedocumenttypenodevalue : public DOMTestCase +{ + public: + nodedocumenttypenodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap attrList; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + attrList = docType.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodedocumenttypenodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeelementnodeattributes.hpp b/tests/DOM/conformance/level1/core/nodeelementnodeattributes.hpp new file mode 100644 index 00000000..b4f42d68 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeelementnodeattributes.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeelementnodeattributes +#define test_nodeelementnodeattributes + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on an Element + * Node returns a NamedNodeMap containing the attributes + * of this node. + * + * Retrieve the last child of the third employee and + * invoke the "getAttributes()" method. It should return + * a NamedNodeMap containing the attributes of the Element + * node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class nodeelementnodeattributes : public DOMTestCase +{ + public: + nodeelementnodeattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + NamedNodeMap addrAttr; + Node attrNode; + String attrName; + std::vector attrList; + + std::vector expected; + expected.push_back(SA::construct_from_utf8("domestic")); + expected.push_back(SA::construct_from_utf8("street")); + + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = (Element) elementList.item(2); + addrAttr = testAddr.getAttributes(); + for (int indexN65628 = 0; indexN65628 != addrAttr.getLength(); indexN65628++) { + attrNode = (Node) addrAttr.item(indexN65628); + attrName = attrNode.getNodeName(); + attrList.push_back(attrName); + } + assertEquals(expected, attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeelementnodeattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeelementnodename.hpp b/tests/DOM/conformance/level1/core/nodeelementnodename.hpp new file mode 100644 index 00000000..d10af25c --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeelementnodename.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeelementnodename +#define test_nodeelementnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for an + * Element Node is its tagName. + * + * Retrieve the first Element Node(Root Node) of the + * DOM object and check the string returned by the + * "getNodeName()" method. It should be equal to its + * tagName. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class nodeelementnodename : public DOMTestCase +{ + public: + nodeelementnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element elementNode; + String elementName; + doc = (Document) load("staff", false); + elementNode = doc.getDocumentElement(); + elementName = elementNode.getNodeName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", elementName); + } else { + assertEquals("staff", elementName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeelementnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeelementnodetype.hpp b/tests/DOM/conformance/level1/core/nodeelementnodetype.hpp new file mode 100644 index 00000000..bc7f2fac --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeelementnodetype.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeelementnodetype +#define test_nodeelementnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for an Element Node + * returns the constant value 1. + * + * Retrieve the root node and invoke the "getNodeType()" + * method. The method should return 1. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodeelementnodetype : public DOMTestCase +{ + public: + nodeelementnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + int nodeType; + doc = (Document) load("staff", false); + rootNode = doc.getDocumentElement(); + nodeType = (int) rootNode.getNodeType(); + assertEquals(1, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeelementnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeelementnodevalue.hpp b/tests/DOM/conformance/level1/core/nodeelementnodevalue.hpp new file mode 100644 index 00000000..649cd36b --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeelementnodevalue.hpp @@ -0,0 +1,93 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeelementnodevalue +#define test_nodeelementnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for an + * Element Node is null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodeelementnodevalue : public DOMTestCase +{ + public: + nodeelementnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element elementNode; + String elementValue; + doc = (Document) load("staff", false); + elementNode = doc.getDocumentElement(); + elementValue = elementNode.getNodeValue(); + assertNull(elementValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeelementnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentitynodeattributes.hpp b/tests/DOM/conformance/level1/core/nodeentitynodeattributes.hpp new file mode 100644 index 00000000..cbb98601 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentitynodeattributes.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentitynodeattributes +#define test_nodeentitynodeattributes + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on an Entity + * Node returns null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class nodeentitynodeattributes : public DOMTestCase +{ + public: + nodeentitynodeattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entities; + Node entityNode; + NamedNodeMap attrList; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entities = docType.getEntities(); + assertNotNull(entities); + entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1")); + assertNotNull(entityNode); + attrList = entityNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitynodeattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentitynodename.hpp b/tests/DOM/conformance/level1/core/nodeentitynodename.hpp new file mode 100644 index 00000000..61796ff1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentitynodename.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentitynodename +#define test_nodeentitynodename + +#include "dom_conf_test.hpp" + +/** + * Check the nodeName of the entity returned by DocumentType.entities.getNamedItem("ent1"). +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class nodeentitynodename : public DOMTestCase +{ + public: + nodeentitynodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entities; + Node entityNode; + String entityName; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entities = docType.getEntities(); + assertNotNull(entities); + entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1")); + assertNotNull(entityNode); + entityName = entityNode.getNodeName(); + assertEquals("ent1", entityName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitynodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentitynodetype.hpp b/tests/DOM/conformance/level1/core/nodeentitynodetype.hpp new file mode 100644 index 00000000..a2628da6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentitynodetype.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentitynodetype +#define test_nodeentitynodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for an Entity Node + * returns the constant value 6. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodeentitynodetype : public DOMTestCase +{ + public: + nodeentitynodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entities; + Node entityNode; + int nodeType; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entities = docType.getEntities(); + assertNotNull(entities); + entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1")); + assertNotNull(entityNode); + nodeType = (int) entityNode.getNodeType(); + assertEquals(6, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitynodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentitynodevalue.hpp b/tests/DOM/conformance/level1/core/nodeentitynodevalue.hpp new file mode 100644 index 00000000..929f242b --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentitynodevalue.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentitynodevalue +#define test_nodeentitynodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for an + * Entity Node is null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodeentitynodevalue : public DOMTestCase +{ + public: + nodeentitynodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entities; + Node entityNode; + String entityValue; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + entities = docType.getEntities(); + assertNotNull(entities); + entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1")); + assertNotNull(entityNode); + entityValue = entityNode.getNodeValue(); + assertNull(entityValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitynodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentityreferencenodeattributes.hpp b/tests/DOM/conformance/level1/core/nodeentityreferencenodeattributes.hpp new file mode 100644 index 00000000..5d24f25d --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentityreferencenodeattributes.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentityreferencenodeattributes +#define test_nodeentityreferencenodeattributes + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on an EntityReference + * Node returns null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class nodeentityreferencenodeattributes : public DOMTestCase +{ + public: + nodeentityreferencenodeattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element entRefAddr; + Node entRefNode; + NamedNodeMap attrList; + int nodeType; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + entRefAddr = (Element) elementList.item(1); + entRefNode = entRefAddr.getFirstChild(); + nodeType = (int) entRefNode.getNodeType(); + + if (!equals(5, nodeType)) { + entRefNode = doc.createEntityReference(SA::construct_from_utf8("ent2")); + assertNotNull(entRefNode); + } + attrList = entRefNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentityreferencenodeattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentityreferencenodename.hpp b/tests/DOM/conformance/level1/core/nodeentityreferencenodename.hpp new file mode 100644 index 00000000..457ea505 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentityreferencenodename.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentityreferencenodename +#define test_nodeentityreferencenodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for an + * EntityReference Node is the name of the entity referenced. + * + * Retrieve the first Entity Reference node from the last + * child of the second employee and check the string + * returned by the "getNodeName()" method. It should be + * equal to "ent2". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class nodeentityreferencenodename : public DOMTestCase +{ + public: + nodeentityreferencenodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element entRefAddr; + Node entRefNode; + String entRefName; + int nodeType; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + entRefAddr = (Element) elementList.item(1); + entRefNode = entRefAddr.getFirstChild(); + nodeType = (int) entRefNode.getNodeType(); + + if (!equals(5, nodeType)) { + entRefNode = doc.createEntityReference(SA::construct_from_utf8("ent2")); + assertNotNull(entRefNode); + } + entRefName = entRefNode.getNodeName(); + assertEquals("ent2", entRefName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentityreferencenodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentityreferencenodetype.hpp b/tests/DOM/conformance/level1/core/nodeentityreferencenodetype.hpp new file mode 100644 index 00000000..3da6c0d6 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentityreferencenodetype.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentityreferencenodetype +#define test_nodeentityreferencenodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for an EntityReference Node + * returns the constant value 5. + * + * Retrieve the EntityReference node from the last child + * of the second employee and invoke the "getNodeType()" + * method. The method should return 5. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodeentityreferencenodetype : public DOMTestCase +{ + public: + nodeentityreferencenodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element entRefAddr; + Node entRefNode; + int nodeType; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + entRefAddr = (Element) elementList.item(1); + entRefNode = entRefAddr.getFirstChild(); + nodeType = (int) entRefNode.getNodeType(); + + if (equals(3, nodeType)) { + entRefNode = doc.createEntityReference(SA::construct_from_utf8("ent2")); + assertNotNull(entRefNode); + nodeType = (int) entRefNode.getNodeType(); + } + assertEquals(5, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentityreferencenodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentityreferencenodevalue.hpp b/tests/DOM/conformance/level1/core/nodeentityreferencenodevalue.hpp new file mode 100644 index 00000000..71832056 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentityreferencenodevalue.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentityreferencenodevalue +#define test_nodeentityreferencenodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for an + * EntityReference Node is null. + * + * Retrieve the first Entity Reference node from the last + * child of the second employee and check the string + * returned by the "getNodeValue()" method. It should be + * equal to null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodeentityreferencenodevalue : public DOMTestCase +{ + public: + nodeentityreferencenodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element entRefAddr; + Node entRefNode; + String entRefValue; + int nodeType; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + entRefAddr = (Element) elementList.item(1); + entRefNode = entRefAddr.getFirstChild(); + nodeType = (int) entRefNode.getNodeType(); + + if (equals(3, nodeType)) { + entRefNode = doc.createEntityReference(SA::construct_from_utf8("ent2")); + assertNotNull(entRefNode); + } + entRefValue = entRefNode.getNodeValue(); + assertNull(entRefValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentityreferencenodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeentitysetnodevalue.hpp b/tests/DOM/conformance/level1/core/nodeentitysetnodevalue.hpp new file mode 100644 index 00000000..8d6644b4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeentitysetnodevalue.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeentitysetnodevalue +#define test_nodeentitysetnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for an + * Entity Node is always null and "setNodeValue" should have no effect. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2 +*/ + +template +class nodeentitysetnodevalue : public DOMTestCase +{ + public: + nodeentitysetnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap entities; + Node entityNode; + String entityValue; + doc = (Document) load("staff", true); + docType = doc.getDoctype(); + assertNotNull(docType); + entities = docType.getEntities(); + assertNotNull(entities); + entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1")); + assertNotNull(entityNode); + entityNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + entityValue = entityNode.getNodeValue(); + assertNull(entityValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeentitysetnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetfirstchild.hpp b/tests/DOM/conformance/level1/core/nodegetfirstchild.hpp new file mode 100644 index 00000000..b206aa9d --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetfirstchild.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetfirstchild +#define test_nodegetfirstchild + +#include "dom_conf_test.hpp" + +/** + * The "getFirstChild()" method returns the first child + * of this node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388 +*/ + +template +class nodegetfirstchild : public DOMTestCase +{ + public: + nodegetfirstchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node fchildNode; + String childName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + fchildNode = employeeNode.getFirstChild(); + childName = fchildNode.getNodeName(); + + if (equals("#text", childName)) { + fchildNode = fchildNode.getNextSibling(); + childName = fchildNode.getNodeName(); + } + assertEquals("employeeId", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetfirstchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetfirstchildnull.hpp b/tests/DOM/conformance/level1/core/nodegetfirstchildnull.hpp new file mode 100644 index 00000000..adfbc9d0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetfirstchildnull.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetfirstchildnull +#define test_nodegetfirstchildnull + +#include "dom_conf_test.hpp" + +/** + * If there is not a first child then the "getFirstChild()" + * method returns null. + * + * Retrieve the Text node form the second child of the first + * employee and invoke the "getFirstChild()" method. It + * should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388 +*/ + +template +class nodegetfirstchildnull : public DOMTestCase +{ + public: + nodegetfirstchildnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node secondChildNode; + Node textNode; + Node noChildNode; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(0); + employeeList = employeeNode.getChildNodes(); + secondChildNode = employeeList.item(1); + textNode = secondChildNode.getFirstChild(); + noChildNode = textNode.getFirstChild(); + assertNull(noChildNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetfirstchildnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetlastchild.hpp b/tests/DOM/conformance/level1/core/nodegetlastchild.hpp new file mode 100644 index 00000000..62f26164 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetlastchild.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetlastchild +#define test_nodegetlastchild + +#include "dom_conf_test.hpp" + +/** + * The "getLastChild()" method returns the last child + * of this node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB +*/ + +template +class nodegetlastchild : public DOMTestCase +{ + public: + nodegetlastchild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node lchildNode; + String childName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + lchildNode = employeeNode.getLastChild(); + childName = lchildNode.getNodeName(); + + if (equals("#text", childName)) { + lchildNode = lchildNode.getPreviousSibling(); + childName = lchildNode.getNodeName(); + } + assertEquals("address", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetlastchild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetlastchildnull.hpp b/tests/DOM/conformance/level1/core/nodegetlastchildnull.hpp new file mode 100644 index 00000000..4588d858 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetlastchildnull.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetlastchildnull +#define test_nodegetlastchildnull + +#include "dom_conf_test.hpp" + +/** + * If there is not a last child then the "getLastChild()" + * method returns null. + * + * Retrieve the Text node from the second child of the first + * employee and invoke the "getLastChild()" method. It + * should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB +*/ + +template +class nodegetlastchildnull : public DOMTestCase +{ + public: + nodegetlastchildnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node secondChildNode; + Node textNode; + Node noChildNode; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(0); + employeeList = employeeNode.getChildNodes(); + secondChildNode = employeeList.item(1); + textNode = secondChildNode.getFirstChild(); + noChildNode = textNode.getLastChild(); + assertNull(noChildNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetlastchildnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetnextsibling.hpp b/tests/DOM/conformance/level1/core/nodegetnextsibling.hpp new file mode 100644 index 00000000..dd00aa1d --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetnextsibling.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetnextsibling +#define test_nodegetnextsibling + +#include "dom_conf_test.hpp" + +/** + * The "getNextSibling()" method returns the node immediately + * following this node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +*/ + +template +class nodegetnextsibling : public DOMTestCase +{ + public: + nodegetnextsibling(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeIdNode; + Node nsNode; + String nsName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employeeId")); + employeeIdNode = elementList.item(1); + nsNode = employeeIdNode.getNextSibling(); + nsName = nsNode.getNodeName(); + + if (equals("#text", nsName)) { + nsNode = nsNode.getNextSibling(); + nsName = nsNode.getNodeName(); + } + assertEquals("name", nsName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetnextsibling"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetnextsiblingnull.hpp b/tests/DOM/conformance/level1/core/nodegetnextsiblingnull.hpp new file mode 100644 index 00000000..64fd2893 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetnextsiblingnull.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetnextsiblingnull +#define test_nodegetnextsiblingnull + +#include "dom_conf_test.hpp" + +/** + * If there is not a node immediately following this node the + * "getNextSibling()" method returns null. + * + * Retrieve the first child of the second employee and + * invoke the "getNextSibling()" method. It should + * be set to null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +*/ + +template +class nodegetnextsiblingnull : public DOMTestCase +{ + public: + nodegetnextsiblingnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node lcNode; + Node nsNode; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + lcNode = employeeNode.getLastChild(); + nsNode = lcNode.getNextSibling(); + assertNull(nsNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetnextsiblingnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetownerdocument.hpp b/tests/DOM/conformance/level1/core/nodegetownerdocument.hpp new file mode 100644 index 00000000..842ad9f3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetownerdocument.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetownerdocument +#define test_nodegetownerdocument + +#include "dom_conf_test.hpp" + +/** + * The "getOwnerDocument()" method returns the Document + * object associated with this node. + * + * Retrieve the second employee and examine Document + * returned by the "getOwnerDocument()" method. Invoke + * the "getDocumentElement()" on the Document which will + * return an Element that is equal to "staff". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class nodegetownerdocument : public DOMTestCase +{ + public: + nodegetownerdocument(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node docNode; + Document ownerDocument; + Element docElement; + String elementName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + docNode = elementList.item(1); + ownerDocument = docNode.getOwnerDocument(); + docElement = ownerDocument.getDocumentElement(); + elementName = docElement.getNodeName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", elementName); + } else { + assertEquals("staff", elementName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetownerdocument"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetownerdocumentnull.hpp b/tests/DOM/conformance/level1/core/nodegetownerdocumentnull.hpp new file mode 100644 index 00000000..ee807989 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetownerdocumentnull.hpp @@ -0,0 +1,91 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetownerdocumentnull +#define test_nodegetownerdocumentnull + +#include "dom_conf_test.hpp" + +/** + * The "getOwnerDocument()" method returns null if the target + * node itself is a document. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc +*/ + +template +class nodegetownerdocumentnull : public DOMTestCase +{ + public: + nodegetownerdocumentnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Document ownerDocument; + doc = (Document) load("staff", false); + ownerDocument = doc.getOwnerDocument(); + assertNull(ownerDocument); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetownerdocumentnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetprevioussibling.hpp b/tests/DOM/conformance/level1/core/nodegetprevioussibling.hpp new file mode 100644 index 00000000..ba6089bd --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetprevioussibling.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetprevioussibling +#define test_nodegetprevioussibling + +#include "dom_conf_test.hpp" + +/** + * The "getPreviousSibling()" method returns the node + * immediately preceding this node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +*/ + +template +class nodegetprevioussibling : public DOMTestCase +{ + public: + nodegetprevioussibling(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Node psNode; + String psName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(1); + psNode = nameNode.getPreviousSibling(); + psName = psNode.getNodeName(); + + if (equals("#text", psName)) { + psNode = psNode.getPreviousSibling(); + psName = psNode.getNodeName(); + } + assertEquals("employeeId", psName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetprevioussibling"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodegetprevioussiblingnull.hpp b/tests/DOM/conformance/level1/core/nodegetprevioussiblingnull.hpp new file mode 100644 index 00000000..d039a56d --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodegetprevioussiblingnull.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodegetprevioussiblingnull +#define test_nodegetprevioussiblingnull + +#include "dom_conf_test.hpp" + +/** + * If there is not a node immediately preceding this node the + * "getPreviousSibling()" method returns null. + * + * Retrieve the first child of the second employee and + * invoke the "getPreviousSibling()" method. It should + * be set to null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +*/ + +template +class nodegetprevioussiblingnull : public DOMTestCase +{ + public: + nodegetprevioussiblingnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node fcNode; + Node psNode; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(2); + fcNode = employeeNode.getFirstChild(); + psNode = fcNode.getPreviousSibling(); + assertNull(psNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodegetprevioussiblingnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodehaschildnodes.hpp b/tests/DOM/conformance/level1/core/nodehaschildnodes.hpp new file mode 100644 index 00000000..2a860272 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodehaschildnodes.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodehaschildnodes +#define test_nodehaschildnodes + +#include "dom_conf_test.hpp" + +/** + * The "hasChildNodes()" method returns true if the node + * has children. + * + * Retrieve the root node("staff") and invoke the + * "hasChildNodes()" method. It should return the boolean + * value "true". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187 +*/ + +template +class nodehaschildnodes : public DOMTestCase +{ + public: + nodehaschildnodes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + boolean state; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + state = employeeNode.hasChildNodes(); + assertTrue(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodehaschildnodes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodehaschildnodesfalse.hpp b/tests/DOM/conformance/level1/core/nodehaschildnodesfalse.hpp new file mode 100644 index 00000000..cde7b613 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodehaschildnodesfalse.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodehaschildnodesfalse +#define test_nodehaschildnodesfalse + +#include "dom_conf_test.hpp" + +/** + * The "hasChildNodes()" method returns false if the node + * does not have any children. + * + * Retrieve the Text node inside the first child of the + * second employee and invoke the "hasChildNodes()" method. + * It should return the boolean value "false". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187 +*/ + +template +class nodehaschildnodesfalse : public DOMTestCase +{ + public: + nodehaschildnodesfalse(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node child; + NodeList employeeIdList; + Node employeeNode; + Node textNode; + boolean state; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + child = elementList.item(1); + employeeIdList = child.getChildNodes(); + employeeNode = employeeIdList.item(1); + textNode = employeeNode.getFirstChild(); + state = textNode.hasChildNodes(); + assertFalse(state); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodehaschildnodesfalse"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbefore.hpp b/tests/DOM/conformance/level1/core/nodeinsertbefore.hpp new file mode 100644 index 00000000..51a9ba5a --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbefore.hpp @@ -0,0 +1,151 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbefore +#define test_nodeinsertbefore + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method inserts the + * node "newChild" before the node "refChild". + * + * Insert a newly created Element node before the eigth + * child of the second employee and check the "newChild" + * and "refChild" after insertion for correct placement. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class nodeinsertbefore : public DOMTestCase +{ + public: + nodeinsertbefore(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node newChild; + Node child; + String childName; + int length; + Node insertedNode; + std::vector actual; + + std::vector expectedWithWhitespace; + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("name")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("position")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("newChild")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("address")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + + std::vector expectedWithoutWhitespace; + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("name")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("position")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("newChild")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("address")); + + std::vector expected; + + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + length = (int) childList.getLength(); + + if (equals(6, length)) { + refChild = childList.item(3); + expected = expectedWithoutWhitespace; + } else { + refChild = childList.item(7); + expected = expectedWithWhitespace; + } + + newChild = doc.createElement(SA::construct_from_utf8("newChild")); + insertedNode = employeeNode.insertBefore(newChild, refChild); + for (int indexN65756 = 0; indexN65756 != childList.getLength(); indexN65756++) { + child = (Node) childList.item(indexN65756); + childName = child.getNodeName(); + actual.push_back(childName); + } + assertEquals(expected, actual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbefore"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforedocfragment.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforedocfragment.hpp new file mode 100644 index 00000000..00f607f7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforedocfragment.hpp @@ -0,0 +1,123 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforedocfragment +#define test_nodeinsertbeforedocfragment + +#include "dom_conf_test.hpp" + +/** + * If the "newChild" is a DocumentFragment object then all + * its children are inserted in the same order before the + * the "refChild". + * + * Create a DocumentFragment object and populate it with + * two Element nodes. Retrieve the second employee and + * insert the newly created DocumentFragment before its + * fourth child. The second employee should now have two + * extra children("newChild1" and "newChild2") at + * positions fourth and fifth respectively. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class nodeinsertbeforedocfragment : public DOMTestCase +{ + public: + nodeinsertbeforedocfragment(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + DocumentFragment newdocFragment; + Node newChild1; + Node newChild2; + Node child; + String childName; + Node appendedChild; + Node insertedNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + refChild = childList.item(3); + newdocFragment = doc.createDocumentFragment(); + newChild1 = doc.createElement(SA::construct_from_utf8("newChild1")); + newChild2 = doc.createElement(SA::construct_from_utf8("newChild2")); + appendedChild = newdocFragment.appendChild(newChild1); + appendedChild = newdocFragment.appendChild(newChild2); + insertedNode = employeeNode.insertBefore(newdocFragment, refChild); + child = childList.item(3); + childName = child.getNodeName(); + assertEquals("newChild1", childName); + child = childList.item(4); + childName = child.getNodeName(); + assertEquals("newChild2", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforedocfragment"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforeinvalidnodetype.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforeinvalidnodetype.hpp new file mode 100644 index 00000000..17342f08 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforeinvalidnodetype.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforeinvalidnodetype +#define test_nodeinsertbeforeinvalidnodetype + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if this node is of + * a type that does not allow children of the type "newChild" + * to be inserted. + * + * Retrieve the root node and attempt to insert a newly + * created Attr node. An Element node cannot have children + * of the "Attr" type, therefore the desired exception + * should be raised. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodeinsertbeforeinvalidnodetype : public DOMTestCase +{ + public: + nodeinsertbeforeinvalidnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + Node newChild; + NodeList elementList; + Node refChild; + Node insertedNode; + doc = (Document) load("staff", true); + rootNode = doc.getDocumentElement(); + newChild = doc.createAttribute(SA::construct_from_utf8("newAttribute")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + refChild = elementList.item(1); + + { + boolean success = false; + try { + insertedNode = rootNode.insertBefore(newChild, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforeinvalidnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforenewchilddiffdocument.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforenewchilddiffdocument.hpp new file mode 100644 index 00000000..3e1fe13d --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforenewchilddiffdocument.hpp @@ -0,0 +1,120 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforenewchilddiffdocument +#define test_nodeinsertbeforenewchilddiffdocument + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method raises a + * WRONG_DOCUMENT_ERR DOMException if the "newChild" was + * created from a different document than the one that + * created this node. + * + * Retrieve the second employee and attempt to insert a new + * child that was created from a different document than the + * one that created the second employee. An attempt to + * insert such a child should raise the desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class nodeinsertbeforenewchilddiffdocument : public DOMTestCase +{ + public: + nodeinsertbeforenewchilddiffdocument(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + Node refChild; + Node newChild; + NodeList elementList; + Node elementNode; + Node insertedNode; + doc1 = (Document) load("staff", false); + doc2 = (Document) load("staff", true); + newChild = doc1.createElement(SA::construct_from_utf8("newChild")); + elementList = doc2.getElementsByTagName(SA::construct_from_utf8("employee")); + elementNode = elementList.item(1); + refChild = elementNode.getFirstChild(); + + { + boolean success = false; + try { + insertedNode = elementNode.insertBefore(newChild, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenewchilddiffdocument"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforenewchildexists.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforenewchildexists.hpp new file mode 100644 index 00000000..cdae8e4a --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforenewchildexists.hpp @@ -0,0 +1,153 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforenewchildexists +#define test_nodeinsertbeforenewchildexists + +#include "dom_conf_test.hpp" + +/** + * If the "newChild" is already in the tree, the + * "insertBefore(newChild,refChild)" method must first + * remove it before the insertion takes place. + * + * Insert a node Element ("employeeId") that is already + * present in the tree. The existing node should be + * removed first and the new one inserted. The node is + * inserted at a different position in the tree to assure + * that it was indeed inserted. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class nodeinsertbeforenewchildexists : public DOMTestCase +{ + public: + nodeinsertbeforenewchildexists(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node newChild; + Node child; + int length; + String childName; + Node insertedNode; + std::vector expectedWhitespace; + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("name")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("position")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedWhitespace.push_back(SA::construct_from_utf8("address")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + + std::vector expectedNoWhitespace; + expectedNoWhitespace.push_back(SA::construct_from_utf8("name")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("position")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("address")); + + std::vector expected; + + std::vector result; + + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + length = (int) childList.getLength(); + + if (equals(6, length)) { + expected = expectedNoWhitespace; + refChild = childList.item(5); + newChild = childList.item(0); + } else { + expected = expectedWhitespace; + refChild = childList.item(11); + newChild = childList.item(1); + } + + insertedNode = employeeNode.insertBefore(newChild, refChild); + for (int indexN65757 = 0; indexN65757 != childList.getLength(); indexN65757++) { + child = (Node) childList.item(indexN65757); + childName = child.getNodeName(); + result.push_back(childName); + } + assertEquals(expected, result); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenewchildexists"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforenodeancestor.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforenodeancestor.hpp new file mode 100644 index 00000000..a6e16883 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforenodeancestor.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforenodeancestor +#define test_nodeinsertbeforenodeancestor + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if the node to be + * inserted is one of this nodes ancestors. + * + * Retrieve the second employee and attempt to insert a + * node that is one of its ancestors(root node). An + * attempt to insert such a node should raise the + * desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodeinsertbeforenodeancestor : public DOMTestCase +{ + public: + nodeinsertbeforenodeancestor(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newChild; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node insertedNode; + doc = (Document) load("staff", true); + newChild = doc.getDocumentElement(); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + refChild = childList.item(0); + + { + boolean success = false; + try { + insertedNode = employeeNode.insertBefore(newChild, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenodeancestor"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforenodename.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforenodename.hpp new file mode 100644 index 00000000..43211705 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforenodename.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforenodename +#define test_nodeinsertbeforenodename + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refchild)" method returns + * the node being inserted. + * + * Insert an Element node before the fourth + * child of the second employee and check the node + * returned from the "insertBefore(newChild,refChild)" + * method. The node returned should be "newChild". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class nodeinsertbeforenodename : public DOMTestCase +{ + public: + nodeinsertbeforenodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node newChild; + Node insertedNode; + String childName; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + refChild = childList.item(3); + newChild = doc.createElement(SA::construct_from_utf8("newChild")); + insertedNode = employeeNode.insertBefore(newChild, refChild); + childName = insertedNode.getNodeName(); + assertEquals("newChild", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforenomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforenomodificationallowederr.hpp new file mode 100644 index 00000000..bc707fb7 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforenomodificationallowederr.hpp @@ -0,0 +1,128 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforenomodificationallowederr +#define test_nodeinsertbeforenomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "insertBefore(newChild,refChild)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class nodeinsertbeforenomodificationallowederr : public DOMTestCase +{ + public: + nodeinsertbeforenomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entRef; + Node entElement; + Node createdNode; + Node insertedNode; + Node refChild; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entRef = genderNode.getFirstChild(); + assertNotNull(entRef); + nodeType = (int) entRef.getNodeType(); + + if (equals(1, nodeType)) { + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + } + entElement = entRef.getFirstChild(); + assertNotNull(entElement); + createdNode = doc.createElement(SA::construct_from_utf8("text3")); + + { + boolean success = false; + try { + insertedNode = entElement.insertBefore(createdNode, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforenomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforenomodificationallowederrEE.hpp new file mode 100644 index 00000000..a50b6313 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforenomodificationallowederrEE.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforenomodificationallowederrEE +#define test_nodeinsertbeforenomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Create an ent4 entity reference and and execute the "insertBefore(newChild,refChild)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenomodificationallowederr.xml +*/ + +template +class nodeinsertbeforenomodificationallowederrEE : public DOMTestCase +{ + public: + nodeinsertbeforenomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node entRef; + Node createdNode; + Node insertedNode; + Node refChild; + doc = (Document) load("staff", true); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + createdNode = doc.createElement(SA::construct_from_utf8("text3")); + + { + boolean success = false; + try { + insertedNode = entRef.insertBefore(createdNode, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforerefchildnonexistent.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforerefchildnonexistent.hpp new file mode 100644 index 00000000..5a660d2a --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforerefchildnonexistent.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforerefchildnonexistent +#define test_nodeinsertbeforerefchildnonexistent + +#include "dom_conf_test.hpp" + +/** + * The "insertBefore(newChild,refChild)" method raises a + * NOT_FOUND_ERR DOMException if the reference child is + * not a child of this node. + * + * Retrieve the second employee and attempt to insert a + * new node before a reference node that is not a child + * of this node. An attempt to insert before a non child + * node should raise the desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodeinsertbeforerefchildnonexistent : public DOMTestCase +{ + public: + nodeinsertbeforerefchildnonexistent(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node refChild; + Node newChild; + NodeList elementList; + Node elementNode; + Node insertedNode; + doc = (Document) load("staff", true); + newChild = doc.createElement(SA::construct_from_utf8("newChild")); + refChild = doc.createElement(SA::construct_from_utf8("refChild")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + elementNode = elementList.item(1); + + { + boolean success = false; + try { + insertedNode = elementNode.insertBefore(newChild, refChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforerefchildnonexistent"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeinsertbeforerefchildnull.hpp b/tests/DOM/conformance/level1/core/nodeinsertbeforerefchildnull.hpp new file mode 100644 index 00000000..98589b73 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeinsertbeforerefchildnull.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeinsertbeforerefchildnull +#define test_nodeinsertbeforerefchildnull + +#include "dom_conf_test.hpp" + +/** + * If the "refChild" is null then the + * "insertBefore(newChild,refChild)" method inserts the + * node "newChild" at the end of the list of children. + * + * Retrieve the second employee and invoke the + * "insertBefore(newChild,refChild)" method with + * refChild=null. Since "refChild" is null the "newChild" + * should be added to the end of the list. The last item + * in the list is checked after insertion. The last Element + * node of the list should be "newChild". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ + +template +class nodeinsertbeforerefchildnull : public DOMTestCase +{ + public: + nodeinsertbeforerefchildnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node refChild; + Node newChild; + Node child; + String childName; + Node insertedNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + newChild = doc.createElement(SA::construct_from_utf8("newChild")); + insertedNode = employeeNode.insertBefore(newChild, refChild); + child = employeeNode.getLastChild(); + childName = child.getNodeName(); + assertEquals("newChild", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforerefchildnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodelistindexequalzero.hpp b/tests/DOM/conformance/level1/core/nodelistindexequalzero.hpp new file mode 100644 index 00000000..209bfa2a --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodelistindexequalzero.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodelistindexequalzero +#define test_nodelistindexequalzero + +#include "dom_conf_test.hpp" + +/** + * Create a list of all the children elements of the third + * employee and access its first child by using an index + * of 0. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +*/ + +template +class nodelistindexequalzero : public DOMTestCase +{ + public: + nodelistindexequalzero(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + child = employeeList.item(0); + childName = child.getNodeName(); + + if (!equals("#text", childName)) { + assertEquals("employeeId", childName); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistindexequalzero"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodelistindexgetlength.hpp b/tests/DOM/conformance/level1/core/nodelistindexgetlength.hpp new file mode 100644 index 00000000..de6d9364 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodelistindexgetlength.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodelistindexgetlength +#define test_nodelistindexgetlength + +#include "dom_conf_test.hpp" + +/** + * The "getLength()" method returns the number of nodes + * in the list should be 6 (no whitespace) or 13. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +*/ + +template +class nodelistindexgetlength : public DOMTestCase +{ + public: + nodelistindexgetlength(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + int length; + int expectedCount = 0; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + length = (int) employeeList.getLength(); + assertTrue( + (equals(6, length) | equals(13, length)) +); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistindexgetlength"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodelistindexgetlengthofemptylist.hpp b/tests/DOM/conformance/level1/core/nodelistindexgetlengthofemptylist.hpp new file mode 100644 index 00000000..0137f899 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodelistindexgetlengthofemptylist.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodelistindexgetlengthofemptylist +#define test_nodelistindexgetlengthofemptylist + +#include "dom_conf_test.hpp" + +/** + * The "getLength()" method returns the number of nodes + * in the list.(Test for EMPTY list) + * + * Create a list of all the children of the Text node + * inside the first child of the third employee and + * invoke the "getLength()" method. It should contain + * the value 0. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +*/ + +template +class nodelistindexgetlengthofemptylist : public DOMTestCase +{ + public: + nodelistindexgetlengthofemptylist(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node childNode; + Node textNode; + NodeList textList; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + childNode = employeeList.item(1); + textNode = childNode.getFirstChild(); + textList = textNode.getChildNodes(); + assertSize(0, textList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistindexgetlengthofemptylist"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodelistindexnotzero.hpp b/tests/DOM/conformance/level1/core/nodelistindexnotzero.hpp new file mode 100644 index 00000000..267e3121 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodelistindexnotzero.hpp @@ -0,0 +1,111 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodelistindexnotzero +#define test_nodelistindexnotzero + +#include "dom_conf_test.hpp" + +/** + * Create a list of all the children elements of the third + * employee and access its fourth child by using an index + * of 3. This should result in "name" being + * selected. Further we evaluate its content(by using + * the "getNodeName()" method) to ensure the proper + * element was accessed. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +*/ + +template +class nodelistindexnotzero : public DOMTestCase +{ + public: + nodelistindexnotzero(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + int length; + String childName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + length = (int) employeeList.getLength(); + + if (equals(6, length)) { + child = employeeList.item(1); + } else { + child = employeeList.item(3); + } + + childName = child.getNodeName(); + assertEquals("name", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistindexnotzero"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodelistreturnfirstitem.hpp b/tests/DOM/conformance/level1/core/nodelistreturnfirstitem.hpp new file mode 100644 index 00000000..4be86449 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodelistreturnfirstitem.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodelistreturnfirstitem +#define test_nodelistreturnfirstitem + +#include "dom_conf_test.hpp" + +/** + * Get the first child of the third employee using NodeList.item(0) + * which will either be a Text node (whitespace) or employeeId element. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +*/ + +template +class nodelistreturnfirstitem : public DOMTestCase +{ + public: + nodelistreturnfirstitem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + int length; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + child = employeeList.item(0); + childName = child.getNodeName(); + length = (int) employeeList.getLength(); + + if (equals(6, length)) { + assertEquals("employeeId", childName); + } else { + assertEquals("#text", childName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistreturnfirstitem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodelistreturnlastitem.hpp b/tests/DOM/conformance/level1/core/nodelistreturnlastitem.hpp new file mode 100644 index 00000000..0ec5cd71 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodelistreturnlastitem.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodelistreturnlastitem +#define test_nodelistreturnlastitem + +#include "dom_conf_test.hpp" + +/** + * Get this last child of the third employee using NodeList.item(NodeList.length - 1) + * and check that it is either a Text element (with whitespace) or an address element. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +*/ + +template +class nodelistreturnlastitem : public DOMTestCase +{ + public: + nodelistreturnlastitem(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + int length; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + length = (int) employeeList.getLength(); + + if (equals(6, length)) { + child = employeeList.item(5); + childName = child.getNodeName(); + assertEquals("address", childName); + } else { + child = employeeList.item(12); + childName = child.getNodeName(); + assertEquals("#text", childName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistreturnlastitem"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodelisttraverselist.hpp b/tests/DOM/conformance/level1/core/nodelisttraverselist.hpp new file mode 100644 index 00000000..f0a26fb8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodelisttraverselist.hpp @@ -0,0 +1,139 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodelisttraverselist +#define test_nodelisttraverselist + +#include "dom_conf_test.hpp" + +/** + * The range of valid child node indices is 0 thru length -1 + * + * Create a list of all the children elements of the third + * employee and traverse the list from index=0 thru + * length -1. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +*/ + +template +class nodelisttraverselist : public DOMTestCase +{ + public: + nodelisttraverselist(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList employeeList; + Node child; + String childName; + std::vector result; + + int length; + std::vector expectedWhitespace; + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("name")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("position")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWhitespace.push_back(SA::construct_from_utf8("address")); + expectedWhitespace.push_back(SA::construct_from_utf8("#text")); + + std::vector expectedNoWhitespace; + expectedNoWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("name")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("position")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedNoWhitespace.push_back(SA::construct_from_utf8("address")); + + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(2); + employeeList = employeeNode.getChildNodes(); + length = (int) employeeList.getLength(); + for (int indexN65700 = 0; indexN65700 != employeeList.getLength(); indexN65700++) { + child = (Node) employeeList.item(indexN65700); + childName = child.getNodeName(); + result.push_back(childName); + } + + if (equals(6, length)) { + assertEquals(expectedNoWhitespace, result); + } else { + assertEquals(expectedWhitespace, result); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelisttraverselist"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodenotationnodeattributes.hpp b/tests/DOM/conformance/level1/core/nodenotationnodeattributes.hpp new file mode 100644 index 00000000..462e944b --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodenotationnodeattributes.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodenotationnodeattributes +#define test_nodenotationnodeattributes + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a Notation + * Node returns null. + * Retrieve the Notation declaration inside the DocumentType + * node and invoke the "getAttributes()" method on the + * Notation Node. It should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class nodenotationnodeattributes : public DOMTestCase +{ + public: + nodenotationnodeattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Node notationNode; + NamedNodeMap attrList; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = notations.getNamedItem(SA::construct_from_utf8("notation1")); + assertNotNull(notationNode); + attrList = notationNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodenotationnodeattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodenotationnodename.hpp b/tests/DOM/conformance/level1/core/nodenotationnodename.hpp new file mode 100644 index 00000000..35a5c472 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodenotationnodename.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodenotationnodename +#define test_nodenotationnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * Notation Node is the name of the notation. + * Retrieve the Notation declaration inside the + * DocumentType node and check the string returned + * by the "getNodeName()" method. It should be equal to + * "notation1". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class nodenotationnodename : public DOMTestCase +{ + public: + nodenotationnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Node notationNode; + String notationName; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = notations.getNamedItem(SA::construct_from_utf8("notation1")); + assertNotNull(notationNode); + notationName = notationNode.getNodeName(); + assertEquals("notation1", notationName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodenotationnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodenotationnodetype.hpp b/tests/DOM/conformance/level1/core/nodenotationnodetype.hpp new file mode 100644 index 00000000..b8cb4696 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodenotationnodetype.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodenotationnodetype +#define test_nodenotationnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for an Notation Node + * returns the constant value 12. + * Retrieve the Notation declaration in the DocumentType + * node and invoke the "getNodeType()" method. The method + * should return 12. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodenotationnodetype : public DOMTestCase +{ + public: + nodenotationnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Notation notationNode; + int nodeType; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation1")); + assertNotNull(notationNode); + nodeType = (int) notationNode.getNodeType(); + assertEquals(12, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodenotationnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodenotationnodevalue.hpp b/tests/DOM/conformance/level1/core/nodenotationnodevalue.hpp new file mode 100644 index 00000000..d802afc1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodenotationnodevalue.hpp @@ -0,0 +1,104 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodenotationnodevalue +#define test_nodenotationnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * Notation Node is null. + * Retrieve the Notation declaration inside the + * DocumentType node and check the string returned + * by the "getNodeValue()" method. It should be equal to + * null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodenotationnodevalue : public DOMTestCase +{ + public: + nodenotationnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Node notationNode; + String notationValue; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = notations.getNamedItem(SA::construct_from_utf8("notation1")); + assertNotNull(notationNode); + notationValue = notationNode.getNodeValue(); + assertNull(notationValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodenotationnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeparentnode.hpp b/tests/DOM/conformance/level1/core/nodeparentnode.hpp new file mode 100644 index 00000000..b09987dd --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeparentnode.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeparentnode +#define test_nodeparentnode + +#include "dom_conf_test.hpp" + +/** + * The "getParentNode()" method returns the parent + * of this node. + * + * Retrieve the second employee and invoke the + * "getParentNode()" method on this node. It should + * be set to "staff". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ + +template +class nodeparentnode : public DOMTestCase +{ + public: + nodeparentnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + Node parentNode; + String parentName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + parentNode = employeeNode.getParentNode(); + parentName = parentNode.getNodeName(); + + if (("image/svg+xml" == getContentType())) { + assertEquals("svg", parentName); + } else { + assertEquals("staff", parentName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeparentnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeparentnodenull.hpp b/tests/DOM/conformance/level1/core/nodeparentnodenull.hpp new file mode 100644 index 00000000..4c129e3d --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeparentnodenull.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeparentnodenull +#define test_nodeparentnodenull + +#include "dom_conf_test.hpp" + +/** + * The "getParentNode()" method invoked on a node that has + * just been created and not yet added to the tree is null. + * Create a new "employee" Element node using the + * "createElement(name)" method from the Document interface. + * Since this new node has not yet been added to the tree, + * the "getParentNode()" method will return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +*/ + +template +class nodeparentnodenull : public DOMTestCase +{ + public: + nodeparentnodenull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element createdNode; + Node parentNode; + doc = (Document) load("staff", false); + createdNode = doc.createElement(SA::construct_from_utf8("employee")); + parentNode = createdNode.getParentNode(); + assertNull(parentNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeparentnodenull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodeattributes.hpp b/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodeattributes.hpp new file mode 100644 index 00000000..d36f7378 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodeattributes.hpp @@ -0,0 +1,98 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeprocessinginstructionnodeattributes +#define test_nodeprocessinginstructionnodeattributes + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a Processing + * Instruction Node returns null. + * + * Retrieve the Processing Instruction node and invoke + * the "getAttributes()" method. It should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ + +template +class nodeprocessinginstructionnodeattributes : public DOMTestCase +{ + public: + nodeprocessinginstructionnodeattributes(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList testList; + Node piNode; + NamedNodeMap attrList; + doc = (Document) load("staff", false); + testList = doc.getChildNodes(); + piNode = testList.item(0); + attrList = piNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionnodeattributes"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodename.hpp b/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodename.hpp new file mode 100644 index 00000000..145d20a4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodename.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeprocessinginstructionnodename +#define test_nodeprocessinginstructionnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * Processing Instruction Node is the target. + * + * Retrieve the Processing Instruction Node in the XML file + * and check the string returned by the "getNodeName()" + * method. It should be equal to "XML-STYLE". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class nodeprocessinginstructionnodename : public DOMTestCase +{ + public: + nodeprocessinginstructionnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList testList; + Node piNode; + String piName; + doc = (Document) load("staff", false); + testList = doc.getChildNodes(); + piNode = testList.item(0); + piName = piNode.getNodeName(); + assertEquals("TEST-STYLE", piName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodetype.hpp b/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodetype.hpp new file mode 100644 index 00000000..dd7c6a8f --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodetype.hpp @@ -0,0 +1,99 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeprocessinginstructionnodetype +#define test_nodeprocessinginstructionnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a Processing Instruction + * node returns the constant value 7. + * + * Retrieve a NodeList of child elements from the document. + * Retrieve the first child and invoke the "getNodeType()" + * method. The method should return 7. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodeprocessinginstructionnodetype : public DOMTestCase +{ + public: + nodeprocessinginstructionnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList testList; + Node piNode; + int nodeType; + doc = (Document) load("staff", false); + testList = doc.getChildNodes(); + piNode = testList.item(0); + nodeType = (int) piNode.getNodeType(); + assertEquals(7, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodevalue.hpp b/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodevalue.hpp new file mode 100644 index 00000000..8b9da4ef --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeprocessinginstructionnodevalue.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeprocessinginstructionnodevalue +#define test_nodeprocessinginstructionnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * Processing Instruction Node is the content of the + * Processing Instruction(exclude the target). + * + * Retrieve the Processing Instruction node in the XML file + * and check the string returned by the "getNodeValue()" + * method. It should be equal to "PIDATA". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodeprocessinginstructionnodevalue : public DOMTestCase +{ + public: + nodeprocessinginstructionnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList testList; + Node piNode; + String piValue; + doc = (Document) load("staff", false); + testList = doc.getChildNodes(); + piNode = testList.item(0); + piValue = piNode.getNodeValue(); + assertEquals("PIDATA", piValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodeprocessinginstructionsetnodevalue.hpp b/tests/DOM/conformance/level1/core/nodeprocessinginstructionsetnodevalue.hpp new file mode 100644 index 00000000..482bf7e8 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodeprocessinginstructionsetnodevalue.hpp @@ -0,0 +1,100 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodeprocessinginstructionsetnodevalue +#define test_nodeprocessinginstructionsetnodevalue + +#include "dom_conf_test.hpp" + +/** + * Setting the nodeValue should change the value returned by + * nodeValue and ProcessingInstruction.getData. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1004215813 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=181 +*/ + +template +class nodeprocessinginstructionsetnodevalue : public DOMTestCase +{ + public: + nodeprocessinginstructionsetnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList testList; + Node piNode; + String piValue; + doc = (Document) load("staff", true); + testList = doc.getChildNodes(); + piNode = testList.item(0); + piNode.setNodeValue(SA::construct_from_utf8("Something different")); + piValue = piNode.getNodeValue(); + assertEquals("Something different", piValue); + piValue = ((ProcessingInstruction) /*Node */piNode).getData(); + assertEquals("Something different", piValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeprocessinginstructionsetnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/noderemovechild.hpp b/tests/DOM/conformance/level1/core/noderemovechild.hpp new file mode 100644 index 00000000..55aaa7de --- /dev/null +++ b/tests/DOM/conformance/level1/core/noderemovechild.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_noderemovechild +#define test_noderemovechild + +#include "dom_conf_test.hpp" + +/** + * The "removeChild(oldChild)" method removes the child node + * indicated by "oldChild" from the list of children and + * returns it. + * + * Remove the first employee by invoking the + * "removeChild(oldChild)" method an checking the + * node returned by the "getParentNode()" method. It + * should be set to null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +*/ + +template +class noderemovechild : public DOMTestCase +{ + public: + noderemovechild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + NodeList childList; + Node childToRemove; + Node removedChild; + Node parentNode; + doc = (Document) load("staff", true); + rootNode = doc.getDocumentElement(); + childList = rootNode.getChildNodes(); + childToRemove = childList.item(1); + removedChild = rootNode.removeChild(childToRemove); + parentNode = removedChild.getParentNode(); + assertNull(parentNode); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/noderemovechildgetnodename.hpp b/tests/DOM/conformance/level1/core/noderemovechildgetnodename.hpp new file mode 100644 index 00000000..58ca499f --- /dev/null +++ b/tests/DOM/conformance/level1/core/noderemovechildgetnodename.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_noderemovechildgetnodename +#define test_noderemovechildgetnodename + +#include "dom_conf_test.hpp" + +/** + * Remove the first child of the second employee + * and check the NodeName returned by the + * "removeChild(oldChild)" method. The returned node + * should have a NodeName equal to "#text" or employeeId depending on whitespace. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +*/ + +template +class noderemovechildgetnodename : public DOMTestCase +{ + public: + noderemovechildgetnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node removedChild; + String childName; + int length; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + length = (int) childList.getLength(); + oldChild = childList.item(0); + removedChild = employeeNode.removeChild(oldChild); + childName = removedChild.getNodeName(); + + if (equals(6, length)) { + assertEquals("employeeId", childName); + } else { + assertEquals("#text", childName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildgetnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/noderemovechildnode.hpp b/tests/DOM/conformance/level1/core/noderemovechildnode.hpp new file mode 100644 index 00000000..07765a19 --- /dev/null +++ b/tests/DOM/conformance/level1/core/noderemovechildnode.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_noderemovechildnode +#define test_noderemovechildnode + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second employee and remove its first child. + * After the removal, the second employee should have five or twelve + * children and the first child should now be the child + * that used to be at the second position in the list. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +*/ + +template +class noderemovechildnode : public DOMTestCase +{ + public: + noderemovechildnode(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node child; + String childName; + int length; + Node removedChild; + String removedName; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + oldChild = childList.item(0); + removedChild = employeeNode.removeChild(oldChild); + removedName = removedChild.getNodeName(); + child = childList.item(0); + childName = child.getNodeName(); + length = (int) childList.getLength(); + + if (equals(5, length)) { + assertEquals("employeeId", removedName); + assertEquals("name", childName); + } else { + assertEquals("#text", removedName); + assertEquals("employeeId", childName); + assertEquals(12, length); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnode"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/noderemovechildnomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/noderemovechildnomodificationallowederr.hpp new file mode 100644 index 00000000..0308bc80 --- /dev/null +++ b/tests/DOM/conformance/level1/core/noderemovechildnomodificationallowederr.hpp @@ -0,0 +1,125 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_noderemovechildnomodificationallowederr +#define test_noderemovechildnomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "removeChild(oldChild)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "removeChild(oldChild)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +*/ + +template +class noderemovechildnomodificationallowederr : public DOMTestCase +{ + public: + noderemovechildnomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entRef; + Node entElement; + Node removedNode; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entRef = genderNode.getFirstChild(); + assertNotNull(entRef); + nodeType = (int) entRef.getNodeType(); + + if (equals(1, nodeType)) { + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + } + entElement = entRef.getFirstChild(); + assertNotNull(entElement); + + { + boolean success = false; + try { + removedNode = entRef.removeChild(entElement); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/noderemovechildnomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/noderemovechildnomodificationallowederrEE.hpp new file mode 100644 index 00000000..c793cca5 --- /dev/null +++ b/tests/DOM/conformance/level1/core/noderemovechildnomodificationallowederrEE.hpp @@ -0,0 +1,112 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_noderemovechildnomodificationallowederrEE +#define test_noderemovechildnomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "removeChild(oldChild)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Create an entity reference and execute the "removeChild(oldChild)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnomodificationallowederr.xml +*/ + +template +class noderemovechildnomodificationallowederrEE : public DOMTestCase +{ + public: + noderemovechildnomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node entRef; + Node entText; + Node removedNode; + doc = (Document) load("staff", true); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + entText = entRef.getFirstChild(); + assertNotNull(entText); + + { + boolean success = false; + try { + removedNode = entRef.removeChild(entText); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildnomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/noderemovechildoldchildnonexistent.hpp b/tests/DOM/conformance/level1/core/noderemovechildoldchildnonexistent.hpp new file mode 100644 index 00000000..fa32dabc --- /dev/null +++ b/tests/DOM/conformance/level1/core/noderemovechildoldchildnonexistent.hpp @@ -0,0 +1,114 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_noderemovechildoldchildnonexistent +#define test_noderemovechildoldchildnonexistent + +#include "dom_conf_test.hpp" + +/** + * The "removeChild(oldChild)" method raises a + * NOT_FOUND_ERR DOMException if the old child is + * not a child of this node. + * + * Retrieve the second employee and attempt to remove a + * node that is not one of its children. An attempt to + * remove such a node should raise the desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class noderemovechildoldchildnonexistent : public DOMTestCase +{ + public: + noderemovechildoldchildnonexistent(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node oldChild; + NodeList elementList; + Node elementNode; + Node removedChild; + doc = (Document) load("staff", true); + oldChild = doc.createElement(SA::construct_from_utf8("oldChild")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + elementNode = elementList.item(1); + + { + boolean success = false; + try { + removedChild = elementNode.removeChild(oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/noderemovechildoldchildnonexistent"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechild.hpp b/tests/DOM/conformance/level1/core/nodereplacechild.hpp new file mode 100644 index 00000000..e952dcfe --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechild.hpp @@ -0,0 +1,110 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechild +#define test_nodereplacechild + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method replaces + * the node "oldChild" with the node "newChild". + * + * Replace the first element of the second employee with + * a newly created Element node. Check the first position + * after the replacement operation is completed. The new + * Element should be "newChild". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ + +template +class nodereplacechild : public DOMTestCase +{ + public: + nodereplacechild(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node newChild; + Node child; + String childName; + Node replacedNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + oldChild = childList.item(0); + newChild = doc.createElement(SA::construct_from_utf8("newChild")); + replacedNode = employeeNode.replaceChild(newChild, oldChild); + child = childList.item(0); + childName = child.getNodeName(); + assertEquals("newChild", childName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechild"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechildinvalidnodetype.hpp b/tests/DOM/conformance/level1/core/nodereplacechildinvalidnodetype.hpp new file mode 100644 index 00000000..1beda21c --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechildinvalidnodetype.hpp @@ -0,0 +1,118 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechildinvalidnodetype +#define test_nodereplacechildinvalidnodetype + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if this node is of + * a type that does not allow children of the type "newChild" + * to be inserted. + * + * Retrieve the root node and attempt to replace + * one of its children with a newly created Attr node. + * An Element node cannot have children of the "Attr" + * type, therefore the desired exception should be raised. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodereplacechildinvalidnodetype : public DOMTestCase +{ + public: + nodereplacechildinvalidnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element rootNode; + Node newChild; + NodeList elementList; + Node oldChild; + Node replacedChild; + doc = (Document) load("staff", true); + rootNode = doc.getDocumentElement(); + newChild = doc.createAttribute(SA::construct_from_utf8("newAttribute")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + oldChild = elementList.item(1); + + { + boolean success = false; + try { + replacedChild = rootNode.replaceChild(newChild, oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildinvalidnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechildnewchilddiffdocument.hpp b/tests/DOM/conformance/level1/core/nodereplacechildnewchilddiffdocument.hpp new file mode 100644 index 00000000..34412ba9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechildnewchilddiffdocument.hpp @@ -0,0 +1,120 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechildnewchilddiffdocument +#define test_nodereplacechildnewchilddiffdocument + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method raises a + * WRONG_DOCUMENT_ERR DOMException if the "newChild" was + * created from a different document than the one that + * created this node. + * + * Retrieve the second employee and attempt to replace one + * of its children with a node created from a different + * document. An attempt to make such a replacement + * should raise the desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ + +template +class nodereplacechildnewchilddiffdocument : public DOMTestCase +{ + public: + nodereplacechildnewchilddiffdocument(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc1; + Document doc2; + Node oldChild; + Node newChild; + NodeList elementList; + Node elementNode; + Node replacedChild; + doc1 = (Document) load("staff", false); + doc2 = (Document) load("staff", true); + newChild = doc1.createElement(SA::construct_from_utf8("newChild")); + elementList = doc2.getElementsByTagName(SA::construct_from_utf8("employee")); + elementNode = elementList.item(1); + oldChild = elementNode.getFirstChild(); + + { + boolean success = false; + try { + replacedChild = elementNode.replaceChild(newChild, oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnewchilddiffdocument"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechildnewchildexists.hpp b/tests/DOM/conformance/level1/core/nodereplacechildnewchildexists.hpp new file mode 100644 index 00000000..628c4972 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechildnewchildexists.hpp @@ -0,0 +1,148 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechildnewchildexists +#define test_nodereplacechildnewchildexists + +#include "dom_conf_test.hpp" + +/** + * Retrieve the second employee and replace its TWELFTH + * child(address) with its SECOND child(employeeId). After the + * replacement the second child should now be the one that used + * to be at the third position and the TWELFTH child should be the + * one that used to be at the SECOND position. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ + +template +class nodereplacechildnewchildexists : public DOMTestCase +{ + public: + nodereplacechildnewchildexists(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node newChild; + String childName; + Node childNode; + int length; + std::vector actual; + + std::vector expected; + + std::vector expectedWithoutWhitespace; + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("name")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("position")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedWithoutWhitespace.push_back(SA::construct_from_utf8("employeeId")); + + std::vector expectedWithWhitespace; + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("name")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("position")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("salary")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("gender")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("employeeId")); + expectedWithWhitespace.push_back(SA::construct_from_utf8("#text")); + + Node replacedChild; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + length = (int) childList.getLength(); + + if (equals(13, length)) { + newChild = childList.item(1); + oldChild = childList.item(11); + expected = expectedWithWhitespace; + } else { + newChild = childList.item(0); + oldChild = childList.item(5); + expected = expectedWithoutWhitespace; + } + + replacedChild = employeeNode.replaceChild(newChild, oldChild); + assertSame(oldChild, replacedChild); +for (int indexN65758 = 0; indexN65758 != childList.getLength(); indexN65758++) { + childNode = (Node) childList.item(indexN65758); + childName = childNode.getNodeName(); + actual.push_back(childName); + } + assertEquals(expected, actual); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnewchildexists"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechildnodeancestor.hpp b/tests/DOM/conformance/level1/core/nodereplacechildnodeancestor.hpp new file mode 100644 index 00000000..357df7f9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechildnodeancestor.hpp @@ -0,0 +1,119 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechildnodeancestor +#define test_nodereplacechildnodeancestor + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method raises a + * HIERARCHY_REQUEST_ERR DOMException if the node to put + * in is one of this node's ancestors. + * + * Retrieve the second employee and attempt to replace + * one of its children with an ancestor node(root node). + * An attempt to make such a replacement should raise the + * desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodereplacechildnodeancestor : public DOMTestCase +{ + public: + nodereplacechildnodeancestor(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newChild; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node replacedNode; + doc = (Document) load("staff", true); + newChild = doc.getDocumentElement(); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + oldChild = childList.item(0); + + { + boolean success = false; + try { + replacedNode = employeeNode.replaceChild(newChild, oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::HIERARCHY_REQUEST_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnodeancestor"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechildnodename.hpp b/tests/DOM/conformance/level1/core/nodereplacechildnodename.hpp new file mode 100644 index 00000000..60536082 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechildnodename.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechildnodename +#define test_nodereplacechildnodename + +#include "dom_conf_test.hpp" + +/** + * Replace the second Element of the second employee with + * a newly created node Element and check the NodeName + * returned by the "replaceChild(newChild,oldChild)" + * method. The returned node should have a NodeName equal + * to "employeeId". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ + +template +class nodereplacechildnodename : public DOMTestCase +{ + public: + nodereplacechildnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node employeeNode; + NodeList childList; + Node oldChild; + Node newChild; + Node replacedNode; + int length; + String childName; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + employeeNode = elementList.item(1); + childList = employeeNode.getChildNodes(); + length = (int) childList.getLength(); + oldChild = childList.item(1); + newChild = doc.createElement(SA::construct_from_utf8("newChild")); + replacedNode = employeeNode.replaceChild(newChild, oldChild); + childName = replacedNode.getNodeName(); + + if (equals(6, length)) { + assertEquals("name", childName); + } else { + assertEquals("employeeId", childName); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechildnomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/nodereplacechildnomodificationallowederr.hpp new file mode 100644 index 00000000..8bb58be9 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechildnomodificationallowederr.hpp @@ -0,0 +1,126 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechildnomodificationallowederr +#define test_nodereplacechildnomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the FIRST item + * from the entity reference and execute the "replaceChild(newChild,oldChild)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ + +template +class nodereplacechildnomodificationallowederr : public DOMTestCase +{ + public: + nodereplacechildnomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + Node entRef; + Node entElement; + Node createdNode; + Node replacedChild; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entRef = genderNode.getFirstChild(); + nodeType = (int) entRef.getNodeType(); + + if (equals(1, nodeType)) { + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + } + entElement = entRef.getFirstChild(); + createdNode = doc.createElement(SA::construct_from_utf8("newChild")); + + { + boolean success = false; + try { + replacedChild = entRef.replaceChild(createdNode, entElement); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechildnomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/nodereplacechildnomodificationallowederrEE.hpp new file mode 100644 index 00000000..a6717d0b --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechildnomodificationallowederrEE.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechildnomodificationallowederrEE +#define test_nodereplacechildnomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Create an entity reference execute the "replaceChild(newChild,oldChild)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnomodificationallowederr.xml +*/ + +template +class nodereplacechildnomodificationallowederrEE : public DOMTestCase +{ + public: + nodereplacechildnomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node entRef; + Node entText; + Node createdNode; + Node replacedChild; + doc = (Document) load("staff", true); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + entText = entRef.getFirstChild(); + createdNode = doc.createElement(SA::construct_from_utf8("newChild")); + + { + boolean success = false; + try { + replacedChild = entRef.replaceChild(createdNode, entText); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodereplacechildoldchildnonexistent.hpp b/tests/DOM/conformance/level1/core/nodereplacechildoldchildnonexistent.hpp new file mode 100644 index 00000000..bb68d472 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodereplacechildoldchildnonexistent.hpp @@ -0,0 +1,116 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodereplacechildoldchildnonexistent +#define test_nodereplacechildoldchildnonexistent + +#include "dom_conf_test.hpp" + +/** + * The "replaceChild(newChild,oldChild)" method raises a + * NOT_FOUND_ERR DOMException if the old child is + * not a child of this node. + * + * Retrieve the second employee and attempt to replace a + * node that is not one of its children. An attempt to + * replace such a node should raise the desired exception. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class nodereplacechildoldchildnonexistent : public DOMTestCase +{ + public: + nodereplacechildoldchildnonexistent(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node oldChild; + Node newChild; + NodeList elementList; + Node elementNode; + Node replacedNode; + doc = (Document) load("staff", true); + newChild = doc.createElement(SA::construct_from_utf8("newChild")); + oldChild = doc.createElement(SA::construct_from_utf8("oldChild")); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("employee")); + elementNode = elementList.item(1); + + { + boolean success = false; + try { + replacedNode = elementNode.replaceChild(newChild, oldChild); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NOT_FOUND_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildoldchildnonexistent"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodesetnodevaluenomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/nodesetnodevaluenomodificationallowederr.hpp new file mode 100644 index 00000000..3e3192b4 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodesetnodevaluenomodificationallowederr.hpp @@ -0,0 +1,128 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodesetnodevaluenomodificationallowederr +#define test_nodesetnodevaluenomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "setNodeValue(nodeValue)" method causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the SECOND item + * from the entity reference and execute the "setNodeValue(nodeValue)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68D080')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodesetnodevaluenomodificationallowederr : public DOMTestCase +{ + public: + nodesetnodevaluenomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node genderNode; + EntityReference entRef; + Element entElement; + CharacterData entElementText; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + genderNode = genderList.item(2); + entRef = (EntityReference) genderNode.getFirstChild(); + assertNotNull(entRef); + nodeType = (int) entRef.getNodeType(); + + if (equals(1, nodeType)) { + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + } + entElement = (Element) entRef.getFirstChild(); + assertNotNull(entElement); + entElementText = (CharacterData) entElement.getFirstChild(); + assertNotNull(entElementText); + + { + boolean success = false; + try { + entElementText.setNodeValue(SA::construct_from_utf8("newValue")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodesetnodevaluenomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodesetnodevaluenomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/nodesetnodevaluenomodificationallowederrEE.hpp new file mode 100644 index 00000000..aa4a838d --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodesetnodevaluenomodificationallowederrEE.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodesetnodevaluenomodificationallowederrEE +#define test_nodesetnodevaluenomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * Create an entity reference and execute the "setNodeValue(nodeValue)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68D080')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodesetnodevaluenomodificationallowederr.xml +*/ + +template +class nodesetnodevaluenomodificationallowederrEE : public DOMTestCase +{ + public: + nodesetnodevaluenomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + EntityReference entRef; + CharacterData entText; + doc = (Document) load("staff", true); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent3")); + assertNotNull(entRef); + entText = (CharacterData) entRef.getFirstChild(); + assertNotNull(entText); + + { + boolean success = false; + try { + entText.setNodeValue(SA::construct_from_utf8("newValue")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodesetnodevaluenomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodetextnodeattribute.hpp b/tests/DOM/conformance/level1/core/nodetextnodeattribute.hpp new file mode 100644 index 00000000..f8816e1c --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodetextnodeattribute.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodetextnodeattribute +#define test_nodetextnodeattribute + +#include "dom_conf_test.hpp" + +/** + * The "getAttributes()" method invoked on a Text + * Node returns null. + * Retrieve the Text node from the last child of the + * first employee and invoke the "getAttributes()" method + * on the Text Node. It should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772 +*/ + +template +class nodetextnodeattribute : public DOMTestCase +{ + public: + nodetextnodeattribute(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node testAddr; + Node textNode; + NamedNodeMap attrList; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = elementList.item(0); + textNode = testAddr.getFirstChild(); + attrList = textNode.getAttributes(); + assertNull(attrList); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodetextnodeattribute"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodetextnodename.hpp b/tests/DOM/conformance/level1/core/nodetextnodename.hpp new file mode 100644 index 00000000..077703be --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodetextnodename.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodetextnodename +#define test_nodetextnodename + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeName()" method for a + * Text Node is "#text". + * + * Retrieve the Text Node from the last child of the + * first employee and check the string returned + * by the "getNodeName()" method. It should be equal to + * "#text". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ + +template +class nodetextnodename : public DOMTestCase +{ + public: + nodetextnodename(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Node textNode; + String textName; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = (Element) elementList.item(0); + textNode = testAddr.getFirstChild(); + textName = textNode.getNodeName(); + assertEquals("#text", textName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodetextnodename"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodetextnodetype.hpp b/tests/DOM/conformance/level1/core/nodetextnodetype.hpp new file mode 100644 index 00000000..27eacff2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodetextnodetype.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodetextnodetype +#define test_nodetextnodetype + +#include "dom_conf_test.hpp" + +/** + * The "getNodeType()" method for a Text Node + * returns the constant value 3. + * + * Retrieve the Text node from the last child of + * the first employee and invoke the "getNodeType()" + * method. The method should return 3. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ + +template +class nodetextnodetype : public DOMTestCase +{ + public: + nodetextnodetype(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Node textNode; + int nodeType; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = (Element) elementList.item(0); + textNode = testAddr.getFirstChild(); + nodeType = (int) textNode.getNodeType(); + assertEquals(3, nodeType); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodetextnodetype"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodetextnodevalue.hpp b/tests/DOM/conformance/level1/core/nodetextnodevalue.hpp new file mode 100644 index 00000000..24197acd --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodetextnodevalue.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodetextnodevalue +#define test_nodetextnodevalue + +#include "dom_conf_test.hpp" + +/** + * The string returned by the "getNodeValue()" method for a + * Text Node is the content of the Text node. + * + * Retrieve the Text node from the last child of the first + * employee and check the string returned by the + * "getNodeValue()" method. It should be equal to + * "1230 North Ave. Dallas, Texas 98551". +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class nodetextnodevalue : public DOMTestCase +{ + public: + nodetextnodevalue(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Element testAddr; + Node textNode; + String textValue; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + testAddr = (Element) elementList.item(0); + textNode = testAddr.getFirstChild(); + textValue = textNode.getNodeValue(); + assertEquals("1230 North Ave. Dallas, Texas 98551", textValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodetextnodevalue"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue01.hpp b/tests/DOM/conformance/level1/core/nodevalue01.hpp new file mode 100644 index 00000000..399b4413 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue01.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue01 +#define test_nodevalue01 + +#include "dom_conf_test.hpp" + +/** + * An element is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ + +template +class nodevalue01 : public DOMTestCase +{ + public: + nodevalue01(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Element newNode; + String newValue; + doc = (Document) load("staff", true); + newNode = doc.createElement(SA::construct_from_utf8("address")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue01"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue02.hpp b/tests/DOM/conformance/level1/core/nodevalue02.hpp new file mode 100644 index 00000000..376809af --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue02.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue02 +#define test_nodevalue02 + +#include "dom_conf_test.hpp" + +/** + * An comment is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +*/ + +template +class nodevalue02 : public DOMTestCase +{ + public: + nodevalue02(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("staff", true); + newNode = doc.createComment(SA::construct_from_utf8("This is a new Comment node")); + newValue = newNode.getNodeValue(); + assertEquals("This is a new Comment node", newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have an effect")); + newValue = newNode.getNodeValue(); + assertEquals("This should have an effect", newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue02"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue03.hpp b/tests/DOM/conformance/level1/core/nodevalue03.hpp new file mode 100644 index 00000000..7f8b289f --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue03.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue03 +#define test_nodevalue03 + +#include "dom_conf_test.hpp" + +/** + * An entity reference is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490 +*/ + +template +class nodevalue03 : public DOMTestCase +{ + public: + nodevalue03(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("staff", true); + newNode = doc.createEntityReference(SA::construct_from_utf8("ent1")); + assertNotNull(newNode); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue03"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue04.hpp b/tests/DOM/conformance/level1/core/nodevalue04.hpp new file mode 100644 index 00000000..f98f23e0 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue04.hpp @@ -0,0 +1,97 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue04 +#define test_nodevalue04 + +#include "dom_conf_test.hpp" + +/** + * An document type accessed, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +*/ + +template +class nodevalue04 : public DOMTestCase +{ + public: + nodevalue04(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("staff", true); + newNode = doc.getDoctype(); + assertNotNull(newNode); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue04"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue05.hpp b/tests/DOM/conformance/level1/core/nodevalue05.hpp new file mode 100644 index 00000000..290d3f25 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue05.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue05 +#define test_nodevalue05 + +#include "dom_conf_test.hpp" + +/** + * A document fragment is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ + +template +class nodevalue05 : public DOMTestCase +{ + public: + nodevalue05(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("staff", true); + newNode = doc.createDocumentFragment(); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue05"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue06.hpp b/tests/DOM/conformance/level1/core/nodevalue06.hpp new file mode 100644 index 00000000..c0b56f74 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue06.hpp @@ -0,0 +1,94 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue06 +#define test_nodevalue06 + +#include "dom_conf_test.hpp" + +/** + * An document is accessed, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ + +template +class nodevalue06 : public DOMTestCase +{ + public: + nodevalue06(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document newNode; + String newValue; + newNode = (Document) load("staff", true); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue06"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue07.hpp b/tests/DOM/conformance/level1/core/nodevalue07.hpp new file mode 100644 index 00000000..2334b605 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue07.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue07 +#define test_nodevalue07 + +#include "dom_conf_test.hpp" + +/** + * An Entity is accessed, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2 +*/ + +template +class nodevalue07 : public DOMTestCase +{ + public: + nodevalue07(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + NamedNodeMap nodeMap; + DocumentType docType; + doc = (Document) load("staff", true); + docType = doc.getDoctype(); + assertNotNull(docType); + nodeMap = docType.getEntities(); + assertNotNull(nodeMap); + newNode = nodeMap.getNamedItem(SA::construct_from_utf8("ent1")); + assertNotNull(newNode); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue07"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue08.hpp b/tests/DOM/conformance/level1/core/nodevalue08.hpp new file mode 100644 index 00000000..7ff56a86 --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue08.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue08 +#define test_nodevalue08 + +#include "dom_conf_test.hpp" + +/** + * An notation is accessed, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9 +*/ + +template +class nodevalue08 : public DOMTestCase +{ + public: + nodevalue08(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + Node newNode; + String newValue; + NamedNodeMap nodeMap; + doc = (Document) load("staff", true); + docType = doc.getDoctype(); + assertNotNull(docType); + nodeMap = docType.getNotations(); + assertNotNull(nodeMap); + newNode = nodeMap.getNamedItem(SA::construct_from_utf8("notation1")); + assertNotNull(newNode); + newValue = newNode.getNodeValue(); + assertNull(newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); + newValue = newNode.getNodeValue(); + assertNull(newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue08"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/nodevalue09.hpp b/tests/DOM/conformance/level1/core/nodevalue09.hpp new file mode 100644 index 00000000..a86b359e --- /dev/null +++ b/tests/DOM/conformance/level1/core/nodevalue09.hpp @@ -0,0 +1,96 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_nodevalue09 +#define test_nodevalue09 + +#include "dom_conf_test.hpp" + +/** + * An processing instruction is created, setNodeValue is called with a non-null argument, but getNodeValue + * should still return null. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1004215813 +*/ + +template +class nodevalue09 : public DOMTestCase +{ + public: + nodevalue09(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node newNode; + String newValue; + doc = (Document) load("staff", true); + newNode = doc.createProcessingInstruction(SA::construct_from_utf8("TARGET"), SA::construct_from_utf8("DATA")); + newValue = newNode.getNodeValue(); + assertEquals("DATA", newValue); + newNode.setNodeValue(SA::construct_from_utf8("This should have an effect")); + newValue = newNode.getNodeValue(); + assertEquals("This should have an effect", newValue); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodevalue09"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/notationgetnotationname.hpp b/tests/DOM/conformance/level1/core/notationgetnotationname.hpp new file mode 100644 index 00000000..530cf247 --- /dev/null +++ b/tests/DOM/conformance/level1/core/notationgetnotationname.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_notationgetnotationname +#define test_notationgetnotationname + +#include "dom_conf_test.hpp" + +/** + * Retrieve the notation named "notation1" and access its + * name by invoking the "getNodeName()" method inherited + * from the Node interface. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9 +*/ + +template +class notationgetnotationname : public DOMTestCase +{ + public: + notationgetnotationname(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Notation notationNode; + String notationName; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation1")); + skipIfNull(notationNode); + notationName = notationNode.getNodeName(); + assertEquals("notation1", notationName); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetnotationname"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/notationgetpublicid.hpp b/tests/DOM/conformance/level1/core/notationgetpublicid.hpp new file mode 100644 index 00000000..f8073e3f --- /dev/null +++ b/tests/DOM/conformance/level1/core/notationgetpublicid.hpp @@ -0,0 +1,101 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_notationgetpublicid +#define test_notationgetpublicid + +#include "dom_conf_test.hpp" + +/** + * Retrieve the notation named "notation1" and access its + * public identifier. The string "notation1File" should be + * returned. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-54F2B4D0 +*/ + +template +class notationgetpublicid : public DOMTestCase +{ + public: + notationgetpublicid(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Notation notationNode; + String publicId; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation1")); + skipIfNull(notationNode); + publicId = notationNode.getPublicId(); + assertEquals("notation1File", publicId); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetpublicid"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/notationgetpublicidnull.hpp b/tests/DOM/conformance/level1/core/notationgetpublicidnull.hpp new file mode 100644 index 00000000..7ba83f73 --- /dev/null +++ b/tests/DOM/conformance/level1/core/notationgetpublicidnull.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_notationgetpublicidnull +#define test_notationgetpublicidnull + +#include "dom_conf_test.hpp" + +/** + * The "getPublicId()" method of a Notation node contains + * the public identifier associated with the notation, if + * one was not specified a null value should be returned. + * + * Retrieve the notation named "notation2" and access its + * public identifier. Since a public identifier was not + * specified for this notation, the "getPublicId()" method + * should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-54F2B4D0 +*/ + +template +class notationgetpublicidnull : public DOMTestCase +{ + public: + notationgetpublicidnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Notation notationNode; + String publicId; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation2")); + skipIfNull(notationNode); + publicId = notationNode.getPublicId(); + assertNull(publicId); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetpublicidnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/notationgetsystemid.hpp b/tests/DOM/conformance/level1/core/notationgetsystemid.hpp new file mode 100644 index 00000000..3e675068 --- /dev/null +++ b/tests/DOM/conformance/level1/core/notationgetsystemid.hpp @@ -0,0 +1,105 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_notationgetsystemid +#define test_notationgetsystemid + +#include "dom_conf_test.hpp" + +/** + * The "getSystemId()" method of a Notation node contains + * the system identifier associated with the notation, if + * one was specified. + * + * Retrieve the notation named "notation2" and access its + * system identifier. The string "notation2File" should be + * returned. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E8AAB1D0 +*/ + +template +class notationgetsystemid : public DOMTestCase +{ + public: + notationgetsystemid(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Notation notationNode; + String systemId; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation2")); + skipIfNull(notationNode); + systemId = notationNode.getSystemId(); + assertURIEquals("uriEquals", "", "", "", "notation2File", "", "", "", false, systemId); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetsystemid"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/notationgetsystemidnull.hpp b/tests/DOM/conformance/level1/core/notationgetsystemidnull.hpp new file mode 100644 index 00000000..b473b6c2 --- /dev/null +++ b/tests/DOM/conformance/level1/core/notationgetsystemidnull.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_notationgetsystemidnull +#define test_notationgetsystemidnull + +#include "dom_conf_test.hpp" + +/** + * Retrieve the notation named "notation1" and access its + * system identifier. Since a system identifier was not + * specified for this notation, the "getSystemId()" method + * should return null. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E8AAB1D0 +*/ + +template +class notationgetsystemidnull : public DOMTestCase +{ + public: + notationgetsystemidnull(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + DocumentType docType; + NamedNodeMap notations; + Notation notationNode; + String systemId; + doc = (Document) load("staff", false); + docType = doc.getDoctype(); + assertNotNull(docType); + notations = docType.getNotations(); + assertNotNull(notations); + notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation1")); + skipIfNull(notationNode); + systemId = notationNode.getSystemId(); + assertNull(systemId); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/notationgetsystemidnull"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/processinginstructiongetdata.hpp b/tests/DOM/conformance/level1/core/processinginstructiongetdata.hpp new file mode 100644 index 00000000..7174658a --- /dev/null +++ b/tests/DOM/conformance/level1/core/processinginstructiongetdata.hpp @@ -0,0 +1,103 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_processinginstructiongetdata +#define test_processinginstructiongetdata + +#include "dom_conf_test.hpp" + +/** + * The "getData()" method returns the content of the + * processing instruction. It starts at the first non + * white character following the target and ends at the + * character immediately preceding the "?>". + * + * Retrieve the ProcessingInstruction node located + * immediately after the prolog. Create a nodelist of the + * child nodes of this document. Invoke the "getData()" + * method on the first child in the list. This should + * return the content of the ProcessingInstruction. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393 +*/ + +template +class processinginstructiongetdata : public DOMTestCase +{ + public: + processinginstructiongetdata(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList childNodes; + ProcessingInstruction piNode; + String data; + doc = (Document) load("staff", false); + childNodes = doc.getChildNodes(); + piNode = (ProcessingInstruction) childNodes.item(0); + data = piNode.getData(); + assertEquals("PIDATA", data); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructiongetdata"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/processinginstructiongettarget.hpp b/tests/DOM/conformance/level1/core/processinginstructiongettarget.hpp new file mode 100644 index 00000000..c0ebaefc --- /dev/null +++ b/tests/DOM/conformance/level1/core/processinginstructiongettarget.hpp @@ -0,0 +1,102 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_processinginstructiongettarget +#define test_processinginstructiongettarget + +#include "dom_conf_test.hpp" + +/** + * The "getTarget()" method returns the target of the + * processing instruction. It is the first token following + * the markup that begins the processing instruction. + * + * Retrieve the ProcessingInstruction node located + * immediately after the prolog. Create a nodelist of the + * child nodes of this document. Invoke the "getTarget()" + * method on the first child in the list. This should + * return the target of the ProcessingInstruction. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1478689192 +*/ + +template +class processinginstructiongettarget : public DOMTestCase +{ + public: + processinginstructiongettarget(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList childNodes; + ProcessingInstruction piNode; + String target; + doc = (Document) load("staff", false); + childNodes = doc.getChildNodes(); + piNode = (ProcessingInstruction) childNodes.item(0); + target = piNode.getTarget(); + assertEquals("TEST-STYLE", target); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructiongettarget"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/processinginstructionsetdatanomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/processinginstructionsetdatanomodificationallowederr.hpp new file mode 100644 index 00000000..283070b1 --- /dev/null +++ b/tests/DOM/conformance/level1/core/processinginstructionsetdatanomodificationallowederr.hpp @@ -0,0 +1,117 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_processinginstructionsetdatanomodificationallowederr +#define test_processinginstructionsetdatanomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "setData(data)" method for a processing instruction causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Try to remove the "domestic" attribute + * from the entity reference by executing the "setData(data)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-837822393')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393 +*/ + +template +class processinginstructionsetdatanomodificationallowederr : public DOMTestCase +{ + public: + processinginstructionsetdatanomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + Node entRef; + ProcessingInstruction piNode; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = gender.getFirstChild(); + assertNotNull(entRef); + piNode = (ProcessingInstruction) entRef.getLastChild(); + assertNotNull(piNode); + + { + boolean success = false; + try { + piNode.setData(SA::construct_from_utf8("newData")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/processinginstructionsetdatanomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/processinginstructionsetdatanomodificationallowederrEE.hpp new file mode 100644 index 00000000..28841023 --- /dev/null +++ b/tests/DOM/conformance/level1/core/processinginstructionsetdatanomodificationallowederrEE.hpp @@ -0,0 +1,121 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_processinginstructionsetdatanomodificationallowederrEE +#define test_processinginstructionsetdatanomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * The "setData(data)" method for a processing instruction causes the + * DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + * if the node is readonly. + * + * Create an ent4 entity reference and add to document of the THIRD "gender" element. The elements + * content is an entity reference. Try to remove the "domestic" attribute + * from the entity reference by executing the "setData(data)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-837822393')/setraises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-837822393 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0053.html +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederr.xml +*/ + +template +class processinginstructionsetdatanomodificationallowederrEE : public DOMTestCase +{ + public: + processinginstructionsetdatanomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + Node entRef; + ProcessingInstruction piNode; + Node appendedChild; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + appendedChild = gender.appendChild(entRef); + entRef = gender.getLastChild(); + assertNotNull(entRef); + piNode = (ProcessingInstruction) entRef.getLastChild(); + assertNotNull(piNode); + + { + boolean success = false; + try { + piNode.setData(SA::construct_from_utf8("newData")); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textindexsizeerrnegativeoffset.hpp b/tests/DOM/conformance/level1/core/textindexsizeerrnegativeoffset.hpp new file mode 100644 index 00000000..aeb731d3 --- /dev/null +++ b/tests/DOM/conformance/level1/core/textindexsizeerrnegativeoffset.hpp @@ -0,0 +1,113 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textindexsizeerrnegativeoffset +#define test_textindexsizeerrnegativeoffset + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset is + * negative. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The desired exception should be raised since the offset + * is a negative number. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ + +template +class textindexsizeerrnegativeoffset : public DOMTestCase +{ + public: + textindexsizeerrnegativeoffset(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + + { + boolean success = false; + try { + splitNode = textNode.splitText(-69); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textindexsizeerrnegativeoffset"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textindexsizeerroffsetoutofbounds.hpp b/tests/DOM/conformance/level1/core/textindexsizeerroffsetoutofbounds.hpp new file mode 100644 index 00000000..a96fae28 --- /dev/null +++ b/tests/DOM/conformance/level1/core/textindexsizeerroffsetoutofbounds.hpp @@ -0,0 +1,115 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2003 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textindexsizeerroffsetoutofbounds +#define test_textindexsizeerroffsetoutofbounds + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method raises an + * INDEX_SIZE_ERR DOMException if the specified offset is + * greater than the number of characters in the Text node. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The desired exception should be raised since the offset + * is a greater than the number of characters in the Text + * node. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ + +template +class textindexsizeerroffsetoutofbounds : public DOMTestCase +{ + public: + textindexsizeerroffsetoutofbounds(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + + { + boolean success = false; + try { + splitNode = textNode.splitText(300); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::INDEX_SIZE_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textindexsizeerroffsetoutofbounds"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textparseintolistofelements.hpp b/tests/DOM/conformance/level1/core/textparseintolistofelements.hpp new file mode 100644 index 00000000..0c687d6f --- /dev/null +++ b/tests/DOM/conformance/level1/core/textparseintolistofelements.hpp @@ -0,0 +1,137 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textparseintolistofelements +#define test_textparseintolistofelements + +#include "dom_conf_test.hpp" + +/** + * Retrieve the textual data from the last child of the + * second employee. That node is composed of two + * EntityReference nodes and two Text nodes. After + * the content node is parsed, the "address" Element + * should contain four children with each one of the + * EntityReferences containing one child. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-745549614 +*/ + +template +class textparseintolistofelements : public DOMTestCase +{ + public: + textparseintolistofelements(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node addressNode; + NodeList childList; + Node child; + int length; + String value; + Node grandChild; + std::vector result; + + std::vector expectedNormal; + expectedNormal.push_back(SA::construct_from_utf8("1900 Dallas Road")); + expectedNormal.push_back(SA::construct_from_utf8(" Dallas, ")); + expectedNormal.push_back(SA::construct_from_utf8("Texas")); + expectedNormal.push_back(SA::construct_from_utf8("\n 98554")); + + std::vector expectedExpanded; + expectedExpanded.push_back(SA::construct_from_utf8("1900 Dallas Road Dallas, Texas\n 98554")); + + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + addressNode = elementList.item(1); + childList = addressNode.getChildNodes(); + length = (int) childList.getLength(); + for (int indexN65663 = 0; indexN65663 != childList.getLength(); indexN65663++) { + child = (Node) childList.item(indexN65663); + value = child.getNodeValue(); + + if ((isNull(value))) { + grandChild = child.getFirstChild(); + assertNotNull(grandChild); + value = grandChild.getNodeValue(); + result.push_back(value); + } else { + result.push_back(value); + } + + } + + if (equals(4, length)) { + assertEquals(expectedNormal, result); + } else { + assertEquals(expectedExpanded, result); + } + + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textparseintolistofelements"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textsplittextfour.hpp b/tests/DOM/conformance/level1/core/textsplittextfour.hpp new file mode 100644 index 00000000..3c054f09 --- /dev/null +++ b/tests/DOM/conformance/level1/core/textsplittextfour.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textsplittextfour +#define test_textsplittextfour + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method returns the new Text node. + * + * Retrieve the textual data from the last child of the + * first employee and invoke the "splitText(offset)" method. + * The method should return the new Text node. The offset + * value used for this test is 30. The "getNodeValue()" + * method is called to check that the new node now contains + * the characters at and after position 30. + * (Starting count at 0) +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class textsplittextfour : public DOMTestCase +{ + public: + textsplittextfour(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node addressNode; + Text textNode; + Text splitNode; + String value; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); + addressNode = elementList.item(0); + textNode = (Text) addressNode.getFirstChild(); + splitNode = textNode.splitText(30); + value = splitNode.getNodeValue(); + assertEquals("98551", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextfour"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textsplittextnomodificationallowederr.hpp b/tests/DOM/conformance/level1/core/textsplittextnomodificationallowederr.hpp new file mode 100644 index 00000000..2b2b9450 --- /dev/null +++ b/tests/DOM/conformance/level1/core/textsplittextnomodificationallowederr.hpp @@ -0,0 +1,128 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textsplittextnomodificationallowederr +#define test_textsplittextnomodificationallowederr + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method raises a + * NO_MODIFICATION_ALLOWED_ERR DOMException if the + * node is readonly. + * + * Obtain the children of the THIRD "gender" element. The elements + * content is an entity reference. Get the element content of the FIRST + * Text Node of the entity reference and execute the "splitText(offset)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class textsplittextnomodificationallowederr : public DOMTestCase +{ + public: + textsplittextnomodificationallowederr(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList genderList; + Node gender; + Node entRef; + Node entElement; + Node entElementText; + Text splitNode; + int nodeType; + doc = (Document) load("staff", true); + genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender")); + gender = genderList.item(2); + entRef = gender.getFirstChild(); + assertNotNull(entRef); + nodeType = (int) entRef.getNodeType(); + + if (equals(1, nodeType)) { + entRef = doc.createEntityReference(SA::construct_from_utf8("ent4")); + assertNotNull(entRef); + } + entElement = entRef.getFirstChild(); + assertNotNull(entElement); + entElementText = entElement.getFirstChild(); + assertNotNull(entElementText); + + { + boolean success = false; + try { + splitNode = ((Text) /*Node */entElementText).splitText(2); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextnomodificationallowederr"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textsplittextnomodificationallowederrEE.hpp b/tests/DOM/conformance/level1/core/textsplittextnomodificationallowederrEE.hpp new file mode 100644 index 00000000..a440d06b --- /dev/null +++ b/tests/DOM/conformance/level1/core/textsplittextnomodificationallowederrEE.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textsplittextnomodificationallowederrEE +#define test_textsplittextnomodificationallowederrEE + +#include "dom_conf_test.hpp" + +/** + * Create an ent3 reference and execute the "splitText(offset)" method. + * This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextnomodificationallowederr.xml +*/ + +template +class textsplittextnomodificationallowederrEE : public DOMTestCase +{ + public: + textsplittextnomodificationallowederrEE(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + Node entRef; + Node entText; + Text splitNode; + doc = (Document) load("staff", true); + entRef = doc.createEntityReference(SA::construct_from_utf8("ent3")); + assertNotNull(entRef); + entText = entRef.getFirstChild(); + assertNotNull(entText); + + { + boolean success = false; + try { + splitNode = ((Text) /*Node */entText).splitText(2); + } catch (const DOMException& ex) { + success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR); + } + assertTrue(success); + } + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextnomodificationallowederrEE"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textsplittextone.hpp b/tests/DOM/conformance/level1/core/textsplittextone.hpp new file mode 100644 index 00000000..e211d453 --- /dev/null +++ b/tests/DOM/conformance/level1/core/textsplittextone.hpp @@ -0,0 +1,109 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textsplittextone +#define test_textsplittextone + +#include "dom_conf_test.hpp" + +/** + * The "splitText(offset)" method breaks the Text node into + * two Text nodes at the specified offset keeping each node + * as siblings in the tree. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The method splits the Text node into two new sibling + * Text nodes keeping both of them in the tree. This test + * checks the "nextSibling()" method of the original node + * to ensure that the two nodes are indeed siblings. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class textsplittextone : public DOMTestCase +{ + public: + textsplittextone(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + Node secondPart; + String value; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + splitNode = textNode.splitText(7); + secondPart = textNode.getNextSibling(); + value = secondPart.getNodeValue(); + assertEquals("Jones", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextone"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textsplittextthree.hpp b/tests/DOM/conformance/level1/core/textsplittextthree.hpp new file mode 100644 index 00000000..fe744e7a --- /dev/null +++ b/tests/DOM/conformance/level1/core/textsplittextthree.hpp @@ -0,0 +1,108 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textsplittextthree +#define test_textsplittextthree + +#include "dom_conf_test.hpp" + +/** + * After the "splitText(offset)" method breaks the Text node + * into two Text nodes, the new Text node contains all the + * content at and after the offset point. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The new Text node should contain all the content + * at and after the offset point. The "getNodeValue()" + * method is called to check that the new node now contains + * the characters at and after position seven. + * (Starting count at 0) +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class textsplittextthree : public DOMTestCase +{ + public: + textsplittextthree(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + String value; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + splitNode = textNode.splitText(6); + value = splitNode.getNodeValue(); + assertEquals(" Jones", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittextthree"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textsplittexttwo.hpp b/tests/DOM/conformance/level1/core/textsplittexttwo.hpp new file mode 100644 index 00000000..87fb1ecf --- /dev/null +++ b/tests/DOM/conformance/level1/core/textsplittexttwo.hpp @@ -0,0 +1,107 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textsplittexttwo +#define test_textsplittexttwo + +#include "dom_conf_test.hpp" + +/** + * After the "splitText(offset)" method breaks the Text node + * into two Text nodes, the original node contains all the + * content up to the offset point. + * + * Retrieve the textual data from the second child of the + * third employee and invoke the "splitText(offset)" method. + * The original Text node should contain all the content + * up to the offset point. The "getNodeValue()" method + * is called to check that the original node now contains + * the first five characters. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ + +template +class textsplittexttwo : public DOMTestCase +{ + public: + textsplittexttwo(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", true); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Text textNode; + Text splitNode; + String value; + doc = (Document) load("staff", true); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(2); + textNode = (Text) nameNode.getFirstChild(); + splitNode = textNode.splitText(5); + value = textNode.getNodeValue(); + assertEquals("Roger", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittexttwo"; + } +}; + +#endif diff --git a/tests/DOM/conformance/level1/core/textwithnomarkup.hpp b/tests/DOM/conformance/level1/core/textwithnomarkup.hpp new file mode 100644 index 00000000..56ba7e2f --- /dev/null +++ b/tests/DOM/conformance/level1/core/textwithnomarkup.hpp @@ -0,0 +1,106 @@ + +/* +This c++ source file was generated by for Arabica +and is a derived work from the source document. +The source document contained the following notice: + + +Copyright (c) 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. This program is distributed under the W3C's Software +Intellectual Property License. This program is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. +See W3C License http://www.w3.org/Consortium/Legal/ for more details. + +*/ + +#ifndef test_textwithnomarkup +#define test_textwithnomarkup + +#include "dom_conf_test.hpp" + +/** + * If there is not any markup inside an Element or Attr node + * content, then the text is contained in a single object + * implementing the Text interface that is the only child + * of the element. + * + * Retrieve the textual data from the second child of the + * third employee. That Text node contains a block of + * multiple text lines without markup, so they should be + * treated as a single Text node. The "getNodeValue()" + * method should contain the combination of the two lines. +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ + +template +class textwithnomarkup : public DOMTestCase +{ + public: + textwithnomarkup(std::string name) : DOMTestCase(name) + { + + // check if loaded documents are supported for content type + const std::string contentType = getContentType(); + preload(contentType, "staff", false); + } + + typedef typename DOMTestCase baseT; + using baseT::DOMImplementation; + using baseT::Document; + using baseT::DocumentType; + using baseT::DocumentFragment; + using baseT::Node; + using baseT::Element; + using baseT::Attr; + using baseT::NodeList; + using baseT::NamedNodeMap; + using baseT::Entity; + using baseT::EntityReference; + using baseT::CharacterData; + using baseT::CDATASection; + using baseT::Text; + using baseT::Comment; + using baseT::ProcessingInstruction; + using baseT::Notation; + + typedef typename Arabica::DOM::DOMException DOMException; + typedef string_type String; + typedef string_adaptor SA; + typedef bool boolean; + + /* + * Runs the test case. + */ + void runTest() + { + Document doc; + NodeList elementList; + Node nameNode; + Node nodeV; + String value; + doc = (Document) load("staff", false); + elementList = doc.getElementsByTagName(SA::construct_from_utf8("name")); + nameNode = elementList.item(2); + nodeV = nameNode.getFirstChild(); + value = nodeV.getNodeValue(); + assertEquals("Roger\n Jones", value); + + } + + /* + * Gets URI that identifies the test. + */ + std::string getTargetURI() const + { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textwithnomarkup"; + } +}; + +#endif diff --git a/tests/DOM/dom_test_suite.hpp b/tests/DOM/dom_test_suite.hpp index d7cee439..968dcefe 100644 --- a/tests/DOM/dom_test_suite.hpp +++ b/tests/DOM/dom_test_suite.hpp @@ -21,6 +21,8 @@ #include "test_NamedNodeMap.hpp" #include "test_Stream.hpp" +#include "conformance/level1/core/alltests.hpp" + template bool DOM_test_suite(int argc, const char** argv) { @@ -41,7 +43,9 @@ bool DOM_test_suite(int argc, const char** argv) runner.addTest("NamedNodeMapTest", NamedNodeMapTest_suite()); runner.addTest("TreeWalkerTest", TreeWalkerTest_suite()); runner.addTest("StreamTest", StreamTest_suite()); - + + runner.addTest("level1/core", DOM_Level_1_Core_Test_Suite()); + return runner.run(argc, argv); } // main diff --git a/tests/DOM/main_silly.cpp b/tests/DOM/main_silly.cpp index 4a7ed404..5ce4bf8d 100644 --- a/tests/DOM/main_silly.cpp +++ b/tests/DOM/main_silly.cpp @@ -1,6 +1,6 @@ #ifdef _MSC_VER -#pragma warning(disable: 4786 4250 4503) +#pragma warning(disable: 4786 4250 4503 4244) #endif #include "dom_test_suite.hpp" diff --git a/tests/DOM/main_wide.cpp b/tests/DOM/main_wide.cpp index 58535ed4..84797767 100644 --- a/tests/DOM/main_wide.cpp +++ b/tests/DOM/main_wide.cpp @@ -1,5 +1,5 @@ #ifdef _MSC_VER -#pragma warning(disable: 4786 4250 4503) +#pragma warning(disable: 4786 4250 4503 4244) #endif #ifndef ARABICA_NO_WCHAR_T