From 04de8efbac1649aa7aec0bc11e8f1a2f691bbaa1 Mon Sep 17 00:00:00 2001 From: "rpallath%eng.sun.com" Date: Wed, 5 Jul 2000 17:16:15 +0000 Subject: [PATCH] Modified Test Cases. All previously unsupported methods have been supported. Test Cases for the same have been updated. git-svn-id: svn://10.0.0.236/trunk@73675 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/api/AttrImpl_getOwnerElement.java | 23 +-- ...teDocumentType_String_String_String_0.java | 30 ++-- ...teDocumentType_String_String_String_1.java | 134 +++++++++++++++++ ...teDocumentType_String_String_String_2.java | 134 +++++++++++++++++ ...teDocumentType_String_String_String_3.java | 134 +++++++++++++++++ ...teDocumentType_String_String_String_4.java | 134 +++++++++++++++++ ...Document_String_String_DocumentType_0.java | 37 ++--- ...Document_String_String_DocumentType_1.java | 131 +++++++++++++++++ ...Document_String_String_DocumentType_2.java | 138 +++++++++++++++++ ...Document_String_String_DocumentType_3.java | 137 +++++++++++++++++ ...Document_String_String_DocumentType_4.java | 139 ++++++++++++++++++ .../DocumentImpl_createEvent_String_0.java | 10 +- .../DocumentImpl_createEvent_String_1.java | 2 +- .../DocumentImpl_createEvent_String_2.java | 118 +++++++++++++++ .../DocumentImpl_getElementById_String_0.java | 20 +-- .../DocumentImpl_getElementById_String_1.java | 11 +- .../DocumentImpl_getElementById_String_2.java | 119 +++++++++++++++ ...etElementsByTagNameNS_String_String_0.java | 20 +-- ...etElementsByTagNameNS_String_String_1.java | 9 +- ...etElementsByTagNameNS_String_String_2.java | 10 +- ...etElementsByTagNameNS_String_String_3.java | 12 +- .../DocumentTypeImpl_getInternalSubset.java | 23 ++- .../src/api/DocumentTypeImpl_getPublicId.java | 22 ++- .../src/api/DocumentTypeImpl_getSystemId.java | 23 ++- ...ntImpl_getAttributeNS_String_String_0.java | 31 ++-- ...ntImpl_getAttributeNS_String_String_1.java | 16 +- ...ntImpl_getAttributeNS_String_String_2.java | 18 +-- ...ntImpl_getAttributeNS_String_String_3.java | 20 +-- ...pl_getAttributeNodeNS_String_String_0.java | 16 +- ...pl_getAttributeNodeNS_String_String_1.java | 16 +- ...pl_getAttributeNodeNS_String_String_2.java | 16 +- ...pl_getAttributeNodeNS_String_String_3.java | 25 ++-- ...etElementsByTagNameNS_String_String_0.java | 16 +- ...etElementsByTagNameNS_String_String_1.java | 16 +- ...etElementsByTagNameNS_String_String_2.java | 16 +- ...etElementsByTagNameNS_String_String_3.java | 26 ++-- ...ntImpl_hasAttributeNS_String_String_0.java | 18 +-- ...ntImpl_hasAttributeNS_String_String_1.java | 16 +- ...ntImpl_hasAttributeNS_String_String_2.java | 18 +-- ...ntImpl_hasAttributeNS_String_String_3.java | 28 ++-- .../ElementImpl_hasAttribute_String_0.java | 18 +-- .../ElementImpl_hasAttribute_String_1.java | 24 ++- .../ElementImpl_hasAttribute_String_2.java | 129 ++++++++++++++++ ...mpl_removeAttributeNS_String_String_0.java | 16 +- ...mpl_removeAttributeNS_String_String_1.java | 16 +- ...mpl_removeAttributeNS_String_String_2.java | 16 +- ...mpl_removeAttributeNS_String_String_3.java | 20 +-- ...setAttributeNS_String_String_String_0.java | 15 +- ...setAttributeNS_String_String_String_1.java | 14 +- ...setAttributeNS_String_String_String_2.java | 14 +- ...setAttributeNS_String_String_String_3.java | 14 +- ...setAttributeNS_String_String_String_4.java | 14 +- ...setAttributeNS_String_String_String_5.java | 14 +- ...setAttributeNS_String_String_String_6.java | 14 +- ...setAttributeNS_String_String_String_7.java | 14 +- ...setAttributeNS_String_String_String_8.java | 14 +- ...setAttributeNS_String_String_String_9.java | 23 ++- ...ElementImpl_setAttributeNodeNS_Attr_0.java | 14 +- ...ElementImpl_setAttributeNodeNS_Attr_1.java | 45 +++--- .../tests/src/api/NodeImpl_getLocalName.java | 46 ++---- .../src/api/NodeImpl_getNamespaceURI.java | 43 ++---- .../tests/src/api/NodeImpl_getPrefix_0.java | 124 ++++++++++++++++ .../tests/src/api/NodeImpl_getPrefix_1.java | 126 ++++++++++++++++ .../src/api/NodeImpl_setPrefix_String_0.java | 38 ++--- .../src/api/NodeImpl_setPrefix_String_1.java | 42 ++---- .../NodeImpl_supports_String_String_0.java | 35 +---- .../NodeImpl_supports_String_String_1.java | 36 ++--- .../NodeImpl_supports_String_String_2.java | 41 ++---- .../NodeImpl_supports_String_String_3.java | 42 ++---- 69 files changed, 2133 insertions(+), 770 deletions(-) create mode 100644 mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_1.java create mode 100644 mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_2.java create mode 100644 mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_3.java create mode 100644 mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_4.java create mode 100644 mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_1.java create mode 100644 mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_2.java create mode 100644 mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_3.java create mode 100644 mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_4.java create mode 100644 mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_2.java create mode 100644 mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_2.java create mode 100644 mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_2.java create mode 100644 mozilla/java/dom/tests/src/api/NodeImpl_getPrefix_0.java create mode 100644 mozilla/java/dom/tests/src/api/NodeImpl_getPrefix_1.java diff --git a/mozilla/java/dom/tests/src/api/AttrImpl_getOwnerElement.java b/mozilla/java/dom/tests/src/api/AttrImpl_getOwnerElement.java index 0168c0baafd..102fe1544c0 100755 --- a/mozilla/java/dom/tests/src/api/AttrImpl_getOwnerElement.java +++ b/mozilla/java/dom/tests/src/api/AttrImpl_getOwnerElement.java @@ -74,24 +74,29 @@ public class AttrImpl_getOwnerElement extends BWBaseTest implements Execution String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { Attr a = d.createAttribute("dummyattr_2"); - if (a == null) { - TestLoader.logErrPrint("Could not Create Attribute dummyattr_2.."); + Element e = d.getDocumentElement(); + if (a == null || e == null) { + TestLoader.logErrPrint("Could not Create Attribute dummyattr_2 or get document element .."); return BWBaseTest.FAILED; } else { try { - Element e = a.getOwnerElement(); - TestLoader.logErrPrint("Attr 'getOwnerElement()' is not a supported method ..."); + e.setAttributeNode(a); + Attr da = e.getAttributeNode("dummyattr_2"); + Element oe = da.getOwnerElement(); + if (oe != null) { //here we also need to check that oe is the same ??? + return BWBaseTest.PASSED; + } + TestLoader.logErrPrint("Attr 'getOwnerElement()' returned incorrect element: "+oe+" "+oe.getNodeType()); return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + } catch (Exception ex) { + TestLoader.logErrPrint("Exception was thrown: "+ex); + return BWBaseTest.FAILED; } } } else { diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_0.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_0.java index f13cf9b8ed4..03de253d436 100644 --- a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_0.java @@ -75,7 +75,7 @@ public class DOMImplementationImpl_createDocumentType_String_String_String_0 ext String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) @@ -86,26 +86,28 @@ public class DOMImplementationImpl_createDocumentType_String_String_String_0 ext return BWBaseTest.FAILED; } else { try { - if (di.createDocumentType(null, null, null) == null) { - System.out.println("DomImplementation 'createDocumentType(null, null, null) according to specs. is not supported..."); + String qualifiedName = "edi:price"; + String publicId = "pID"; + String systemId = "sID"; + DocumentType dt = di.createDocumentType(qualifiedName, publicId, systemId); + if (dt == null) { + System.out.println("DomImplementation 'createDocumentType(...) returned null ..."); return BWBaseTest.FAILED; - - } else { - System.out.println("DomImplementation 'createDocumentType(null, null, null)' according to specs is not supported..."); - } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD "; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - - } + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException was thrown: "+de); + return BWBaseTest.FAILED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception was thrown: "+e); + return BWBaseTest.FAILED; + } } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; - return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_1.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_1.java new file mode 100644 index 00000000000..ce513f81a21 --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_1.java @@ -0,0 +1,134 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DOMImplementationImpl_createDocumentType_String_String_String_1 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DOMImplementationImpl_createDocumentType_String_String_String_1() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logErrPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + Document d = (Document)tobj; + if (d != null) + { + DOMImplementationImpl di = (DOMImplementationImpl)d.getImplementation(); + if (di == null) { + TestLoader.logErrPrint("Document DomImplementation is NULL.."); + return BWBaseTest.FAILED; + } else { + try { + String qualifiedName = null; + String publicId = "pID"; + String systemId = "sID"; + DocumentType dt = di.createDocumentType(qualifiedName, publicId, systemId); + if (dt == null) { + System.out.println("DomImplementation 'createDocumentType(...) returned null ..."); + return BWBaseTest.FAILED; + } else { + System.out.println("DomImplementation 'createDocumentType(...)' didn't throw exception "); + return BWBaseTest.FAILED; + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException was thrown: "+de); + return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception was thrown: "+e); + return BWBaseTest.PASSED; + } + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_2.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_2.java new file mode 100644 index 00000000000..3d8fa543958 --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_2.java @@ -0,0 +1,134 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DOMImplementationImpl_createDocumentType_String_String_String_2 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DOMImplementationImpl_createDocumentType_String_String_String_2() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logErrPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + Document d = (Document)tobj; + if (d != null) + { + DOMImplementationImpl di = (DOMImplementationImpl)d.getImplementation(); + if (di == null) { + TestLoader.logErrPrint("Document DomImplementation is NULL.."); + return BWBaseTest.FAILED; + } else { + try { + String qualifiedName = "edi:price"; + String publicId = null; + String systemId = "sID"; + DocumentType dt = di.createDocumentType(qualifiedName, publicId, systemId); + if (dt == null) { + System.out.println("DomImplementation 'createDocumentType(...) returned null ..."); + return BWBaseTest.FAILED; + } else { + System.out.println("DomImplementation 'createDocumentType(...)' didn't throw exception "); + return BWBaseTest.FAILED; + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException was thrown: "+de); + return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception was thrown: "+e); + return BWBaseTest.PASSED; + } + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_3.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_3.java new file mode 100644 index 00000000000..7854bf85710 --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_3.java @@ -0,0 +1,134 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DOMImplementationImpl_createDocumentType_String_String_String_3 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DOMImplementationImpl_createDocumentType_String_String_String_3() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logErrPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + Document d = (Document)tobj; + if (d != null) + { + DOMImplementationImpl di = (DOMImplementationImpl)d.getImplementation(); + if (di == null) { + TestLoader.logErrPrint("Document DomImplementation is NULL.."); + return BWBaseTest.FAILED; + } else { + try { + String qualifiedName = "edi:price"; + String publicId = "pID"; + String systemId = null; + DocumentType dt = di.createDocumentType(qualifiedName, publicId, systemId); + if (dt == null) { + System.out.println("DomImplementation 'createDocumentType(...) returned null ..."); + return BWBaseTest.FAILED; + } else { + System.out.println("DomImplementation 'createDocumentType(...)' didn't throw exception "); + return BWBaseTest.FAILED; + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException was thrown: "+de); + return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception was thrown: "+e); + return BWBaseTest.PASSED; + } + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_4.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_4.java new file mode 100644 index 00000000000..e928d8f018e --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocumentType_String_String_String_4.java @@ -0,0 +1,134 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DOMImplementationImpl_createDocumentType_String_String_String_4 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DOMImplementationImpl_createDocumentType_String_String_String_4() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logErrPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + Document d = (Document)tobj; + if (d != null) + { + DOMImplementationImpl di = (DOMImplementationImpl)d.getImplementation(); + if (di == null) { + TestLoader.logErrPrint("Document DomImplementation is NULL.."); + return BWBaseTest.FAILED; + } else { + try { + String qualifiedName = null; + String publicId = null; + String systemId = null; + DocumentType dt = di.createDocumentType(qualifiedName, publicId, systemId); + if (dt == null) { + System.out.println("DomImplementation 'createDocumentType(...) returned null ..."); + return BWBaseTest.FAILED; + } else { + System.out.println("DomImplementation 'createDocumentType(...)' didn't throw exception "); + return BWBaseTest.FAILED; + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException was thrown: "+de); + return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception was thrown: "+e); + return BWBaseTest.PASSED; + } + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_0.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_0.java index d55313ba527..3ae90e21a49 100644 --- a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_0.java +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_0.java @@ -75,7 +75,6 @@ public class DOMImplementationImpl_createDocument_String_String_DocumentType_0 e String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); Document d = (Document)tobj; @@ -87,29 +86,31 @@ public class DOMImplementationImpl_createDocument_String_String_DocumentType_0 e return BWBaseTest.FAILED; } else { try { - if (di.createDocument(null, null, null) == null) { - System.out.println("DomImplementation 'createDocument' according to specs. is not supported..."); + DocumentType dt = di.createDocumentType("edi:price", "pID", "sID"); + if (dt == null) { + TestLoader.logErrPrint("DocumentType is NULL.."); + return BWBaseTest.FAILED; + } + String namespaceURI = "edi='http://ecommerce.org/schema'"; + String qualifiedName = "edi:price"; + if (di.createDocument(namespaceURI, qualifiedName, dt) == null) { + System.out.println("DomImplementation 'createDocument' returns null ..."); + TestLoader.logErrPrint("DomImplementation 'createDocument' returns null ..."); return BWBaseTest.FAILED; - - } else { - System.out.println("DomImplementation 'createDocument' according to specs is not supported..."); - } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD "; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException e) { - String msg = "DOMException : " + e; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException : " + de); + return BWBaseTest.FAILED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.FAILED; + } } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } - - return BWBaseTest.PASSED; + return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_1.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_1.java new file mode 100644 index 00000000000..f5dee50b0eb --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_1.java @@ -0,0 +1,131 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DOMImplementationImpl_createDocument_String_String_DocumentType_1 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DOMImplementationImpl_createDocument_String_String_DocumentType_1() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logErrPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + Document d = (Document)tobj; + if (d != null) + { + DOMImplementationImpl di = (DOMImplementationImpl)d.getImplementation(); + if (di == null) { + TestLoader.logErrPrint("Document DomImplementation is NULL.."); + return BWBaseTest.FAILED; + } else { + try { + String namespaceURI = "edi='http://ecommerce.org/schema'"; + String qualifiedName = "edi:price"; + if (di.createDocument(namespaceURI, qualifiedName, null) == null) { + System.out.println("DomImplementation 'createDocument' returns null ..."); + TestLoader.logErrPrint("DomImplementation 'createDocument' returns null ..."); + return BWBaseTest.FAILED; + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException : " + de); + return BWBaseTest.FAILED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.FAILED; + } + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + return BWBaseTest.PASSED; + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_2.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_2.java new file mode 100644 index 00000000000..09bd0b7495d --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_2.java @@ -0,0 +1,138 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DOMImplementationImpl_createDocument_String_String_DocumentType_2 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DOMImplementationImpl_createDocument_String_String_DocumentType_2() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logErrPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + Document d = (Document)tobj; + if (d != null) + { + DOMImplementationImpl di = (DOMImplementationImpl)d.getImplementation(); + if (di == null) { + TestLoader.logErrPrint("Document DomImplementation is NULL.."); + return BWBaseTest.FAILED; + } else { + try { + DocumentType dt = di.createDocumentType("edi:price", "publicID", "systemID"); + if (dt == null) { + TestLoader.logErrPrint("DocumentType is NULL.."); + return BWBaseTest.FAILED; + } + String namespaceURI = "edi='http://ecommerce.org/schema'"; + String qualifiedName = "edi:price"; + if (di.createDocument(namespaceURI, null, dt) == null) { + System.out.println("DomImplementation 'createDocument' returns null ..."); + TestLoader.logErrPrint("DomImplementation 'createDocument' returns null ..."); + return BWBaseTest.FAILED; + } else { + TestLoader.logErrPrint("createDocumetn didn't throw exception ..."); + return BWBaseTest.FAILED; + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException : " + de); + return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.PASSED; + } + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_3.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_3.java new file mode 100644 index 00000000000..80d3c161c19 --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_3.java @@ -0,0 +1,137 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DOMImplementationImpl_createDocument_String_String_DocumentType_3 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DOMImplementationImpl_createDocument_String_String_DocumentType_3() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logErrPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + Document d = (Document)tobj; + if (d != null) + { + DOMImplementationImpl di = (DOMImplementationImpl)d.getImplementation(); + if (di == null) { + TestLoader.logErrPrint("Document DomImplementation is NULL.."); + return BWBaseTest.FAILED; + } else { + try { + DocumentType dt = di.createDocumentType("edi:price", "publicID", "systemID"); + if (dt == null) { + TestLoader.logErrPrint("DocumentType is NULL.."); + return BWBaseTest.FAILED; + } + String namespaceURI = "edi='http://ecommerce.org/schema'"; + String qualifiedName = "edi:price"; + if (di.createDocument(null, qualifiedName, dt) == null) { + System.out.println("DomImplementation 'createDocument' returns null ..."); + TestLoader.logErrPrint("DomImplementation 'createDocument' returns null ..."); + return BWBaseTest.FAILED; + } else { + TestLoader.logErrPrint("createDocumetn didn't throw exception ..."); + return BWBaseTest.FAILED; + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException : " + de); + return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.PASSED; + } + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_4.java b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_4.java new file mode 100644 index 00000000000..1385de6a6ee --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DOMImplementationImpl_createDocument_String_String_DocumentType_4.java @@ -0,0 +1,139 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DOMImplementationImpl_createDocument_String_String_DocumentType_4 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DOMImplementationImpl_createDocument_String_String_DocumentType_4() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logErrPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + Document d = (Document)tobj; + if (d != null) + { + DOMImplementationImpl di = (DOMImplementationImpl)d.getImplementation(); + if (di == null) { + TestLoader.logErrPrint("Document DomImplementation is NULL.."); + return BWBaseTest.FAILED; + } else { + try { + DocumentType dt = di.createDocumentType("edi:price", "publicID", "systemID"); + if (dt == null) { + TestLoader.logErrPrint("DocumentType is NULL.."); + return BWBaseTest.FAILED; + } + String namespaceURI = "edi='http://ecommerce.org/schema'"; + String qualifiedName = "edi:price"; + if (di.createDocument(null, null, null) == null) { + System.out.println("DomImplementation 'createDocument' returns null ..."); + TestLoader.logErrPrint("DomImplementation 'createDocument' returns null ..."); + return BWBaseTest.FAILED; + } else { + System.out.println("DomImplementation 'createDocument' doesn't throw exception ..."); + return BWBaseTest.FAILED; + } + } catch (DOMException de) { + TestLoader.logErrPrint("DOMException : " + de); + return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.PASSED; + } + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_0.java b/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_0.java index 7ff46e1316b..2fef389fbad 100755 --- a/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_0.java +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_0.java @@ -76,7 +76,7 @@ public class DocumentImpl_createEvent_String_0 extends BWBaseTest implements Exe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + DocumentImpl d = (DocumentImpl)tobj; @@ -85,18 +85,14 @@ public class DocumentImpl_createEvent_String_0 extends BWBaseTest implements Exe try { String s = null; Event e = d.createEvent(s); - TestLoader.logErrPrint("DocumentEvent is not a supported method..."); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD "; - TestLoader.logErrPrint(msg); + } catch (Exception e) { return BWBaseTest.PASSED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } - + return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_1.java b/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_1.java index dc06de7c09e..ecb642e0424 100755 --- a/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_1.java +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_1.java @@ -76,7 +76,7 @@ public class DocumentImpl_createEvent_String_1 extends BWBaseTest implements Exe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + DocumentImpl d = (DocumentImpl)tobj; diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_2.java b/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_2.java new file mode 100644 index 00000000000..49c88e5a23b --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_createEvent_String_2.java @@ -0,0 +1,118 @@ + +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; +import org.w3c.dom.events.*; + +public class DocumentImpl_createEvent_String_2 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DocumentImpl_createEvent_String_2() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + + DocumentImpl d = (DocumentImpl)tobj; + if (d != null) + { + try { + String s = "SomeIncorrectEventType"; + Event e = d.createEvent(s); + return BWBaseTest.FAILED; + } catch (Exception e) { + return BWBaseTest.PASSED; + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_0.java b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_0.java index dbd3c3bcfd3..dcc8df43b7f 100755 --- a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_0.java +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_0.java @@ -74,27 +74,29 @@ public class DocumentImpl_getElementById_String_0 extends BWBaseTest implements String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + DocumentImpl d = (DocumentImpl)tobj; if (d != null) { try { - Element e = d.getElementById(null); - TestLoader.logErrPrint("Document 'getElementById'is an unsupported method"); - return BWBaseTest.FAILED; + String id = "body_tag_id"; + Element e = d.getElementById(id); + if (e == null) { + TestLoader.logErrPrint("Document 'getElementById'is retuned null "); + return BWBaseTest.FAILED; + } - } catch ( UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.FAILED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } - + return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_1.java b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_1.java index 82118391afd..e96a585a591 100755 --- a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_1.java +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_1.java @@ -74,20 +74,19 @@ public class DocumentImpl_getElementById_String_1 extends BWBaseTest implements String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + DocumentImpl d = (DocumentImpl)tobj; if (d != null) { try { - Element e = d.getElementById(null); - TestLoader.logErrPrint("Document 'getElementsById'is an unsupported method"); + Element e = d.getElementById("nonexistent_id"); + TestLoader.logErrPrint("Document 'getElementsById(nonexistent_id)' didn't throw exception"); return BWBaseTest.FAILED; - } catch ( UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); return BWBaseTest.PASSED; } } else { diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_2.java b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_2.java new file mode 100644 index 00000000000..3ecdf56420c --- /dev/null +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementById_String_2.java @@ -0,0 +1,119 @@ +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class DocumentImpl_getElementById_String_2 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public DocumentImpl_getElementById_String_2() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + + DocumentImpl d = (DocumentImpl)tobj; + if (d != null) + { + try { + Element e = d.getElementById(null); + TestLoader.logErrPrint("Document 'getElementsById(null)' didn't throw exception"); + return BWBaseTest.FAILED; + + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.PASSED; + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_0.java b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_0.java index fb9a3c3c86e..29b07ddf514 100755 --- a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_0.java @@ -74,28 +74,30 @@ public class DocumentImpl_getElementsByTagNameNS_String_String_0 extends BWBaseT String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { try { - String nuri = null; - String qname = null; + String nuri = "xmlns:edi='http://ecommerce/schema'"; + String qname = "body"; NodeList dt = d.getElementsByTagNameNS(nuri, qname); - TestLoader.logErrPrint("Document 'getElementsByTagNameNS' is not a supported method... "); - return BWBaseTest.FAILED; + if (dt == null) { + TestLoader.logErrPrint("Document 'getElementsByTagNameNS' returned null "); + return BWBaseTest.FAILED; + } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + } catch (Exception e) { + TestLoader.logErrPrint("Exception: " + e); + return BWBaseTest.FAILED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_1.java b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_1.java index 1c7f983a8fc..ff501796dcb 100755 --- a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_1.java +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_1.java @@ -74,7 +74,7 @@ public class DocumentImpl_getElementsByTagNameNS_String_String_1 extends BWBaseT String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -82,14 +82,11 @@ public class DocumentImpl_getElementsByTagNameNS_String_String_1 extends BWBaseT { try { String nuri = null; - String qname = "xml"; + String qname = "body"; NodeList dt = d.getElementsByTagNameNS(nuri, qname); - TestLoader.logErrPrint("Document 'getElementsByTagNameNS' is not a supported method... "); return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); + } catch (Exception e) { return BWBaseTest.PASSED; } } else { diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_2.java b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_2.java index 2e422c1e250..96887f42c10 100755 --- a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_2.java +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_2.java @@ -74,22 +74,20 @@ public class DocumentImpl_getElementsByTagNameNS_String_String_2 extends BWBaseT String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { try { - String nuri = ""; + String nuri = "xmlns:edi='http://ec/schema'"; String qname = null; NodeList dt = d.getElementsByTagNameNS(nuri, qname); - TestLoader.logErrPrint("Document 'getElementsByTagNameNS' is not a supported method... "); + TestLoader.logErrPrint("Document 'getElementsByTagNameNS' didn't throw exception ... "); return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); + } catch (Exception ue) { return BWBaseTest.PASSED; } } else { diff --git a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_3.java b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_3.java index e432133874f..3c3c06b12c0 100755 --- a/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_3.java +++ b/mozilla/java/dom/tests/src/api/DocumentImpl_getElementsByTagNameNS_String_String_3.java @@ -74,22 +74,20 @@ public class DocumentImpl_getElementsByTagNameNS_String_String_3 extends BWBaseT String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { try { - String nuri = "xmlns:edi='http://ecommerce.org/schema'"; - String qname = "xml"; + String nuri = null; + String qname = null; NodeList dt = d.getElementsByTagNameNS(nuri, qname); - TestLoader.logErrPrint("Document 'getElementsByTagNameNS' is not a supported method... "); + TestLoader.logErrPrint("Document 'getElementsByTagNameNS' didn't thrpw exception "); return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); + } catch (Exception e) { return BWBaseTest.PASSED; } } else { diff --git a/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getInternalSubset.java b/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getInternalSubset.java index 9f18919b76d..7137960e78b 100755 --- a/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getInternalSubset.java +++ b/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getInternalSubset.java @@ -74,7 +74,7 @@ public class DocumentTypeImpl_getInternalSubset extends BWBaseTest implements Ex String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -85,17 +85,14 @@ public class DocumentTypeImpl_getInternalSubset extends BWBaseTest implements Ex if (dt == null) { TestLoader.logErrPrint("Document Type is NULL.."); return BWBaseTest.FAILED; - } else { - String s = dt.getInternalSubset(); - TestLoader.logErrPrint("DocumentType 'getInternalSubset' according to specs should currently not have been supported..."); - return BWBaseTest.FAILED; - } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD "; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } + String s = dt.getInternalSubset(); + if (s == null) { + TestLoader.logErrPrint("DocumentType 'getInternalSubset' return null..."); + return BWBaseTest.FAILED; + } + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.FAILED; } @@ -103,6 +100,8 @@ public class DocumentTypeImpl_getInternalSubset extends BWBaseTest implements Ex System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; + } /** diff --git a/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getPublicId.java b/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getPublicId.java index c612a31852f..33aef823921 100755 --- a/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getPublicId.java +++ b/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getPublicId.java @@ -74,7 +74,7 @@ public class DocumentTypeImpl_getPublicId extends BWBaseTest implements Executio String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -85,17 +85,14 @@ public class DocumentTypeImpl_getPublicId extends BWBaseTest implements Executio if (dt == null) { TestLoader.logErrPrint("Document Type is NULL.."); return BWBaseTest.FAILED; - } else { - String s = dt.getPublicId(); - TestLoader.logErrPrint("DocumentType 'getPublicId' according to specs should currently not have been supported..."); - return BWBaseTest.FAILED; - } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD "; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } + String s = dt.getPublicId(); + if (s == null) { + TestLoader.logErrPrint("DocumentType 'getPublicId' return null..."); + return BWBaseTest.FAILED; + } + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.FAILED; } @@ -103,6 +100,7 @@ public class DocumentTypeImpl_getPublicId extends BWBaseTest implements Executio System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getSystemId.java b/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getSystemId.java index a72312b89ce..ddb6b025048 100755 --- a/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getSystemId.java +++ b/mozilla/java/dom/tests/src/api/DocumentTypeImpl_getSystemId.java @@ -74,7 +74,7 @@ public class DocumentTypeImpl_getSystemId extends BWBaseTest implements Executio String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -85,17 +85,14 @@ public class DocumentTypeImpl_getSystemId extends BWBaseTest implements Executio if (dt == null) { TestLoader.logErrPrint("Document Type is NULL.."); return BWBaseTest.FAILED; - } else { - String s = dt.getSystemId(); - TestLoader.logErrPrint("DocumentType 'getSystemId' according to specs should currently not have been supported..."); - return BWBaseTest.FAILED; - } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD "; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } + String s = dt.getSystemId(); + if (s == null) { + TestLoader.logErrPrint("DocumentType 'getSystemId' return null..."); + return BWBaseTest.FAILED; + } + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.FAILED; } @@ -103,6 +100,8 @@ public class DocumentTypeImpl_getSystemId extends BWBaseTest implements Executio System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; + } /** diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_0.java b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_0.java index c0c3a0bb8a7..f369a666e42 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_0.java @@ -74,7 +74,7 @@ public class ElementImpl_getAttributeNS_String_String_0 extends BWBaseTest imple String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -86,29 +86,26 @@ public class ElementImpl_getAttributeNS_String_String_0 extends BWBaseTest imple TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; } else { - String nuri = null; - String lname = null; + String nuri = "xmlns:edi='http://ecommerce.com/schema'"; + String lname = "dummyattr"; + String val = "1"; + e.setAttributeNS(nuri, lname, val); String s = e.getAttributeNS(nuri, lname); - TestLoader.logErrPrint("Element 'getAttributeNS' is not a supported method... "); - return BWBaseTest.FAILED; + if (s == null || !s.equals(val)) { + TestLoader.logErrPrint("Element 'getAttributeNS' returned incorrect value: "+s+" != "+val); + return BWBaseTest.FAILED; + } } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; + } catch (Exception e) { + String msg = "Exception: " + e; TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } + return BWBaseTest.FAILED; + } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_1.java b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_1.java index b4e8474d768..d393673a4cc 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_1.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_1.java @@ -74,7 +74,7 @@ public class ElementImpl_getAttributeNS_String_String_1 extends BWBaseTest imple String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_getAttributeNS_String_String_1 extends BWBaseTest imple String nuri = null; String lname = "dummyattr"; String s = e.getAttributeNS(nuri, lname); - TestLoader.logErrPrint("Element 'getAttributeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getAttributeNS' didn't throw exception"); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception e) { + String msg = "Exception " + e; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_2.java b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_2.java index e4158568b9b..bd61b1a69ac 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_2.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_2.java @@ -74,7 +74,7 @@ public class ElementImpl_getAttributeNS_String_String_2 extends BWBaseTest imple String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -86,22 +86,14 @@ public class ElementImpl_getAttributeNS_String_String_2 extends BWBaseTest imple TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; } else { - String nuri = ""; + String nuri = "xmlns:edi='http://ec.com/schema'"; String lname = null; String s = e.getAttributeNS(nuri, lname); - TestLoader.logErrPrint("Element 'getAttributeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getAttributeNS' didn't throw exception "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_3.java b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_3.java index 12d212317c7..91cce8f5eca 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_3.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNS_String_String_3.java @@ -74,7 +74,7 @@ public class ElementImpl_getAttributeNS_String_String_3 extends BWBaseTest imple String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -86,22 +86,14 @@ public class ElementImpl_getAttributeNS_String_String_3 extends BWBaseTest imple TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; } else { - String nuri = "xmlns:edi='http://ecommerce.org/schema'"; - String lname = "dummyattr"; + String nuri = null; + String lname = null; String s = e.getAttributeNS(nuri, lname); - TestLoader.logErrPrint("Element 'getAttributeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getAttributeNS' didn't throw exception"); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_0.java b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_0.java index e8058062d23..466d50eab75 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_0.java @@ -74,7 +74,7 @@ public class ElementImpl_getAttributeNodeNS_String_String_0 extends BWBaseTest i String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_getAttributeNodeNS_String_String_0 extends BWBaseTest i String nuri = null; String lname = null; Node n = e.getAttributeNodeNS(nuri, lname); - TestLoader.logErrPrint("Element 'getAttributeNodeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getAttributeNodeNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_1.java b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_1.java index 0cfd924165a..cad1e560e27 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_1.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_1.java @@ -74,7 +74,7 @@ public class ElementImpl_getAttributeNodeNS_String_String_1 extends BWBaseTest i String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_getAttributeNodeNS_String_String_1 extends BWBaseTest i String nuri = null; String lname = "dummyattr"; Node n = e.getAttributeNodeNS(nuri, lname); - TestLoader.logErrPrint("Element 'getAttributeNodeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getAttributeNodeNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_2.java b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_2.java index 316c5553023..88fa6b47ce7 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_2.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_2.java @@ -74,7 +74,7 @@ public class ElementImpl_getAttributeNodeNS_String_String_2 extends BWBaseTest i String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_getAttributeNodeNS_String_String_2 extends BWBaseTest i String nuri = ""; String lname = null; Node n = e.getAttributeNodeNS(nuri, lname); - TestLoader.logErrPrint("Element 'getAttributeNodeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getAttributeNodeNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_3.java b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_3.java index 288ae0a63f8..a281da2fa6e 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_3.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getAttributeNodeNS_String_String_3.java @@ -74,7 +74,7 @@ public class ElementImpl_getAttributeNodeNS_String_String_3 extends BWBaseTest i String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -88,27 +88,24 @@ public class ElementImpl_getAttributeNodeNS_String_String_3 extends BWBaseTest i } else { String nuri = "xmlns:edi='http://ecommerce.org/schema'"; String lname = "dummyattr"; + String val = "1"; + e.setAttributeNS(nuri, lname, val); Node n = e.getAttributeNodeNS(nuri, lname); - TestLoader.logErrPrint("Element 'getAttributeNS' is not a supported method... "); - return BWBaseTest.FAILED; + if (n == null || n.getNodeType() != Node.ATTRIBUTE_NODE || !((Attr)n).getValue().equals(val)) { + TestLoader.logErrPrint("Element 'getAttributeNS' returned incorrect value "); + return BWBaseTest.FAILED; + } } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + return BWBaseTest.FAILED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_0.java b/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_0.java index 0efd5226296..9c3b813d434 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_0.java @@ -74,7 +74,7 @@ public class ElementImpl_getElementsByTagNameNS_String_String_0 extends BWBaseTe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_getElementsByTagNameNS_String_String_0 extends BWBaseTe String nuri = null; String lname = null; NodeList nl = e.getElementsByTagNameNS(nuri, lname); - TestLoader.logErrPrint("Element 'getElementsByTagNameNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getElementsByTagNameNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_1.java b/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_1.java index 0522705381e..8b9435c8712 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_1.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_1.java @@ -74,7 +74,7 @@ public class ElementImpl_getElementsByTagNameNS_String_String_1 extends BWBaseTe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_getElementsByTagNameNS_String_String_1 extends BWBaseTe String nuri = null; String lname = "dummyattr"; NodeList nl = e.getElementsByTagNameNS(nuri, lname); - TestLoader.logErrPrint("Element 'getElementsByTagNameNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getElementsByTagNameNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_2.java b/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_2.java index a7e4adce41b..487d2ae1508 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_2.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_2.java @@ -74,7 +74,7 @@ public class ElementImpl_getElementsByTagNameNS_String_String_2 extends BWBaseTe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_getElementsByTagNameNS_String_String_2 extends BWBaseTe String nuri = ""; String lname = null; NodeList nl = e.getElementsByTagNameNS(nuri, lname); - TestLoader.logErrPrint("Element 'getElementsByTagNameNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'getElementsByTagNameNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_3.java b/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_3.java index b5de4a6096e..b36e12e4f02 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_3.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_getElementsByTagNameNS_String_String_3.java @@ -74,7 +74,7 @@ public class ElementImpl_getElementsByTagNameNS_String_String_3 extends BWBaseTe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -87,29 +87,24 @@ public class ElementImpl_getElementsByTagNameNS_String_String_3 extends BWBaseTe return BWBaseTest.FAILED; } else { String nuri = "xmlns:edi='http://ecommerce.org/schema'"; - String lname = "dummyattr"; + String lname = "body"; NodeList nl = e.getElementsByTagNameNS(nuri, lname); - TestLoader.logErrPrint("Element 'getElementsByTagNameNS' is not a supported method... "); - return BWBaseTest.FAILED; + if (nl == null) { + TestLoader.logErrPrint("Element 'getElementsByTagNameNS' returned incorrect value "); + return BWBaseTest.FAILED; + } } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + return BWBaseTest.FAILED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } /** @@ -133,3 +128,4 @@ public class ElementImpl_getElementsByTagNameNS_String_String_3 extends BWBaseTe else {} } } + \ No newline at end of file diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_0.java b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_0.java index ba1b96dcfbd..f6227166e3b 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_0.java @@ -74,7 +74,7 @@ public class ElementImpl_hasAttributeNS_String_String_0 extends BWBaseTest imple String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) @@ -84,18 +84,12 @@ public class ElementImpl_hasAttributeNS_String_String_0 extends BWBaseTest imple if (e == null) { TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; - } else { - try { - if (e.hasAttributeNS(null, null)) ; - TestLoader.logErrPrint("Element 'hasAttributeNS is not a supported method. Should not return any value... "); + } + if (e.hasAttributeNS(null, null)) ; + TestLoader.logErrPrint("Element 'hasAttributeNS didn't throw exception... "); return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_1.java b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_1.java index 4dd33100be8..cb1404c9505 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_1.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_1.java @@ -74,7 +74,7 @@ public class ElementImpl_hasAttributeNS_String_String_1 extends BWBaseTest imple String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) @@ -84,18 +84,12 @@ public class ElementImpl_hasAttributeNS_String_String_1 extends BWBaseTest imple if (e == null) { TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; - } else { - try { + } if (e.hasAttributeNS("dummy", null)); - TestLoader.logErrPrint("Element 'hasAttributeNS is not a supported method. Should not return any value... "); + TestLoader.logErrPrint("Element 'hasAttributeNS didn't throw exception... "); return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_2.java b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_2.java index 641d39c4090..d6b4d10126e 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_2.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_2.java @@ -74,7 +74,7 @@ public class ElementImpl_hasAttributeNS_String_String_2 extends BWBaseTest imple String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) @@ -84,18 +84,12 @@ public class ElementImpl_hasAttributeNS_String_String_2 extends BWBaseTest imple if (e == null) { TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; - } else { - try { - if (e.hasAttributeNS(null, "dummy")); - TestLoader.logErrPrint("Element 'hasAttributeNS is not a supported method. Should not return any value... "); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } } - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + if (e.hasAttributeNS(null, "dummy")); + TestLoader.logErrPrint("Element 'hasAttributeNS didn't throw exception... "); + return BWBaseTest.FAILED; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_3.java b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_3.java index 4525be55ffd..4fb983ef768 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_3.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttributeNS_String_String_3.java @@ -74,7 +74,7 @@ public class ElementImpl_hasAttributeNS_String_String_3 extends BWBaseTest imple String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) @@ -84,25 +84,25 @@ public class ElementImpl_hasAttributeNS_String_String_3 extends BWBaseTest imple if (e == null) { TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; - } else { - try { - if (e.hasAttributeNS("dummy", "dummy")); - TestLoader.logErrPrint("Element 'hasAttributeNS is not a supported method. Should not return any value... "); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } } - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + String nsuri = "xmlns:edi='http://ec.com/schema'"; + String lname = "dummyattr"; + String val = "1"; + e.setAttributeNS(nsuri, lname, val); + if (e.hasAttributeNS(nsuri, val) == false) { + TestLoader.logErrPrint("Element 'hasAttributeNS returned incorrect value... "); + return BWBaseTest.FAILED; + } + } catch (Exception r) { + String msg = "hasAttributeNS: Caught Exception " + r ; TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + return BWBaseTest.FAILED; } } else { - System.out.println("Document is NULL.."); + System.out.println("hasAttributeNS: Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_0.java b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_0.java index b46d0b2a7f5..e843471d99c 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_0.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_0.java @@ -74,7 +74,7 @@ public class ElementImpl_hasAttribute_String_0 extends BWBaseTest implements Exe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) @@ -85,18 +85,12 @@ public class ElementImpl_hasAttribute_String_0 extends BWBaseTest implements Exe TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; } else { - try { - if (e.hasAttribute(null)); - TestLoader.logErrPrint("Element 'hasAttribute(null) is not a supported method. Should not return any value... "); + e.hasAttribute(null); + TestLoader.logErrPrint("Element 'hasAttribute(null) didn't throw exception... "); return BWBaseTest.FAILED; - - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_1.java b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_1.java index 6e508218f1b..8993aec2663 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_1.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_1.java @@ -74,7 +74,7 @@ public class ElementImpl_hasAttribute_String_1 extends BWBaseTest implements Exe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) @@ -84,25 +84,21 @@ public class ElementImpl_hasAttribute_String_1 extends BWBaseTest implements Exe if (e == null) { TestLoader.logErrPrint("Document Element is NULL.."); return BWBaseTest.FAILED; - } else { - try { - if (e.hasAttribute("name")); - TestLoader.logErrPrint("Element 'hasAttribute(null) is not a supported method. Should not return any value... "); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } + if (e.hasAttribute("nonexistent_attribute") == true) { + TestLoader.logErrPrint("Element 'hasAttribute returned incorrect value ... "); + return BWBaseTest.FAILED; + } + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + return BWBaseTest.FAILED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_2.java b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_2.java new file mode 100644 index 00000000000..7fd06bc14fd --- /dev/null +++ b/mozilla/java/dom/tests/src/api/ElementImpl_hasAttribute_String_2.java @@ -0,0 +1,129 @@ +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class ElementImpl_hasAttribute_String_2 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public ElementImpl_hasAttribute_String_2() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + Document d = (Document)tobj; + if (d != null) + { + try { + Element e = d.getDocumentElement(); + if (e == null) { + TestLoader.logErrPrint("Document Element is NULL.."); + return BWBaseTest.FAILED; + } + String attrname = "dummyattr"; + String val = "1"; + e.setAttribute(attrname, val); + if (e.hasAttribute(attrname) == false) { + TestLoader.logErrPrint("Element 'hasAttribute returned incorrect value ... "); + return BWBaseTest.FAILED; + } + } catch (Exception r) { + String msg = "Caught Exception " + r ; + TestLoader.logErrPrint(msg); + return BWBaseTest.FAILED; + } + } else { + System.out.println("Document is NULL.."); + return BWBaseTest.FAILED; + } + return BWBaseTest.PASSED; + + } + + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_0.java b/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_0.java index 0b4cc9e1cb1..b5368fbc264 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_0.java @@ -74,7 +74,7 @@ public class ElementImpl_removeAttributeNS_String_String_0 extends BWBaseTest im String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_removeAttributeNS_String_String_0 extends BWBaseTest im String nuri = null; String lname = null; e.removeAttributeNS(nuri, lname); - TestLoader.logErrPrint("Element 'removeAttributeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'removeAttributeNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_1.java b/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_1.java index d990628bad7..cdfb7a6bc76 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_1.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_1.java @@ -74,7 +74,7 @@ public class ElementImpl_removeAttributeNS_String_String_1 extends BWBaseTest im String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_removeAttributeNS_String_String_1 extends BWBaseTest im String nuri = null; String lname = "dummyattr"; e.removeAttributeNS(nuri, lname); - TestLoader.logErrPrint("Element 'removeAttributeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'removeAttributeNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_2.java b/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_2.java index 027ade31cfd..2c73c330cd3 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_2.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_2.java @@ -74,7 +74,7 @@ public class ElementImpl_removeAttributeNS_String_String_2 extends BWBaseTest im String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -89,19 +89,11 @@ public class ElementImpl_removeAttributeNS_String_String_2 extends BWBaseTest im String nuri = ""; String lname = null; e.removeAttributeNS(nuri, lname); - TestLoader.logErrPrint("Element 'removeAttributeNS' is not a supported method... "); + TestLoader.logErrPrint("Element 'removeAttributeNS' didn't throw exception... "); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_3.java b/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_3.java index a46b9ef706d..925bf761ad6 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_3.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_removeAttributeNS_String_String_3.java @@ -74,7 +74,7 @@ public class ElementImpl_removeAttributeNS_String_String_3 extends BWBaseTest im String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -88,27 +88,19 @@ public class ElementImpl_removeAttributeNS_String_String_3 extends BWBaseTest im } else { String nuri = "xmlns:edi='http://ecommerce.org/schema'"; String lname = "dummyattr"; + e.setAttributeNS(nuri, lname, "1"); e.removeAttributeNS(nuri, lname); - TestLoader.logErrPrint("Element 'removeAttributeNS' is not a supported method... "); - return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - String msg = "UNSUPPORTED METHOD"; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (DOMException de) { - String msg = "DOMException: " + de; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + return BWBaseTest.FAILED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_0.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_0.java index da4577481b8..a41717ad264 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_0.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_0 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_0 extends BWBaseTes String lname = null; String val = null; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } @@ -109,7 +103,6 @@ public class ElementImpl_setAttributeNS_String_String_String_0 extends BWBaseTes System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } - } /** diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_1.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_1.java index e77a9da15f8..dcf925ebaa8 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_1.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_1.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_1 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_1 extends BWBaseTes String lname = null; String val = "1"; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_2.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_2.java index 61542797ebb..91982fd441c 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_2.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_2.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_2 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_2 extends BWBaseTes String lname = "dummyattr"; String val = null; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_3.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_3.java index b072eea5e9d..9a126b14d3f 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_3.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_3.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_3 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_3 extends BWBaseTes String lname = "dummyattr"; String val = "1"; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_4.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_4.java index deb9ebbf069..37899838ff0 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_4.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_4.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_4 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_4 extends BWBaseTes String lname = "dummyattr"; String val = null; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_5.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_5.java index 19b68f94ed1..c404af55df8 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_5.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_5.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_5 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_5 extends BWBaseTes String lname = "dummyattr"; String val = "1"; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_6.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_6.java index dcbaf7ad95a..277d2ef573c 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_6.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_6.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_6 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_6 extends BWBaseTes String lname = null; String val = null; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_7.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_7.java index 2740aff5776..d7d598e0ff1 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_7.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_7.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_7 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_7 extends BWBaseTes String lname = null; String val = "1"; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_8.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_8.java index c28bdfadba2..78e1edc9d56 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_8.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_8.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_8 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,17 +91,11 @@ public class ElementImpl_setAttributeNS_String_String_String_8 extends BWBaseTes String lname = "dummyattr"; String val = null; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); + TestLoader.logErrPrint("setAttributeNS didn't throw exception ..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_9.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_9.java index 33f37eeffb7..442bfa33a4b 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_9.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNS_String_String_String_9.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNS_String_String_String_9 extends BWBaseTes String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -91,25 +91,22 @@ public class ElementImpl_setAttributeNS_String_String_String_9 extends BWBaseTes String lname = "dummyattr"; String val = "1"; e.setAttributeNS(nuri, lname, val); - TestLoader.logErrPrint("setAttributeNS is a unsupported method ..."); - return BWBaseTest.FAILED; + String s = e.getAttributeNS(nuri, lname); + if (s == null || !s.equals(val)) { + TestLoader.logErrPrint("'setAttributeNS' didn't set attribute correctly"); + return BWBaseTest.FAILED; + } } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + return BWBaseTest.FAILED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } - + return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNodeNS_Attr_0.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNodeNS_Attr_0.java index eee54dee25d..de245d8c567 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNodeNS_Attr_0.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNodeNS_Attr_0.java @@ -75,7 +75,7 @@ public class ElementImpl_setAttributeNodeNS_Attr_0 extends BWBaseTest implements String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; @@ -88,17 +88,11 @@ public class ElementImpl_setAttributeNodeNS_Attr_0 extends BWBaseTest implements return BWBaseTest.FAILED; } else { Attr anode = e.setAttributeNodeNS(null); - TestLoader.logErrPrint("Document setAttributeNodeNS is an unsupported method..."); + TestLoader.logErrPrint("Document setAttributeNodeNS didn't throw exception..."); return BWBaseTest.FAILED; } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD "); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNodeNS_Attr_1.java b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNodeNS_Attr_1.java index 4a0780fc1c4..6d6bc7062ac 100755 --- a/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNodeNS_Attr_1.java +++ b/mozilla/java/dom/tests/src/api/ElementImpl_setAttributeNodeNS_Attr_1.java @@ -75,45 +75,40 @@ public class ElementImpl_setAttributeNodeNS_Attr_1 extends BWBaseTest implements String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { try { - - Attr a = d.createAttribute("dummyattr_5"); - if (a == null) { - TestLoader.logErrPrint("Document createAttribute FAILED... "); - return BWBaseTest.FAILED; - } - - //Element e = d.getDocumentElement(); - Element e = d.createElement("BODY"); - if (e == null) { - TestLoader.logErrPrint("Document Element is NULL.."); - return BWBaseTest.FAILED; - } else { - Attr anode = e.setAttributeNodeNS(a); - TestLoader.logErrPrint("Document setAttributeNodeNS is an unsupported method..."); + Element e = d.getDocumentElement(); + String nuri = "xmlns:edi='http://ecommerce.org/schema'"; + String lname = "dummyattr"; + String val = "1"; + Attr a = d.createAttribute(lname); + a.setValue(val); + if (e == null || a == null) { + TestLoader.logErrPrint("Document Element is NULL or can't create new attribute.."); return BWBaseTest.FAILED; + } else { + e.setAttributeNodeNS(a); + Node n = e.getAttributeNodeNS(nuri, lname); + if (n == null || n.getNodeType() != Node.ATTRIBUTE_NODE || !((Attr)n).getValue().equals(val)) { + TestLoader.logErrPrint("Element 'getAttributeNS' returned incorrect value "); + return BWBaseTest.FAILED; + } } - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD "); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; + } catch (Exception r) { + String msg = "Caught Exception " + r ; TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; + return BWBaseTest.FAILED; } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_getLocalName.java b/mozilla/java/dom/tests/src/api/NodeImpl_getLocalName.java index 2e50b07760d..16eafe07c00 100755 --- a/mozilla/java/dom/tests/src/api/NodeImpl_getLocalName.java +++ b/mozilla/java/dom/tests/src/api/NodeImpl_getLocalName.java @@ -74,44 +74,30 @@ public class NodeImpl_getLocalName extends BWBaseTest implements Execution String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { - String elname = "SCRIPT"; - Element e = d.createElement(elname); - if (e == null) - { - TestLoader.logErrPrint("Could not create Element " + elname); - return BWBaseTest.FAILED; - } - - String nodename = "HEAD"; - NodeList nl = d.getElementsByTagName(nodename); - if (nl != null) - { - int len = nl.getLength(); - - Node n = nl.item(0); - try { - String str = n.getLocalName(); - TestLoader.logErrPrint("getLocalName is an unsupported method..."); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } else { - TestLoader.logErrPrint("Could not find Node " + nodename); - return BWBaseTest.FAILED; - } + String nsuri = "xmlns:edi='http://ec.com/schema'"; + String qname = "body"; + try { + Node e = d.createElement(qname); + String lname = ((Node)e).getLocalName(); + if (lname == null) { // || !lname.equals("body")) { + TestLoader.logPrint("getLocalName() returned incorrect value: "+lname); + return BWBaseTest.FAILED; + } + } catch (Exception e) { + TestLoader.logPrint("getLocalName(): Exception: "+e); + return BWBaseTest.FAILED; + } } else { - System.out.println("Document is NULL.."); + System.out.println("getLocalName(): Document is NULL.."); return BWBaseTest.FAILED; } - + return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_getNamespaceURI.java b/mozilla/java/dom/tests/src/api/NodeImpl_getNamespaceURI.java index d068dea9c1f..0c7d5a70af5 100755 --- a/mozilla/java/dom/tests/src/api/NodeImpl_getNamespaceURI.java +++ b/mozilla/java/dom/tests/src/api/NodeImpl_getNamespaceURI.java @@ -74,44 +74,31 @@ public class NodeImpl_getNamespaceURI extends BWBaseTest implements Execution String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { - String elname = "SCRIPT"; - Element e = d.createElement(elname); - if (e == null) - { - TestLoader.logErrPrint("Could not create Element " + elname); - return BWBaseTest.FAILED; - } - - String nodename = "HEAD"; - NodeList nl = d.getElementsByTagName(nodename); - if (nl != null) - { - int len = nl.getLength(); - - Node n = nl.item(0); - try { - String str = n.getNamespaceURI(); - TestLoader.logErrPrint("getNameSpaceURI is an unsupported method..."); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } else { - TestLoader.logErrPrint("Could not find Node " + nodename); - return BWBaseTest.FAILED; - } + String nsuri = "xmlns:edi='http://ec.com/schema'"; + String qname = "body"; + try { + Element e = d.createElement(qname); + String uri = ((Node)e).getNamespaceURI(); + if (uri == null) { // || !uri.equals(nsuri)) { + TestLoader.logPrint("getNamespaceURI() returned incorrect value: "+uri); + return BWBaseTest.FAILED; + } + } catch (Exception e) { + TestLoader.logPrint("Exception: "+e); + return BWBaseTest.FAILED; + } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_getPrefix_0.java b/mozilla/java/dom/tests/src/api/NodeImpl_getPrefix_0.java new file mode 100644 index 00000000000..9c3c2606cc2 --- /dev/null +++ b/mozilla/java/dom/tests/src/api/NodeImpl_getPrefix_0.java @@ -0,0 +1,124 @@ +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class NodeImpl_getPrefix_0 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public NodeImpl_getPrefix_0() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + + Document d = (Document)tobj; + if (d != null) + { + String nsuri = "xmlns:edi='http://ec.com/schema'"; + String qname = "body"; + try { + Node e = d.createElement(qname); + String prefix = ((Node)e).getPrefix(); + if (prefix != null && !prefix.equals("")) { + TestLoader.logPrint("getPrefix() returned incorrect value: "+prefix); + return BWBaseTest.FAILED; + } + } catch (Exception e) { + TestLoader.logPrint("getPrefix(): Exception: "+e); + return BWBaseTest.FAILED; + } + } else { + System.out.println("getPrefix(): Document is NULL.."); + return BWBaseTest.FAILED; + } + return BWBaseTest.PASSED; + + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_getPrefix_1.java b/mozilla/java/dom/tests/src/api/NodeImpl_getPrefix_1.java new file mode 100644 index 00000000000..53563c85a50 --- /dev/null +++ b/mozilla/java/dom/tests/src/api/NodeImpl_getPrefix_1.java @@ -0,0 +1,126 @@ +/* + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The Original Code is mozilla.org code. + + The Initial Developer of the Original Code is Sun Microsystems, + Inc. Portions created by Sun are + Copyright (C) 1999 Sun Microsystems, Inc. All + Rights Reserved. + + Contributor(s): +*/ + +package org.mozilla.dom.test; + +import java.util.*; +import java.io.*; +import org.mozilla.dom.test.*; +import org.mozilla.dom.*; +import org.w3c.dom.*; + +public class NodeImpl_getPrefix_1 extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public NodeImpl_getPrefix_1() + { + } + + + /** + * + *********************************************************** + * Starting point of application + * + * @param args Array of command line arguments + * + *********************************************************** + */ + public static void main(String[] args) + { + } + + /** + *********************************************************** + * + * Execute Method + * + * @param tobj Object reference (Node/Document/...) + * @return true or false depending on whether test passed or failed. + * + *********************************************************** + */ + public boolean execute(Object tobj) + { + if (tobj == null) { + TestLoader.logPrint("Object is NULL..."); + return BWBaseTest.FAILED; + } + + String os = System.getProperty("OS"); + osRoutine(os); + + + + Document d = (Document)tobj; + if (d != null) + { + String nsuri = "xmlns:edi='http://ec.com/schema'"; + String qname = "body"; + try { + Element e = d.createElement(qname); + e.setPrefix("edi"); + String prefix = ((Node)e).getPrefix(); + if (prefix == null || !prefix.equals("edi")) { + TestLoader.logPrint("getPrefix() returned incorrect value: "+prefix); + return BWBaseTest.FAILED; + } + } catch (Exception e) { + TestLoader.logPrint("getPrefix(): Exception: "+e); + return BWBaseTest.FAILED; + } + } else { + System.out.println("getPrefix(): Document is NULL.."); + return BWBaseTest.FAILED; + } + + return BWBaseTest.PASSED; + + } + + /** + * + *********************************************************** + * Routine where OS specific checks are made. + * + * @param os OS Name (SunOS/Linus/MacOS/...) + *********************************************************** + * + */ + private void osRoutine(String os) + { + if(os == null) return; + + os = os.trim(); + if(os.compareTo("SunOS") == 0) {} + else if(os.compareTo("Linux") == 0) {} + else if(os.compareTo("Windows") == 0) {} + else if(os.compareTo("MacOS") == 0) {} + else {} + } +} diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_setPrefix_String_0.java b/mozilla/java/dom/tests/src/api/NodeImpl_setPrefix_String_0.java index 6863fec3200..d1de9b4168e 100755 --- a/mozilla/java/dom/tests/src/api/NodeImpl_setPrefix_String_0.java +++ b/mozilla/java/dom/tests/src/api/NodeImpl_setPrefix_String_0.java @@ -75,42 +75,30 @@ public class NodeImpl_setPrefix_String_0 extends BWBaseTest implements Execution String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { - try { - String name = "nom"; - Attr a = d.createAttribute(name); - if (a == null) - { - TestLoader.logErrPrint("Could Not create Attribute " + name); - return BWBaseTest.FAILED; - } + String nsuri = "xmlns:edi='http://ec.com/schema'"; + String qname = "body"; + try { + Node e = d.createElement(qname); + ((Node)e).setPrefix(null); + TestLoader.logPrint("getPrefix() didn't throw exception"); + return BWBaseTest.FAILED; + + } catch (Exception e) { + TestLoader.logPrint("Exception: "+e); + return BWBaseTest.PASSED; + } - String newval = null; - a.setPrefix(newval); - TestLoader.logErrPrint("setPrefix is an unsupported method..."); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } - } /** diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_setPrefix_String_1.java b/mozilla/java/dom/tests/src/api/NodeImpl_setPrefix_String_1.java index fff5e40deb8..a771eb3f376 100755 --- a/mozilla/java/dom/tests/src/api/NodeImpl_setPrefix_String_1.java +++ b/mozilla/java/dom/tests/src/api/NodeImpl_setPrefix_String_1.java @@ -75,42 +75,32 @@ public class NodeImpl_setPrefix_String_1 extends BWBaseTest implements Execution String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { - try { - String name = "nom"; - Attr a = d.createAttribute(name); - if (a == null) - { - TestLoader.logErrPrint("Could Not create Attribute " + name); - return BWBaseTest.FAILED; - } - - String newval = "xml"; - a.setPrefix(newval); - TestLoader.logErrPrint("setPrefix is an unsupported method..."); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } catch (DOMException e) { - TestLoader.logErrPrint("Caught DOMException"); - return BWBaseTest.PASSED; - } catch (RuntimeException r) { - String msg = "Caught RuntimeException " + r ; - TestLoader.logErrPrint(msg); - return BWBaseTest.PASSED; - } + String nsuri = "xmlns:edi='http://ec.com/schema'"; + String qname = "body"; + String prefix = "edi"; + try { + Node e = d.createElement(qname); + ((Node)e).setPrefix(prefix); + if (!((Node)e).getPrefix().equals(prefix)) { + TestLoader.logPrint("getPrefix returned incorrect value"); + return BWBaseTest.FAILED; + } + } catch (Exception e) { + TestLoader.logPrint("Exception: "+e); + return BWBaseTest.FAILED; + } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } - + return BWBaseTest.PASSED; } /** diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_0.java b/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_0.java index 2539e4493c3..46fefc179be 100755 --- a/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_0.java +++ b/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_0.java @@ -74,41 +74,22 @@ public class NodeImpl_supports_String_String_0 extends BWBaseTest implements Exe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { - String elname = "SCRIPT"; - Element e = d.createElement(elname); - if (e == null) - { - TestLoader.logErrPrint("Could not create Element " + elname); - return BWBaseTest.FAILED; - } - - String nodename = "HEAD"; - NodeList nl = d.getElementsByTagName(nodename); - if (nl != null) - { - int len = nl.getLength(); - - Node n = nl.item(0); - try { + try { String feature = null; String ver = null; - if (n.supports(feature, ver)) {}; - TestLoader.logErrPrint("Node.supports is an unsupported method..."); + if (((Node)d).supports(feature, ver)) {}; + TestLoader.logErrPrint("Node.supports didn't throw exception..."); return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } else { - TestLoader.logErrPrint("Could not find Node " + nodename); - return BWBaseTest.FAILED; - } + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.PASSED; + } } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_1.java b/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_1.java index 8c94676176f..8f5be3bb4c6 100755 --- a/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_1.java +++ b/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_1.java @@ -74,41 +74,23 @@ public class NodeImpl_supports_String_String_1 extends BWBaseTest implements Exe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { - String elname = "SCRIPT"; - Element e = d.createElement(elname); - if (e == null) - { - TestLoader.logErrPrint("Could not create Element " + elname); - return BWBaseTest.FAILED; - } - - String nodename = "HEAD"; - NodeList nl = d.getElementsByTagName(nodename); - if (nl != null) - { - int len = nl.getLength(); - - Node n = nl.item(0); - try { + try { String feature = null; String ver = "2.0"; - if (n.supports(feature, ver)) {}; - TestLoader.logErrPrint("Node.supports is an unsupported method..."); + if (((Node)d).supports(feature, ver)) {}; + TestLoader.logErrPrint("Node.supports didn't throw exception..."); return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } else { - TestLoader.logErrPrint("Could not find Node " + nodename); - return BWBaseTest.FAILED; - } + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.PASSED; + } + } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_2.java b/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_2.java index f3441d67dfa..c7ce57eef0e 100755 --- a/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_2.java +++ b/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_2.java @@ -74,46 +74,29 @@ public class NodeImpl_supports_String_String_2 extends BWBaseTest implements Exe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { - String elname = "SCRIPT"; - Element e = d.createElement(elname); - if (e == null) - { - TestLoader.logErrPrint("Could not create Element " + elname); - return BWBaseTest.FAILED; - } - - String nodename = "HEAD"; - NodeList nl = d.getElementsByTagName(nodename); - if (nl != null) - { - int len = nl.getLength(); - - Node n = nl.item(0); - try { + try { String feature = "xml"; String ver = null; - if (n.supports(feature, ver)) {}; - TestLoader.logErrPrint("Node.supports is an unsupported method..."); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } else { - TestLoader.logErrPrint("Could not find Node " + nodename); - return BWBaseTest.FAILED; - } + if (((Node)d).supports(feature, ver) == false) { + TestLoader.logErrPrint("Node.supports returned incorrect value"); + return BWBaseTest.FAILED; + } + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.FAILED; + } + } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } - + return BWBaseTest.PASSED; } diff --git a/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_3.java b/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_3.java index 4e869b18236..fa71792a3f2 100755 --- a/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_3.java +++ b/mozilla/java/dom/tests/src/api/NodeImpl_supports_String_String_3.java @@ -74,46 +74,30 @@ public class NodeImpl_supports_String_String_3 extends BWBaseTest implements Exe String os = System.getProperty("OS"); osRoutine(os); - setUnsupported(); + Document d = (Document)tobj; if (d != null) { - String elname = "SCRIPT"; - Element e = d.createElement(elname); - if (e == null) - { - TestLoader.logErrPrint("Could not create Element " + elname); - return BWBaseTest.FAILED; - } - - String nodename = "HEAD"; - NodeList nl = d.getElementsByTagName(nodename); - if (nl != null) - { - int len = nl.getLength(); - - Node n = nl.item(0); - try { + try { String feature = "xml"; - String ver = "2.0"; - if (n.supports(feature, ver)) {}; - TestLoader.logErrPrint("Node.supports is an unsupported method..."); - return BWBaseTest.FAILED; - } catch (UnsupportedOperationException ue) { - TestLoader.logErrPrint("UNSUPPORTED METHOD"); - return BWBaseTest.PASSED; - } - } else { - TestLoader.logErrPrint("Could not find Node " + nodename); - return BWBaseTest.FAILED; - } + String ver = "1.0"; + if (((Node)d).supports(feature, ver) == false) { + TestLoader.logErrPrint("Node.supports returned incorrect value..."); + return BWBaseTest.FAILED; + } + } catch (Exception e) { + TestLoader.logErrPrint("Exception: "+e); + return BWBaseTest.FAILED; + } + } else { System.out.println("Document is NULL.."); return BWBaseTest.FAILED; } + return BWBaseTest.PASSED; }