/* * Runs the test case. */ void runTest() { Document doc; NodeList elementList; Element testAddr; Attr addrAttr; int nodeType; doc = (Document) baseT::load("hc_staff", false); elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); testAddr = (Element) elementList.item(0); addrAttr = testAddr.getAttributeNode(SA::construct_from_utf8("title")); nodeType = (int) addrAttr.getNodeType(); baseT::assertEquals(2, nodeType, __LINE__, __FILE__); }
/* * Runs the test case. */ void runTest() { Document doc; Attr newAttrNode; String attrValue; String attrName; int attrType; doc = (Document) baseT::load("staff", true); newAttrNode = doc.createAttribute(SA::construct_from_utf8("district")); attrValue = newAttrNode.getNodeValue(); baseT::assertEquals("", attrValue, __LINE__, __FILE__); attrName = newAttrNode.getNodeName(); baseT::assertEquals("district", attrName, __LINE__, __FILE__); attrType = (int) newAttrNode.getNodeType(); baseT::assertEquals(2, attrType, __LINE__, __FILE__); }