diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-30 11:06:01 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-30 11:06:01 +0000 |
commit | 8f547c7bd349e0dc905e0dc5f32edbf1e01061ce (patch) | |
tree | 0ba575c11b1875b638324194e16ebda4586baec8 /test/testcases/tests/level3/validation | |
parent | e3eae8836e177220d556868e4fa7741c00b2d729 (diff) | |
download | libdom-8f547c7bd349e0dc905e0dc5f32edbf1e01061ce.tar.gz libdom-8f547c7bd349e0dc905e0dc5f32edbf1e01061ce.tar.bz2 |
Merge DOMTS tests -- they're causing havoc with review diffs.
svn path=/trunk/dom/; revision=8910
Diffstat (limited to 'test/testcases/tests/level3/validation')
56 files changed, 2049 insertions, 0 deletions
diff --git a/test/testcases/tests/level3/validation/.cvsignore b/test/testcases/tests/level3/validation/.cvsignore new file mode 100644 index 0000000..182530a --- /dev/null +++ b/test/testcases/tests/level3/validation/.cvsignore @@ -0,0 +1,3 @@ +dom3.dtd +dom3.xsd +test-to-html.xsl diff --git a/test/testcases/tests/level3/validation/CVS/Entries b/test/testcases/tests/level3/validation/CVS/Entries new file mode 100644 index 0000000..6b23816 --- /dev/null +++ b/test/testcases/tests/level3/validation/CVS/Entries @@ -0,0 +1,47 @@ +D/files//// +/.cvsignore/1.1/Fri Apr 3 02:47:58 2009// +/allowedAttributes.xml/1.6/Fri Apr 3 02:47:58 2009// +/allowedChildren.xml/1.6/Fri Apr 3 02:47:58 2009// +/allowedFirstChildren.xml/1.3/Fri Apr 3 02:47:58 2009// +/allowedNextSiblings.xml/1.5/Fri Apr 3 02:47:58 2009// +/allowedParents.xml/1.3/Fri Apr 3 02:47:58 2009// +/allowedPreviousSiblings.xml/1.5/Fri Apr 3 02:47:58 2009// +/alltests.xml/1.5/Fri Apr 3 02:47:58 2009// +/canAppendChildFalse.xml/1.4/Fri Apr 3 02:47:58 2009// +/canAppendChildTrue.xml/1.4/Fri Apr 3 02:47:58 2009// +/canAppendData.xml/1.4/Fri Apr 3 02:47:58 2009// +/canDeleteData.xml/1.4/Fri Apr 3 02:47:58 2009// +/canInsertBeforeFalse.xml/1.4/Fri Apr 3 02:47:58 2009// +/canInsertBeforeTrue.xml/1.4/Fri Apr 3 02:47:58 2009// +/canInsertData.xml/1.4/Fri Apr 3 02:47:58 2009// +/canRemoveAttributeFalse.xml/1.3/Fri Apr 3 02:47:58 2009// +/canRemoveAttributeNS.xml/1.4/Fri Apr 3 02:47:58 2009// +/canRemoveAttributeNode.xml/1.3/Fri Apr 3 02:47:58 2009// +/canRemoveAttributeTrue.xml/1.3/Fri Apr 3 02:47:58 2009// +/canRemoveChildFalse.xml/1.3/Fri Apr 3 02:47:58 2009// +/canRemoveChildTrue.xml/1.3/Fri Apr 3 02:47:58 2009// +/canReplaceChildFalse.xml/1.4/Fri Apr 3 02:47:58 2009// +/canReplaceChildTrue.xml/1.4/Fri Apr 3 02:47:58 2009// +/canReplaceDataFalse.xml/1.4/Fri Apr 3 02:47:58 2009// +/canReplaceDataTrue.xml/1.4/Fri Apr 3 02:47:58 2009// +/canSetAttributeFalse.xml/1.3/Fri Apr 3 02:47:58 2009// +/canSetAttributeNS.xml/1.4/Fri Apr 3 02:47:58 2009// +/canSetAttributeNode.xml/1.3/Fri Apr 3 02:47:58 2009// +/canSetAttributeTrue.xml/1.3/Fri Apr 3 02:47:58 2009// +/canSetData.xml/1.4/Fri Apr 3 02:47:58 2009// +/contentType.xml/1.3/Fri Apr 3 02:47:58 2009// +/defaultValue.xml/1.3/Fri Apr 3 02:47:58 2009// +/definedElements.xml/1.6/Fri Apr 3 02:47:58 2009// +/enumeratedValues.xml/1.5/Fri Apr 3 02:47:58 2009// +/getFeature01.xml/1.1/Fri Apr 3 02:47:58 2009// +/getFeature02.xml/1.1/Fri Apr 3 02:47:58 2009// +/hasFeature01.xml/1.1/Fri Apr 3 02:47:58 2009// +/hasFeature02.xml/1.1/Fri Apr 3 02:47:58 2009// +/hasFeature03.xml/1.2/Fri Apr 3 02:47:58 2009// +/hasFeature04.xml/1.1/Fri Apr 3 02:47:58 2009// +/isElementDefined.xml/1.3/Fri Apr 3 02:47:58 2009// +/isElementDefinedNS.xml/1.3/Fri Apr 3 02:47:58 2009// +/metadata.xml/1.1/Fri Apr 3 02:47:58 2009// +/nodeValidity.xml/1.4/Fri Apr 3 02:47:58 2009// +/requiredAttributes.xml/1.3/Fri Apr 3 02:47:58 2009// +/validateDocument.xml/1.3/Fri Apr 3 02:47:58 2009// diff --git a/test/testcases/tests/level3/validation/CVS/Repository b/test/testcases/tests/level3/validation/CVS/Repository new file mode 100644 index 0000000..180e30a --- /dev/null +++ b/test/testcases/tests/level3/validation/CVS/Repository @@ -0,0 +1 @@ +2001/DOM-Test-Suite/tests/level3/validation diff --git a/test/testcases/tests/level3/validation/CVS/Root b/test/testcases/tests/level3/validation/CVS/Root new file mode 100644 index 0000000..3c7177e --- /dev/null +++ b/test/testcases/tests/level3/validation/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@dev.w3.org:/sources/public diff --git a/test/testcases/tests/level3/validation/CVS/Template b/test/testcases/tests/level3/validation/CVS/Template new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/testcases/tests/level3/validation/CVS/Template diff --git a/test/testcases/tests/level3/validation/allowedAttributes.xml b/test/testcases/tests/level3/validation/allowedAttributes.xml new file mode 100644 index 0000000..ac6f9d1 --- /dev/null +++ b/test/testcases/tests/level3/validation/allowedAttributes.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> + +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="allowedAttributes"> +<metadata> + +<title>allowedAttributes</title> +<creator>Kongyi Zhou</creator> +<description> + The method getAllowedAttributes returns the NameList of allowed attributes for + the element. +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#ElementEditVAL-allowedAttributes"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="attrlist" type="NameList"/> +<var name="attname" type="DOMString"/> +<var name="allowedAttributesLength" type="int"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<allowedAttributes obj="root" var="attrlist"/> +<assertNotNull actual="attrlist" id="allowedAttributesNotNull"/> +<length var="allowedAttributesLength" obj="attrlist" interface="NameList"/> +<assertEquals actual="allowedAttributesLength" expected="2" id="allowedAttributes" ignoreCase="false"/> +</test> diff --git a/test/testcases/tests/level3/validation/allowedChildren.xml b/test/testcases/tests/level3/validation/allowedChildren.xml new file mode 100644 index 0000000..61769a6 --- /dev/null +++ b/test/testcases/tests/level3/validation/allowedChildren.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="allowedChildren"> +<metadata> + +<title>allowedChildren</title> +<creator>Kongyi Zhou</creator> +<description> + The method getAllowedChildren returns the NameList of allowed child elements. + should return NameList of length 7 +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#ElementEditVAL-allowedChildren"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="nlist" type="NameList"/> +<var name="allowedChildrenLength" type="int"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<allowedChildren obj="root" var="nlist"/> +<assertNotNull actual="nlist" id="allowedChildrenNotNull"/> +<length var="allowedChildrenLength" obj="nlist" interface="NameList"/> +<assertEquals actual="allowedChildrenLength" expected="7" id="allowedChildren" ignoreCase="false"/> +</test> + + + diff --git a/test/testcases/tests/level3/validation/allowedFirstChildren.xml b/test/testcases/tests/level3/validation/allowedFirstChildren.xml new file mode 100644 index 0000000..4b7d941 --- /dev/null +++ b/test/testcases/tests/level3/validation/allowedFirstChildren.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="allowedFirstChildren"> +<metadata> + +<title>allowedFirstChildren</title> +<creator>Kongyi Zhou</creator> +<description> + The method getAllowedFirstChildren returns the NameList of allowed first child elements. + should return NameList containing name 'title'. +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#ElementEditVAL-allowedFirstChildElements"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="nlist" type="NameList"/> +<var name="childname" type="DOMString"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<allowedFirstChildren obj="root" var="nlist"/> +<assertNotNull actual="nlist" id="allowedFirstChildrenNotNull"/> +<getName interface="NameList" obj="nlist" index="0" var="childname"/> +<assertEquals actual="childname" expected='"title"' ignoreCase="false" id="allowedFirstChildren"/> +</test> diff --git a/test/testcases/tests/level3/validation/allowedNextSiblings.xml b/test/testcases/tests/level3/validation/allowedNextSiblings.xml new file mode 100644 index 0000000..9f9c55b --- /dev/null +++ b/test/testcases/tests/level3/validation/allowedNextSiblings.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="allowedNextSiblings"> +<metadata> + +<title>allowedNextSiblings</title> +<creator>Kongyi Zhou</creator> +<description> + The method getAllowedNextSiblings return the NameList of elements that may be + inserted, should return empty list. +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#ElementEditVAL-allowedNextSiblings"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elem" type="ElementEditVAL"/> +<var name="nlist" type="NameList"/> +<var name="elemList" type="NodeList"/> +<var name="childname" type="DOMString"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName obj="doc" interface="Document" var="elemList" tagname='"author"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<allowedNextSiblings obj="elem" var="nlist"/> +<assertNotNull actual="nlist" id="allowedNextSiblingsNotNull"/> +<getName interface="NameList" obj="nlist" index="0" var="childname"/> +<!-- since ISBN is already present, no insertable sibling --> +<assertNull actual="childname" id="noAllowableNextSibling"/> +</test>
\ No newline at end of file diff --git a/test/testcases/tests/level3/validation/allowedParents.xml b/test/testcases/tests/level3/validation/allowedParents.xml new file mode 100644 index 0000000..7b16854 --- /dev/null +++ b/test/testcases/tests/level3/validation/allowedParents.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="allowedParents"> +<metadata> + +<title>allowedParents</title> +<creator>Kongyi Zhou</creator> +<description> + The method getAllowedParents returns the NameList of elements that may be the + the parent of current node + should return NameList containing name 'book'. +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#ElementEditVAL-allowedParents"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elem" type="ElementEditVAL"/> +<var name="nlist" type="NameList"/> +<var name="elemList" type="NodeList"/> +<var name="childname" type="DOMString"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName obj="doc" interface="Document" var="elemList" tagname='"author"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<allowedParents obj="elem" var="nlist"/> +<assertNotNull actual="nlist" id="allowedParentsNotNull"/> +<getName interface="NameList" obj="nlist" index="0" var="childname"/> +<assertEquals actual="childname" expected='"book"' ignoreCase="false" id="allowedParents"/> +</test> diff --git a/test/testcases/tests/level3/validation/allowedPreviousSiblings.xml b/test/testcases/tests/level3/validation/allowedPreviousSiblings.xml new file mode 100644 index 0000000..8f6bb75 --- /dev/null +++ b/test/testcases/tests/level3/validation/allowedPreviousSiblings.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="allowedPreviousSiblings"> +<metadata> + +<title>allowedPreviousSiblings</title> +<creator>Kongyi Zhou</creator> +<description> + The method getAllowedPreviousSiblings return the NameList of elements that may be the + previous siblings, should return empty list. +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#ElementEditVAL-allowedPreviousSiblings"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elem" type="ElementEditVAL"/> +<var name="nlist" type="NameList"/> +<var name="elemList" type="NodeList"/> +<var name="childname" type="DOMString"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName obj="doc" interface="Document" var="elemList" tagname='"author"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<allowedPreviousSiblings obj="elem" var="nlist"/> +<assertNotNull actual="nlist" id="allowedPreviousSiblingsNotNull"/> +<getName interface="NameList" obj="nlist" index="0" var="childname"/> +<assertNull actual="childname" id="noPreviousSiblings"/> +</test>
\ No newline at end of file diff --git a/test/testcases/tests/level3/validation/alltests.xml b/test/testcases/tests/level3/validation/alltests.xml new file mode 100644 index 0000000..417ec13 --- /dev/null +++ b/test/testcases/tests/level3/validation/alltests.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> + +<!DOCTYPE suite SYSTEM "dom3.dtd"> + +<suite xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="alltests"> + <metadata> + <title>DOM Level 3 Validation Test Suite</title> + <creator>DOM Test Suite Project</creator> + </metadata> + <suite.member href="allowedAttributes.xml"/> + <suite.member href="allowedChildren.xml"/> + <suite.member href="allowedFirstChildren.xml"/> + <suite.member href="allowedNextSiblings.xml"/> + <suite.member href="allowedParents.xml"/> + <suite.member href="allowedPreviousSiblings.xml"/> + <suite.member href="canAppendChildFalse.xml"/> + <suite.member href="canAppendChildTrue.xml"/> + <suite.member href="canAppendData.xml"/> + <suite.member href="canDeleteData.xml"/> + <suite.member href="canInsertBeforeFalse.xml"/> + <suite.member href="canInsertBeforeTrue.xml"/> + <suite.member href="canInsertData.xml"/> + <suite.member href="canRemoveAttributeFalse.xml"/> + <suite.member href="canRemoveAttributeNS.xml"/> + <suite.member href="canRemoveAttributeNode.xml"/> + <suite.member href="canRemoveAttributeTrue.xml"/> + <suite.member href="canRemoveChildFalse.xml"/> + <suite.member href="canRemoveChildTrue.xml"/> + <suite.member href="canReplaceChildFalse.xml"/> + <suite.member href="canReplaceChildTrue.xml"/> + <suite.member href="canReplaceDataFalse.xml"/> + <suite.member href="canReplaceDataTrue.xml"/> + <suite.member href="canSetAttributeFalse.xml"/> + <suite.member href="canSetAttributeNS.xml"/> + <suite.member href="canSetAttributeNode.xml"/> + <suite.member href="canSetAttributeTrue.xml"/> + <suite.member href="canSetData.xml"/> + <suite.member href="contentType.xml"/> + <suite.member href="defaultValue.xml"/> + <suite.member href="definedElements.xml"/> + <suite.member href="enumeratedValues.xml"/> + <suite.member href="isElementDefined.xml"/> + <suite.member href="isElementDefinedNS.xml"/> + <suite.member href="nodeValidity.xml"/> + <suite.member href="requiredAttributes.xml"/> + <suite.member href="validateDocument.xml"/> + + <suite.member href="hasFeature01.xml"/> + <suite.member href="hasFeature02.xml"/> + <suite.member href="hasFeature03.xml"/> + <suite.member href="hasFeature04.xml"/> + <suite.member href="getFeature01.xml"/> + <suite.member href="getFeature02.xml"/> + +</suite> diff --git a/test/testcases/tests/level3/validation/canAppendChildFalse.xml b/test/testcases/tests/level3/validation/canAppendChildFalse.xml new file mode 100644 index 0000000..c2041d6 --- /dev/null +++ b/test/testcases/tests/level3/validation/canAppendChildFalse.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canAppendChildFalse"> +<metadata> + +<title>canAppendChildFalse</title> +<creator>Kongyi Zhou</creator> +<description> + The method canAppendChild checks with schema to see if the child node can be appended + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canAppendChild"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="newchild" type="Element"/> +<var name="nullNS" type="DOMString" isNull="true"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<createElementNS obj="doc" interface="Document" namespaceURI="nullNS" qualifiedName='"editor"' var="newchild"/> +<canAppendChild obj="root" newChild="newchild" var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canAppendChildFalse"/> +</test>
\ No newline at end of file diff --git a/test/testcases/tests/level3/validation/canAppendChildTrue.xml b/test/testcases/tests/level3/validation/canAppendChildTrue.xml new file mode 100644 index 0000000..5f08832 --- /dev/null +++ b/test/testcases/tests/level3/validation/canAppendChildTrue.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canAppendChildTrue"> +<metadata> + +<title>canAppendChildTrue</title> +<creator>Kongyi Zhou</creator> +<description> + The method canAppendChild checks with schema to see if the child node can be appended + should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canAppendChild"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="newchild" type="Element"/> +<var name="nullNS" type="DOMString" isNull="true"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<createElementNS obj="doc" interface="Document" namespaceURI="nullNS" qualifiedName='"year"' var="newchild"/> +<canAppendChild obj="root" newChild="newchild" var="valboolean"/> +<assertEquals actual="valboolean" expected="5" ignoreCase="false" id="canAppendChildTrue"/> +</test>
\ No newline at end of file diff --git a/test/testcases/tests/level3/validation/canAppendData.xml b/test/testcases/tests/level3/validation/canAppendData.xml new file mode 100644 index 0000000..305fa69 --- /dev/null +++ b/test/testcases/tests/level3/validation/canAppendData.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canAppendData"> +<metadata> + +<title>canAppendData</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if given charactors can be appended + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-CharacterDataEditVAL-canAppendData"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elemList" type="NodeList"/> +<var name="elem" type="Element"/> +<var name="valboolean" type="short"/> +<var name="chars" type="CharacterDataEditVAL"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName obj="doc" interface="Document" var="elemList" tagname='"edition"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<firstChild interface="Node" obj="elem" var="chars"/> +<canAppendData obj="chars" arg='"USD60"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canAppendData"/> +</test> diff --git a/test/testcases/tests/level3/validation/canDeleteData.xml b/test/testcases/tests/level3/validation/canDeleteData.xml new file mode 100644 index 0000000..c6ef93a --- /dev/null +++ b/test/testcases/tests/level3/validation/canDeleteData.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canDeleteData"> +<metadata> + +<title>canDeleteData</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if given characters can be deleted from exitsting text + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-CharacterDataEditVAL-canDeleteData"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elemList" type="NodeList"/> +<var name="elem" type="Element"/> +<var name="valboolean" type="short"/> +<var name="chars" type="CharacterDataEditVAL"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName obj="doc" interface="Document" var="elemList" tagname='"edition"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<firstChild interface="Node" obj="elem" var="chars"/> +<canDeleteData obj="chars" offset="0" count="10" var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canDeleteData"/> +</test> diff --git a/test/testcases/tests/level3/validation/canInsertBeforeFalse.xml b/test/testcases/tests/level3/validation/canInsertBeforeFalse.xml new file mode 100644 index 0000000..b060309 --- /dev/null +++ b/test/testcases/tests/level3/validation/canInsertBeforeFalse.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canInsertBeforeFalse"> +<metadata> + +<title>canInsertBeforeFalse</title> +<creator>Kongyi Zhou</creator> +<description> + The method canInsertBefore checks with schema to see if a new child can be inserted + before reference node + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canInsertBefore"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="oldchild" type="Node"/> +<var name="nlist" type="NodeList"/> +<var name="newchild" type="Element"/> +<var name="nullNS" type="DOMString" isNull="true"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" tagname='"ISBN"' var="nlist"/> +<item obj="nlist" index="0" var="oldchild" interface="NodeList"/> +<documentElement obj="doc" var="root"/> +<createElementNS obj="doc" namespaceURI="nullNS" qualifiedName='"editor"' var="newchild"/> +<canInsertBefore obj="root" newChild="newchild" refChild="oldchild" var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canInsertBeforeFalse"/> +</test> diff --git a/test/testcases/tests/level3/validation/canInsertBeforeTrue.xml b/test/testcases/tests/level3/validation/canInsertBeforeTrue.xml new file mode 100644 index 0000000..fb341a7 --- /dev/null +++ b/test/testcases/tests/level3/validation/canInsertBeforeTrue.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canInsertBeforeTrue"> +<metadata> + +<title>canInsertBeforeTrue</title> +<creator>Kongyi Zhou</creator> +<description> + The method canInsertBefore checks with schema to see if a new child can be inserted + before reference node + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canInsertBefore"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="oldchild" type="Node"/> +<var name="refchild" type="Node"/> +<var name="nlist" type="NodeList"/> +<var name="newchild" type="Element"/> +<var name="nullNS" type="DOMString" isNull="true"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" tagname='"ISBN"' var="nlist"/> +<item obj="nlist" index="0" var="refchild" interface="NodeList"/> +<documentElement obj="doc" var="root"/> +<createElementNS obj="doc" namespaceURI="nullNS" qualifiedName='"editor"' var="newchild"/> +<getElementsByTagName interface="Document" obj="doc" tagname='"author"' var="nlist"/> +<item obj="nlist" index="0" var="oldchild" interface="NodeList"/> +<removeChild obj="root" oldChild="oldchild" var="oldchild"/> +<canInsertBefore obj="root" newChild="newchild" refChild="refchild" var="valboolean"/> +<assertEquals actual="valboolean" expected="5" ignoreCase="false" id="canInsertBeforeTrue"/> +</test> diff --git a/test/testcases/tests/level3/validation/canInsertData.xml b/test/testcases/tests/level3/validation/canInsertData.xml new file mode 100644 index 0000000..ef17ce3 --- /dev/null +++ b/test/testcases/tests/level3/validation/canInsertData.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canInsertData"> +<metadata> + +<title>canInsertData</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if given characters can be inserted into exitsting text + at given position + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-CharacterDataEditVAL-canInsertData"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elemList" type="NodeList"/> +<var name="elem" type="Element"/> +<var name="valboolean" type="short"/> +<var name="chars" type="CharacterDataEditVAL"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName obj="doc" interface="Document" var="elemList" tagname='"edition"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<firstChild interface="Node" obj="elem" var="chars"/> +<canInsertData obj="chars" offset="0" arg='"USD60"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canInsertData"/> +</test> diff --git a/test/testcases/tests/level3/validation/canRemoveAttributeFalse.xml b/test/testcases/tests/level3/validation/canRemoveAttributeFalse.xml new file mode 100644 index 0000000..b4e86c9 --- /dev/null +++ b/test/testcases/tests/level3/validation/canRemoveAttributeFalse.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canRemoveAttributeFalse"> +<metadata> + +<title>canRemoveAttributeFalse</title> +<creator>Kongyi Zhou</creator> +<description> + The method canSteAttribute checks if the 'inStock' attribute can be removed + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-canRemoveAttribute"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> + +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<canRemoveAttribute obj="root" attrname='"inStock"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canRemoveAttributeFalse"/> +</test> diff --git a/test/testcases/tests/level3/validation/canRemoveAttributeNS.xml b/test/testcases/tests/level3/validation/canRemoveAttributeNS.xml new file mode 100644 index 0000000..80e5606 --- /dev/null +++ b/test/testcases/tests/level3/validation/canRemoveAttributeNS.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canRemoveAttributeNS"> +<metadata> + +<title>canRemoveAttributeNS</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if the attribute with given namesapce and name can be removed + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-canRemoveAttributeNS"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="nullNS" type="DOMString" isNull="true"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<canRemoveAttributeNS obj="root" namespaceURI="nullNS" localName='"inStock"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canRemoveAttributeNS"/> +</test> + + diff --git a/test/testcases/tests/level3/validation/canRemoveAttributeNode.xml b/test/testcases/tests/level3/validation/canRemoveAttributeNode.xml new file mode 100644 index 0000000..892668c --- /dev/null +++ b/test/testcases/tests/level3/validation/canRemoveAttributeNode.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canRemoveAttributeNode"> +<metadata> + +<title>canRemoveAttribute</title> +<creator>Kongyi Zhou</creator> +<description> + The method canRemoveAttributeNode checks if given attribute node can be removed + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-canRemoveAttributeNode"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="attr" type="Attr"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<getAttributeNode obj="root" name='"inStock"' var="attr"/> +<canRemoveAttributeNode obj="root" attrNode="attr" var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canRemoveAttributeNode"/> +</test> diff --git a/test/testcases/tests/level3/validation/canRemoveAttributeTrue.xml b/test/testcases/tests/level3/validation/canRemoveAttributeTrue.xml new file mode 100644 index 0000000..3468828 --- /dev/null +++ b/test/testcases/tests/level3/validation/canRemoveAttributeTrue.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canRemoveAttributeTrue"> +<metadata> + +<title>canRemoveAttributeTrue</title> +<creator>Kongyi Zhou</creator> +<description> + The method canSteAttribute checks if the 'price' attribute can be removed + should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-canRemoveAttribute"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> + +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<canRemoveAttribute obj="root" attrname='"price"' var="valboolean"/> +<assertEquals actual="valboolean" expected="5" ignoreCase="false" id="canRemoveAttributeTrue"/> +</test> diff --git a/test/testcases/tests/level3/validation/canRemoveChildFalse.xml b/test/testcases/tests/level3/validation/canRemoveChildFalse.xml new file mode 100644 index 0000000..6bd0966 --- /dev/null +++ b/test/testcases/tests/level3/validation/canRemoveChildFalse.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canRemoveChildFalse"> +<metadata> + +<title>canRemoveChildFalse</title> +<creator>Kongyi Zhou</creator> +<description> + The method canRemoveChild checks if schema allows the child to be removed + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canRemoveChild"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="oldchild" type="Node"/> +<var name="nlist" type="NodeList"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" tagname='"ISBN"' var="nlist"/> +<item obj="nlist" index="0" var="oldchild" interface="NodeList"/> +<documentElement obj="doc" var="root"/> +<canRemoveChild obj="root" oldChild="oldchild" var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canRemoveChildFalse"/> +</test> + + + + diff --git a/test/testcases/tests/level3/validation/canRemoveChildTrue.xml b/test/testcases/tests/level3/validation/canRemoveChildTrue.xml new file mode 100644 index 0000000..0fcbe59 --- /dev/null +++ b/test/testcases/tests/level3/validation/canRemoveChildTrue.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canRemoveChildTrue"> +<metadata> + +<title>canRemoveChildTrue</title> +<creator>Kongyi Zhou</creator> +<description> + The method canRemoveChild checks if schema allows the child to be removed + should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canRemoveChild"/> +</metadata> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="oldchild" type="Node"/> +<var name="nlist" type="NodeList"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" tagname='"edition"' var="nlist"/> +<item obj="nlist" index="0" var="oldchild" interface="NodeList"/> +<documentElement obj="doc" var="root"/> +<canRemoveChild obj="root" oldChild="oldchild" var="valboolean"/> +<assertEquals actual="valboolean" expected="5" ignoreCase="false" id="canRemoveChildTrue"/> +</test> + + + + diff --git a/test/testcases/tests/level3/validation/canReplaceChildFalse.xml b/test/testcases/tests/level3/validation/canReplaceChildFalse.xml new file mode 100644 index 0000000..1b47e9f --- /dev/null +++ b/test/testcases/tests/level3/validation/canReplaceChildFalse.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canReplaceChildFalse"> +<metadata> + +<title>canReplaceChildFalse</title> +<creator>Kongyi Zhou</creator> +<description> + The method canReplaceChild checks with schema to see if new child 'editor' can replace + old child title + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canReplaceChild"/> +</metadata> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="oldchild" type="Node"/> +<var name="nlist" type="NodeList"/> +<var name="newchild" type="Element"/> +<var name="nullNS" type="DOMString" isNull="true"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" tagname='"title"' var="nlist"/> +<item obj="nlist" index="0" var="oldchild" interface="NodeList"/> +<documentElement obj="doc" var="root"/> +<createElementNS obj="doc" namespaceURI="nullNS" qualifiedName='"editor"' var="newchild"/> +<canReplaceChild obj="root" newChild="newchild" oldChild="oldchild" var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canReplaceChildFalse"/> +</test>
\ No newline at end of file diff --git a/test/testcases/tests/level3/validation/canReplaceChildTrue.xml b/test/testcases/tests/level3/validation/canReplaceChildTrue.xml new file mode 100644 index 0000000..a74d93a --- /dev/null +++ b/test/testcases/tests/level3/validation/canReplaceChildTrue.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canReplaceChildTrue"> +<metadata> + +<title>canReplaceChildTrue</title> +<creator>Kongyi Zhou</creator> +<description> + The method canReplaceChild checks with schema to see if new child 'editor' can replace + old child 'author' + should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canReplaceChild"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="oldchild" type="Node"/> +<var name="nlist" type="NodeList"/> +<var name="newchild" type="Element"/> +<var name="nullNS" type="DOMString" isNull="true"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" tagname='"author"' var="nlist"/> +<item obj="nlist" index="0" var="oldchild" interface="NodeList"/> +<documentElement obj="doc" var="root"/> +<createElementNS obj="doc" namespaceURI="nullNS" qualifiedName='"editor"' var="newchild"/> +<canReplaceChild obj="root" newChild="newchild" oldChild="oldchild" var="valboolean"/> +<assertEquals actual="valboolean" expected="5" ignoreCase="false" id="canReplaceChildTrue"/> +</test>
\ No newline at end of file diff --git a/test/testcases/tests/level3/validation/canReplaceDataFalse.xml b/test/testcases/tests/level3/validation/canReplaceDataFalse.xml new file mode 100644 index 0000000..2f91b83 --- /dev/null +++ b/test/testcases/tests/level3/validation/canReplaceDataFalse.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canReplaceDataFalse"> +<metadata> + +<title>canReplaceDataFalse</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if given characters can replace exitsting text + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-CharacterDataEditVAL-canReplaceData"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elemList" type="NodeList"/> +<var name="elem" type="Element"/> +<var name="valboolean" type="short"/> +<var name="chars" type="CharacterDataEditVAL"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" var="elemList" tagname='"edition"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<firstChild interface="Node" obj="elem" var="chars"/> +<canReplaceData obj="chars" offset="0" count="5" arg='"2nd"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canReplaceDataFalse"/> +</test> diff --git a/test/testcases/tests/level3/validation/canReplaceDataTrue.xml b/test/testcases/tests/level3/validation/canReplaceDataTrue.xml new file mode 100644 index 0000000..7400e7b --- /dev/null +++ b/test/testcases/tests/level3/validation/canReplaceDataTrue.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canReplaceDataTrue"> +<metadata> + +<title>canReplaceDataTrue</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if given characters can replace exitsting text + should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-CharacterDataEditVAL-canReplaceData"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elemList" type="NodeList"/> +<var name="elem" type="Element"/> +<var name="valboolean" type="short"/> +<var name="chars" type="CharacterDataEditVAL"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" var="elemList" tagname='"edition"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<firstChild interface="Node" obj="elem" var="chars"/> +<canReplaceData obj="chars" offset="0" count="6" arg='"First"' var="valboolean"/> +<assertEquals actual="valboolean" expected="5" ignoreCase="false" id="canReplaceDataTrue"/> +</test> diff --git a/test/testcases/tests/level3/validation/canSetAttributeFalse.xml b/test/testcases/tests/level3/validation/canSetAttributeFalse.xml new file mode 100644 index 0000000..c2c9d17 --- /dev/null +++ b/test/testcases/tests/level3/validation/canSetAttributeFalse.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canSetAttributeFalse"> +<metadata> + +<title>canSetAttributeFalse</title> +<creator>Kongyi Zhou</creator> +<description> + The method canSetAttribute checks if a new attribute 'attr' can be set + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-ElementEditVAL-canSetAttribute"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> + +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<canSetAttribute obj="root" attrname='"attr"' attrval='"No"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canSetAttributeFalse"/> +</test> diff --git a/test/testcases/tests/level3/validation/canSetAttributeNS.xml b/test/testcases/tests/level3/validation/canSetAttributeNS.xml new file mode 100644 index 0000000..d060237 --- /dev/null +++ b/test/testcases/tests/level3/validation/canSetAttributeNS.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canSetAttributeNS"> +<metadata> + +<title>canSetAttributeNS</title> +<creator>Kongyi Zhou</creator> +<description> + The method canSetAttributeNS checks if an attribute with given namespace and name can be set + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-canSetAttributeNS"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="nullNS" type="DOMString" isNull="true"/> + +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<canSetAttributeNS obj="root" namespaceURI="nullNS" qualifiedName='"inStock"' value ='"out"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canSetAttributeNS"/> +</test> + diff --git a/test/testcases/tests/level3/validation/canSetAttributeNode.xml b/test/testcases/tests/level3/validation/canSetAttributeNode.xml new file mode 100644 index 0000000..f713bf2 --- /dev/null +++ b/test/testcases/tests/level3/validation/canSetAttributeNode.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canSetAttributeNode"> +<metadata> + +<title>canSetAttributeNode</title> +<creator>Kongyi Zhou</creator> +<description> + The method canSteAttribute checks if a new attribute node 'attname' can be set + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-canSetAttributeNode"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> +<var name="attr" type="Attr"/> + +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<createAttribute obj="doc" var="attr" name='"attname"'/> +<canSetAttributeNode obj="root" attrNode="attr" var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canSetAttributeNode"/> +</test> diff --git a/test/testcases/tests/level3/validation/canSetAttributeTrue.xml b/test/testcases/tests/level3/validation/canSetAttributeTrue.xml new file mode 100644 index 0000000..863ec84 --- /dev/null +++ b/test/testcases/tests/level3/validation/canSetAttributeTrue.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canSetAttributeTrue"> +<metadata> + +<title>canSetAttributeTrue</title> +<creator>Kongyi Zhou</creator> +<description> + The method canSetAttribute checks if value attribute 'inStock' can be set + should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-ElementEditVAL-canSetAttribute"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> + +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<canSetAttribute obj="root" attrname='"inStock"' attrval='"No"' var="valboolean"/> +<assertEquals actual="valboolean" expected="5" ignoreCase="false" id="canSetAttributeTrue"/> +</test> diff --git a/test/testcases/tests/level3/validation/canSetData.xml b/test/testcases/tests/level3/validation/canSetData.xml new file mode 100644 index 0000000..e345140 --- /dev/null +++ b/test/testcases/tests/level3/validation/canSetData.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canSetData"> +<metadata> + +<title>canSetData</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if given characters can be set as the content of element 'edition' + should return VAL_FALSE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-CharacterDataEditVAL-canSetData"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elemList" type="NodeList"/> +<var name="elem" type="Element"/> +<var name="valboolean" type="short"/> +<var name="chars" type="CharacterDataEditVAL"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName obj="doc" interface="Document" var="elemList" tagname='"edition"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<firstChild interface="Node" obj="elem" var="chars"/> +<canSetData obj="chars" arg='"USD60"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="canSetData"/> +</test> diff --git a/test/testcases/tests/level3/validation/contentType.xml b/test/testcases/tests/level3/validation/contentType.xml new file mode 100644 index 0000000..ba23531 --- /dev/null +++ b/test/testcases/tests/level3/validation/contentType.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="contentType"> +<metadata> + +<title>contentType</title> +<creator>Kongyi Zhou</creator> +<description> + get the content type of element, should return VAL_ELEMENTS_CONTENTTYPE + should return 4 +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-ElementEditVAL-contentType"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="content" type="short"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<contentType interface="ElementEditVAL" obj="root" var="content"/> +<assertEquals actual="content" expected="4" ignoreCase="false" id="contentType"/> +</test>
\ No newline at end of file diff --git a/test/testcases/tests/level3/validation/defaultValue.xml b/test/testcases/tests/level3/validation/defaultValue.xml new file mode 100644 index 0000000..5ebb43e --- /dev/null +++ b/test/testcases/tests/level3/validation/defaultValue.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="defaultValue"> +<metadata> + +<title>defaultValue</title> +<creator>Kongyi Zhou</creator> +<description> + This method returns the default value of the element. + Should return null +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#NodeEditVAL-defaultValue"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elem" type="ElementEditVAL"/> +<var name="elemList" type="NodeList"/> +<var name="value" type="DOMString"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName obj="doc" interface="Document" var="elemList" tagname='"edition"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<defaultValue interface="NodeEditVAL" obj="elem" var="value"/> +<assertEquals actual="value" expected='"First"' ignoreCase="false" id="defaultValue"/></test> + + diff --git a/test/testcases/tests/level3/validation/definedElements.xml b/test/testcases/tests/level3/validation/definedElements.xml new file mode 100644 index 0000000..9feae1f --- /dev/null +++ b/test/testcases/tests/level3/validation/definedElements.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="definedElements"> +<metadata> + +<title>definedElements</title> +<creator>Kongyi Zhou</creator> +<description> + This method retrieves all element declarations defined by schema + should return a NameList of length 8 +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#DocumentEditVAL-getDefinedElements"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="DocumentEditVAL"/> +<var name="nameList" type="NameList"/> +<var name="nullNS" type="DOMString" isNull="true"/> +<var name="definedElementsLength" type="int"/> +<load var="doc" href="book" willBeModified="false"/> +<getDefinedElements obj="doc" interface="DocumentEditVAL" namespaceURI="nullNS" var="nameList"/> +<assertNotNull actual="nameList" id="definedElementsNotNull"/> +<length var="definedElementsLength" obj="nameList" interface="NameList"/> +<assertEquals expected="8" actual="definedElementsLength" id="definedElements" ignoreCase="false"/> +</test> + diff --git a/test/testcases/tests/level3/validation/enumeratedValues.xml b/test/testcases/tests/level3/validation/enumeratedValues.xml new file mode 100644 index 0000000..22b907e --- /dev/null +++ b/test/testcases/tests/level3/validation/enumeratedValues.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="enumeratedValues"> +<metadata> + +<title>enumeratedValuess</title> +<creator>Kongyi Zhou</creator> +<description> + The method enumeratedValues returns a DOMStringList of enumerated values for + the element. +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#NodeEditVAL-enumeratedValues"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elem" type="NodeEditVAL"/> +<var name="elemList" type="NodeList"/> +<var name="strlist" type="DOMStringList"/> +<var name="enumeratedValuesLength" type="int"/> +<load var="doc" href="book" willBeModified="false"/> +<getElementsByTagName interface="Document" obj="doc" var="elemList" tagname='"edition"'/> +<item interface="NodeList" obj="elemList" index="0" var="elem"/> +<enumeratedValues interface="NodeEditVAL" obj="elem" var="strlist"/> +<assertNotNull actual="strlist" id="enumeratedValuesNotNull"/> +<length var="enumeratedValuesLength" obj="strlist" interface="DOMStringList"/> +<assertEquals actual="enumeratedValuesLength" expected="5" id="enumeratedValues" ignoreCase="false"/> +</test> + + diff --git a/test/testcases/tests/level3/validation/files/CVS/Entries b/test/testcases/tests/level3/validation/files/CVS/Entries new file mode 100644 index 0000000..04dec85 --- /dev/null +++ b/test/testcases/tests/level3/validation/files/CVS/Entries @@ -0,0 +1,3 @@ +/book.xml/1.1/Fri Apr 3 02:47:58 2009// +/book.xsd/1.1/Fri Apr 3 02:47:58 2009// +D diff --git a/test/testcases/tests/level3/validation/files/CVS/Repository b/test/testcases/tests/level3/validation/files/CVS/Repository new file mode 100644 index 0000000..edccdc4 --- /dev/null +++ b/test/testcases/tests/level3/validation/files/CVS/Repository @@ -0,0 +1 @@ +2001/DOM-Test-Suite/tests/level3/validation/files diff --git a/test/testcases/tests/level3/validation/files/CVS/Root b/test/testcases/tests/level3/validation/files/CVS/Root new file mode 100644 index 0000000..3c7177e --- /dev/null +++ b/test/testcases/tests/level3/validation/files/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@dev.w3.org:/sources/public diff --git a/test/testcases/tests/level3/validation/files/CVS/Template b/test/testcases/tests/level3/validation/files/CVS/Template new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/testcases/tests/level3/validation/files/CVS/Template diff --git a/test/testcases/tests/level3/validation/files/book.xml b/test/testcases/tests/level3/validation/files/book.xml new file mode 100644 index 0000000..b999b98 --- /dev/null +++ b/test/testcases/tests/level3/validation/files/book.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?>
+<book inStock="Yes" price="64.28" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="book.xsd">
+<title>Compilers: Principles, Techniques, and Tools</title>
+<author>Alfred V.Aho, Ravi Sethi, Jeffrey D. Ullman</author>
+<ISBN>0-201-10088-6</ISBN>
+<edition>Second</edition>
+<publisher>Addison Wesley</publisher>
+</book>
+
diff --git a/test/testcases/tests/level3/validation/files/book.xsd b/test/testcases/tests/level3/validation/files/book.xsd new file mode 100644 index 0000000..1f395cd --- /dev/null +++ b/test/testcases/tests/level3/validation/files/book.xsd @@ -0,0 +1,52 @@ +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:element name="book" type="bookType"/>
+
+
+ <xsd:complexType name="bookType">
+ <xsd:sequence>
+ <xsd:element ref="title"/>
+ <xsd:choice>
+ <xsd:element ref="author"/>
+ <xsd:element ref="editor"/>
+ </xsd:choice>
+ <xsd:element ref="ISBN"/>
+ <xsd:element ref="edition" minOccurs ="0"/>
+ <xsd:element ref="publisher"/>
+ <xsd:element ref="year" minOccurs="0"/>
+ </xsd:sequence>
+ <xsd:attribute name="price" type="xsd:decimal"/>
+ <xsd:attribute name="inStock" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="Yes"/>
+ <xsd:enumeration value="No"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+
+ <xsd:element name="title" type="xsd:string"/>
+ <xsd:element name="author" type="xsd:string"/>
+ <xsd:element name="ISBN" type="xsd:string"/>
+ <xsd:element name="edition" default="First">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="First"/>
+ <xsd:enumeration value="Second"/>
+ <xsd:enumeration value="Third"/>
+ <xsd:enumeration value="Fourth"/>
+ <xsd:enumeration value="Fifth"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:element>
+ <xsd:element name="publisher" type="xsd:string"/>
+ <xsd:element name="editor" type ="xsd:string"/>
+ <xsd:element name="year">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value ="[0-9]{4}"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:element>
+</xsd:schema>
diff --git a/test/testcases/tests/level3/validation/getFeature01.xml b/test/testcases/tests/level3/validation/getFeature01.xml new file mode 100644 index 0000000..dc1ab17 --- /dev/null +++ b/test/testcases/tests/level3/validation/getFeature01.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" standalone="no"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> +<!-- + +Copyright (c) 2003-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. + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> + + +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="getFeature01"> + <metadata> + <title>getFeature01</title> + <creator>Curt Arnold</creator> + <description>Call DOMImplementation.getFeature("Validation", "3.0"). + Not sure what should happen. Have requested clarification from WG.</description> + <date qualifier="created">2004-01-05</date> + <!-- DOMImplementation.getFeature --> + <subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core#DOMImplementation3-getFeature"/> + </metadata> + <hasFeature feature='"Core"' version='"3.0"'/> + <var name="domImpl" type="DOMImplementation"/> + <var name="domImplVAL" type="DOMImplementation"/> + <implementation var="domImpl"/> + <getFeature var="domImplVAL" obj="domImpl" + feature='"Validation"' version='"3.0"' interface="DOMImplementation"/> + <!-- TODO: Request for clarification. The spec doesn't address case where + feature does not introduce new interface --> + <assertNull actual="domImplVAL" id="getFeatureReturnsNull"/> +</test> + + + + + diff --git a/test/testcases/tests/level3/validation/getFeature02.xml b/test/testcases/tests/level3/validation/getFeature02.xml new file mode 100644 index 0000000..c30f2a0 --- /dev/null +++ b/test/testcases/tests/level3/validation/getFeature02.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" standalone="no"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> +<!-- + +Copyright (c) 2003-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. + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> + + +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="getFeature02"> + <metadata> + <title>getFeature02</title> + <creator>Curt Arnold</creator> + <description>Call DOMImplementation.getFeature("+vAlIdAtIoN", "3.0").</description> + <date qualifier="created">2004-01-05</date> + <!-- DOMImplementation.getFeature --> + <subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core#DOMImplementation3-getFeature"/> + </metadata> + <hasFeature feature='"Core"' version='"3.0"'/> + <var name="domImpl" type="DOMImplementation"/> + <var name="domImplVAL" type="DOMImplementation"/> + <implementation var="domImpl"/> + <getFeature var="domImplVAL" obj="domImpl" feature='"+vAlIdAtIoN"' + version='"3.0"' interface="DOMImplementation"/> + <assertNull actual="domImplVAL" id="domImplVALNull"/> +</test> + + + + + diff --git a/test/testcases/tests/level3/validation/hasFeature01.xml b/test/testcases/tests/level3/validation/hasFeature01.xml new file mode 100644 index 0000000..e0f0831 --- /dev/null +++ b/test/testcases/tests/level3/validation/hasFeature01.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" standalone="no"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> +<!-- + +Copyright (c) 2003-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. + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> + + +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="hasFeature01"> + <metadata> + <title>hasFeature01</title> + <creator>Curt Arnold</creator> + <description>Implementations should return true for hasFeature("vAlIdAtIoN", "3.0").</description> + <date qualifier="created">2004-01-05</date> + <!-- DOMImplementation.hasFeature --> + <subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core#ID-5CED94D7"/> + </metadata> + <var name="domImpl" type="DOMImplementation"/> + <var name="hasVAL" type="boolean"/> + <implementation var="domImpl"/> + <hasFeature var="hasVAL" obj="domImpl" feature='"vAlIdAtIoN"' version='"3.0"'/> + <assertTrue actual="hasVAL" id="hasFeature_VAL3"/> +</test> + + + + + diff --git a/test/testcases/tests/level3/validation/hasFeature02.xml b/test/testcases/tests/level3/validation/hasFeature02.xml new file mode 100644 index 0000000..08cb26d --- /dev/null +++ b/test/testcases/tests/level3/validation/hasFeature02.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" standalone="no"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> +<!-- + +Copyright (c) 2003-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. + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> + + +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="hasFeature02"> + <metadata> + <title>HasFeature02</title> + <creator>Curt Arnold</creator> + <description>Implementations should return true for hasFeature("vAlIdAtIoN", null).</description> + <date qualifier="created">2004-01-05</date> + <!-- DOMImplementation.hasFeature --> + <subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core#ID-5CED94D7"/> + </metadata> + <var name="domImpl" type="DOMImplementation"/> + <var name="hasVAL" type="boolean"/> + <var name="version" type="DOMString" isNull="true"/> + <implementation var="domImpl"/> + <hasFeature var="hasVAL" obj="domImpl" feature='"vAlIdAtIoN"' version="version"/> + <assertTrue actual="hasVAL" id="hasFeature_VAL"/> +</test> + + + + + diff --git a/test/testcases/tests/level3/validation/hasFeature03.xml b/test/testcases/tests/level3/validation/hasFeature03.xml new file mode 100644 index 0000000..1fb2615 --- /dev/null +++ b/test/testcases/tests/level3/validation/hasFeature03.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" standalone="no"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> +<!-- + +Copyright (c) 2003-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. + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> + + +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="hasFeature03"> + <metadata> + <title>hasFeature03</title> + <creator>Curt Arnold</creator> + <description>Implementations should return true for hasFeature("cOrE", "2.0") and hasFeature("cOrE", null).</description> + <date qualifier="created">2004-01-05</date> + <!-- DOMImplementation.hasFeature --> + <subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core#ID-5CED94D7"/> + </metadata> + <var name="domImpl" type="DOMImplementation"/> + <var name="hasCore" type="boolean"/> + <var name="nullVersion" type="DOMString" isNull="true"/> + <implementation var="domImpl"/> + <hasFeature var="hasCore" obj="domImpl" feature='"cOrE"' version='"2.0"'/> + <assertTrue actual="hasCore" id="hasFeature_Core2"/> + <hasFeature var="hasCore" obj="domImpl" feature='"cOrE"' version="nullVersion"/> + <assertTrue actual="hasCore" id="hasFeature_Core"/> +</test> + + + + + diff --git a/test/testcases/tests/level3/validation/hasFeature04.xml b/test/testcases/tests/level3/validation/hasFeature04.xml new file mode 100644 index 0000000..f63ec01 --- /dev/null +++ b/test/testcases/tests/level3/validation/hasFeature04.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" standalone="no"?> +<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> +<!-- + +Copyright (c) 2003-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. + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> + + +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="hasFeature04"> + <metadata> + <title>hasFeature04</title> + <creator>Curt Arnold</creator> + <description>Implementations should return true for hasFeature("+vAlIdAtIoN", "3.0").</description> + <date qualifier="created">2003-12-09</date> + <!-- DOMImplementation.hasFeature --> + <subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core#ID-5CED94D7"/> + </metadata> + <!-- + on feature names requires L3 Core --> + <hasFeature feature='"Core"' version='"3.0"'/> + <var name="domImpl" type="DOMImplementation"/> + <var name="hasVAL" type="boolean"/> + <implementation var="domImpl"/> + <hasFeature var="hasVAL" obj="domImpl" feature='"+vAlIdAtIoN"' version='"3.0"'/> + <assertTrue actual="hasVAL" id="hasFeature_VAL3"/> +</test> + + + + + diff --git a/test/testcases/tests/level3/validation/isElementDefined.xml b/test/testcases/tests/level3/validation/isElementDefined.xml new file mode 100644 index 0000000..54cbc01 --- /dev/null +++ b/test/testcases/tests/level3/validation/isElementDefined.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="isElementDefined"> +<metadata> + +<title>isElementDefined</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if element with given name is defined or not + should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-isElementDefined"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> + +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<isElementDefined obj="root" name='"editor"' var="valboolean"/> +<assertEquals actual="valboolean" expected="5" ignoreCase="false" id="isElementDefined"/> +</test> + + + diff --git a/test/testcases/tests/level3/validation/isElementDefinedNS.xml b/test/testcases/tests/level3/validation/isElementDefinedNS.xml new file mode 100644 index 0000000..d97190e --- /dev/null +++ b/test/testcases/tests/level3/validation/isElementDefinedNS.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="isElementDefinedNS"> +<metadata> + +<title>isElementDefinedNS</title> +<creator>Kongyi Zhou</creator> +<description> + This method checks if element with given namespace and name is defined or not + should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-ElementEditVAL-isElementDefined"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="valboolean" type="short"/> + +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<isElementDefinedNS obj="root" namespaceURI='"http://dom3.validation.examples"' name='"editor"' var="valboolean"/> +<assertEquals actual="valboolean" expected="6" ignoreCase="false" id="isElementDefinedNS"/> +</test> + + + diff --git a/test/testcases/tests/level3/validation/metadata.xml b/test/testcases/tests/level3/validation/metadata.xml new file mode 100644 index 0000000..c3c6e71 --- /dev/null +++ b/test/testcases/tests/level3/validation/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+Copyright (c) 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.
+-->
+<!DOCTYPE metadata SYSTEM "dom3.dtd">
+
+<!-- This file contains additional metadata about DOM L3 Validation tests.
+ Allowing additional documentation without modifying the tests themselves. -->
+<metadata xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3">
+</metadata>
diff --git a/test/testcases/tests/level3/validation/nodeValidity.xml b/test/testcases/tests/level3/validation/nodeValidity.xml new file mode 100644 index 0000000..d115ccb --- /dev/null +++ b/test/testcases/tests/level3/validation/nodeValidity.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="nodeValidity"> +<metadata> + +<title>nodeValidity</title> +<creator>Kongyi Zhou</creator> +<description> + check node validity, should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#NodeEditVAL-nodeValidity"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="elem" type="ElementEditVAL"/> +<var name="result" type="short"/> +<var name="checkLevel" type="short" value="4"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="elem"/> +<nodeValidity obj="elem" valType="checkLevel" var="result"/> +<assertEquals actual="result" expected="5" ignoreCase="false" id="nodevalidity"/> +</test> diff --git a/test/testcases/tests/level3/validation/requiredAttributes.xml b/test/testcases/tests/level3/validation/requiredAttributes.xml new file mode 100644 index 0000000..acfa3c8 --- /dev/null +++ b/test/testcases/tests/level3/validation/requiredAttributes.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="requiredAttributes"> +<metadata> + +<title>requiredAttributes</title> +<creator>Kongyi Zhou</creator> +<description> + The method requiredAttributes returns the NameList of required attributes for + the element. +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#ElementEditVAL-requiredAttributes"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="Document"/> +<var name="root" type="ElementEditVAL"/> +<var name="attrlist" type="NameList"/> +<var name="attname" type="DOMString"/> +<load var="doc" href="book" willBeModified="false"/> +<documentElement obj="doc" var="root"/> +<requiredAttributes interface="ElementEditVAL" obj="root" var="attrlist"/> +<assertNotNull actual="attrlist" id="requiredAttributesNotNull"/> +<getName interface="NameList" obj="attrlist" index="0" var="attname"/> +<assertEquals actual="attname" expected='"inStock"' ignoreCase="false" id="requiredAttributes"/> +</test> + + diff --git a/test/testcases/tests/level3/validation/validateDocument.xml b/test/testcases/tests/level3/validation/validateDocument.xml new file mode 100644 index 0000000..dd8b380 --- /dev/null +++ b/test/testcases/tests/level3/validation/validateDocument.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + +Copyright (c) 2003 Oracle + +All Rights Reserved. This program is distributed under the W3C's +Software Intellectual Property License [1]. This program is distributed +in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +--> +<!DOCTYPE test SYSTEM "dom3.dtd"> +<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="validateDocument"> +<metadata> + +<title>validateDocument</title> +<creator>Kongyi Zhou</creator> +<description> + validate the document, should return VAL_TRUE +</description> +<contributor>Oracle Corp.</contributor> +<date qualifier="created">2003-03-01</date> +<subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-DocumentEditVAL-validateDocument"/> +</metadata> +<implementationAttribute name="schemaValidating" value="true"/> + +<var name="doc" type="DocumentEditVAL"/> +<var name="result" type="short"/> +<load var="doc" href="book" willBeModified="false"/> +<validateDocument obj="doc" var="result"/> +<assertEquals actual="result" expected="5" ignoreCase="false" id="validateDocument"/> +</test> |