use of org.w3c.dom.Attr in project robovm by robovm.
the class GetAttributeNodeNS method testGetAttributeNodeNS1.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testGetAttributeNodeNS1() throws Throwable {
String namespaceURI = "http://www.nist.gov";
String localName = "invalidlocalname";
Document doc;
NodeList elementList;
Element testAddr;
Attr attribute;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagName("emp:address");
testAddr = (Element) elementList.item(0);
assertNotNull("empAddrNotNull", testAddr);
attribute = testAddr.getAttributeNodeNS(namespaceURI, localName);
assertNull("throw_Null", attribute);
}
use of org.w3c.dom.Attr in project robovm by robovm.
the class GetNamedItemNS method testGetNamedItemNS1.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testGetNamedItemNS1() throws Throwable {
Document doc;
NodeList elementList;
Node testEmployee;
NamedNodeMap attributes;
Attr domesticAttr;
String attrName;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagName("address");
testEmployee = elementList.item(1);
attributes = testEmployee.getAttributes();
domesticAttr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic");
attrName = domesticAttr.getNodeName();
assertEquals("attrName", "dmstc:domestic", attrName);
}
use of org.w3c.dom.Attr in project robovm by robovm.
the class GetNamedItemNS method testGetNamedItemNS2.
public void testGetNamedItemNS2() throws Throwable {
String namespaceURI = "http://www.usa.com";
String localName = "domest";
Document doc;
NodeList elementList;
Node testEmployee;
NamedNodeMap attributes;
Attr newAttr;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagName("address");
testEmployee = elementList.item(1);
attributes = testEmployee.getAttributes();
newAttr = (Attr) attributes.getNamedItemNS(namespaceURI, localName);
assertNull("throw_Null", newAttr);
}
use of org.w3c.dom.Attr in project robovm by robovm.
the class ElementHasAttribute method testHasAttribute4.
public void testHasAttribute4() throws Throwable {
Document doc;
Element element;
boolean state;
Attr attribute;
doc = (Document) load("staff", builder);
element = doc.createElement("address");
attribute = doc.createAttribute("domestic");
element.setAttributeNode(attribute);
state = element.hasAttribute("domestic");
assertTrue("elementhasattribute04", state);
}
use of org.w3c.dom.Attr in project robovm by robovm.
the class ElementHasAttributeNS method testHasAttributeNS3.
public void testHasAttributeNS3() throws Throwable {
Document doc;
Element element;
boolean state;
Attr attribute;
String nullNS = null;
doc = (Document) load("staff", builder);
element = doc.createElementNS("http://www.w3.org/DOM", "address");
assertNotNull("createElementNotNull", element);
attribute = doc.createAttributeNS(nullNS, "domestic");
element.setAttributeNode(attribute);
state = element.hasAttributeNS(nullNS, "domestic");
assertTrue("elementhasattributens03", state);
}
Aggregations