Home | History | Annotate | Download | only in dom
      1 
      2 /*
      3 This Java source file was generated by test-to-java.xsl
      4 and is a derived work from the source document.
      5 The source document contained the following notice:
      6 
      7 
      8 
      9 Copyright (c) 2001-2004 World Wide Web Consortium,
     10 (Massachusetts Institute of Technology, Institut National de
     11 Recherche en Informatique et en Automatique, Keio University).  All
     12 Rights Reserved.  This program is distributed under the W3C's Software
     13 Intellectual Property License.  This program is distributed in the
     14 hope that it will be useful, but WITHOUT ANY WARRANTY; without even
     15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     16 PURPOSE.
     17 
     18 See W3C License http://www.w3.org/Consortium/Legal/ for more details.
     19 
     20 
     21 */
     22 
     23 package tests.org.w3c.dom;
     24 
     25 import dalvik.annotation.TestTargetClass;
     26 
     27 import javax.xml.parsers.DocumentBuilder;
     28 
     29 import org.w3c.dom.Document;
     30 import org.w3c.dom.Element;
     31 import org.w3c.dom.NodeList;
     32 
     33 
     34 /**
     35  *       The method getAttributeNS retrieves an attribute value by local name and namespace URI.
     36  *       Using the getAttributeNodeNS, retreive and verify the value of the default
     37  *       attribute node.
     38  *
     39 * @author IBM
     40 * @author Neil Delima
     41 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
     42 * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
     43 */
     44 @TestTargetClass(Element.class)
     45 public final class ElementGetAttributeNS extends DOMTestCase {
     46 
     47     DOMDocumentBuilderFactory factory;
     48 
     49     DocumentBuilder builder;
     50 
     51     protected void setUp() throws Exception {
     52         super.setUp();
     53         try {
     54             factory = new DOMDocumentBuilderFactory(DOMDocumentBuilderFactory
     55                     .getConfiguration2());
     56             builder = factory.getBuilder();
     57         } catch (Exception e) {
     58             fail("Unexpected exception" + e.getMessage());
     59         }
     60     }
     61 
     62     protected void tearDown() throws Exception {
     63         factory = null;
     64         builder = null;
     65         super.tearDown();
     66     }
     67 
     68    /**
     69     * Runs the test case.
     70     * @throws Throwable Any uncaught exception causes test to fail
     71     */
     72 // Assumes validation.
     73 //    public void testGetAttributeNS() throws Throwable {
     74 //        Document doc;
     75 //        Element element;
     76 //        String attrValue;
     77 //        NodeList childList;
     78 //        String nullNS = null;
     79 //
     80 //        doc = (Document) load("staffNS", builder);
     81 //        childList = doc.getElementsByTagNameNS("http://www.nist.gov",
     82 //                "employee");
     83 //        element = (Element) childList.item(1);
     84 //        attrValue = element.getAttributeNS(nullNS, "defaultAttr");
     85 //        assertEquals("elementgetattributens02", "defaultVal", attrValue);
     86 //    }
     87 
     88 }
     89 
     90