From 5b34c0a17810ac4f588ed18b444d6a2754ee5f7e Mon Sep 17 00:00:00 2001 From: "leila.garin%eng.sun.com" Date: Wed, 1 Sep 1999 22:55:58 +0000 Subject: [PATCH] New File git-svn-id: svn://10.0.0.236/trunk@45547 18797224-902f-48f8-a5cc-f745e15eee43 --- .../dom/tests/src/api/AttrImpl_getValue.java | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100755 mozilla/java/dom/tests/src/api/AttrImpl_getValue.java diff --git a/mozilla/java/dom/tests/src/api/AttrImpl_getValue.java b/mozilla/java/dom/tests/src/api/AttrImpl_getValue.java new file mode 100755 index 00000000000..85b4417706f --- /dev/null +++ b/mozilla/java/dom/tests/src/api/AttrImpl_getValue.java @@ -0,0 +1,116 @@ +/** + * + * @version 1.00 + * @author Raju Pallath + * + * TESTID + * + * Tests out the AttrImpl->getValue() method. + * + */ +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 AttrImpl_getValue extends BWBaseTest implements Execution +{ + + /** + * + *********************************************************** + * Constructor + *********************************************************** + * + */ + public AttrImpl_getValue() + { + } + + + /** + * + *********************************************************** + * 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) + { + Attr a = d.createAttribute("dummyattr_2"); + if (a == null) { + TestLoader.logErrPrint("Could not Create Attribute dummyattr_2.."); + return BWBaseTest.FAILED; + } else { + a.setValue("1"); + String str = a.getValue(); + if (str == null) { + TestLoader.logErrPrint("Attr 'getValue()' is NULL ..."); + return BWBaseTest.FAILED; + } + + if (str.compareTo("1") != 0) + { + TestLoader.logErrPrint("Attr 'getValue()' FAILED ..."); + 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 {} + } +}