/* * Runs the test case. */ void runTest() { Document doc; NodeList elementList; Element testAddr; Attr addrAttr; String attrName; 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")); attrName = addrAttr.getNodeName(); baseT::assertEquals("title", attrName, __LINE__, __FILE__); }
/* * Runs the test case. */ void runTest() { Document doc; NodeList elementList; Node testEmployee; NamedNodeMap attributes; Attr domesticAttr; String attrName; doc = (Document) baseT::load("staff", false); elementList = doc.getElementsByTagName(SA::construct_from_utf8("address")); testEmployee = elementList.item(1); attributes = testEmployee.getAttributes(); domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic")); attrName = domesticAttr.getNodeName(); baseT::assertEquals("domestic", attrName, __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__); }
/* * Runs the test case. */ void runTest() { Document doc; NodeList addressList; Node testNode; NamedNodeMap attributes; Attr streetAttr; String strong1; String strong2; doc = (Document) baseT::load("hc_staff", false); addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym")); testNode = addressList.item(1); attributes = testNode.getAttributes(); streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class")); strong1 = streetAttr.getNodeName(); strong2 = streetAttr.getName(); baseT::assertEquals("class", strong1, __LINE__, __FILE__); baseT::assertEquals("class", strong2, __LINE__, __FILE__); }