use of org.w3c.dom.NamedNodeMap in project robovm by robovm.
the class NamedNodeMapGetNamedItemNS method testGetNamedItemNS2.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
// Assumes validation.
// public void testGetNamedItemNS1() throws Throwable {
// Document doc;
// DocumentType docType;
// NamedNodeMap entities;
// NamedNodeMap notations;
// Entity entity;
// Notation notation;
//
// String nullNS = null;
//
// doc = (Document) load("staffNS", builder);
// docType = doc.getDoctype();
// entities = docType.getEntities();
// assertNotNull("entitiesNotNull", entities);
// notations = docType.getNotations();
// assertNotNull("notationsNotNull", notations);
// entity = (Entity) entities.getNamedItemNS(nullNS, "ent1");
// assertNotNull("entityNull", entity);
// notation = (Notation) notations.getNamedItemNS(nullNS, "notation1");
// assertNotNull("notationNull", notation);
// }
public void testGetNamedItemNS2() throws Throwable {
Document doc;
NamedNodeMap attributes;
Node element;
Attr attribute;
NodeList elementList;
String attrName;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
element = elementList.item(1);
attributes = element.getAttributes();
attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic");
attrName = attribute.getNodeName();
assertEquals("namednodemapgetnameditemns02", "emp:domestic", attrName);
}
use of org.w3c.dom.NamedNodeMap in project robovm by robovm.
the class NamedNodeMapRemoveNamedItemNS method testRemoveNamedItemNS1.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testRemoveNamedItemNS1() throws Throwable {
Document doc;
NamedNodeMap attributes;
Node element;
Attr attribute;
NodeList elementList;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
element = elementList.item(1);
attributes = element.getAttributes();
attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic");
attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic");
assertNull("namednodemapremovenameditemns01", attribute);
}
use of org.w3c.dom.NamedNodeMap in project robovm by robovm.
the class NamedNodeMapRemoveNamedItemNS method testRemoveNamedItemNS6.
// Assumes validation.
// public void testRemoveNamedItemNS5() throws Throwable {
// Document doc;
// DocumentType docType;
// NamedNodeMap entities;
// NamedNodeMap notations;
//
// String nullNS = null;
//
// doc = (Document) load("staffNS", builder);
// docType = doc.getDoctype();
// entities = docType.getEntities();
// assertNotNull("entitiesNotNull", entities);
// notations = docType.getNotations();
// assertNotNull("notationsNotNull", notations);
//
// try {
// entities.removeNamedItemNS(nullNS, "ent1");
// fail("entity_throw_DOMException");
//
// } catch (DOMException ex) {
// switch (ex.code) {
// case 8:
// break;
// case 7:
// break;
// default:
// throw ex;
// }
// }
//
// try {
// notations.removeNamedItemNS(nullNS, "notation1");
// fail("notation_throw_DOMException");
//
// } catch (DOMException ex) {
// switch (ex.code) {
// case 8:
// break;
// case 7:
// break;
// default:
// throw ex;
// }
// }
// }
public void testRemoveNamedItemNS6() throws Throwable {
Document doc;
NamedNodeMap attributes;
Node element;
NodeList elementList;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
element = elementList.item(1);
attributes = element.getAttributes();
{
boolean success = false;
try {
attributes.removeNamedItemNS("http://www.Nist.gov", "domestic");
} catch (DOMException ex) {
success = (ex.code == DOMException.NOT_FOUND_ERR);
}
assertTrue("throw_NOT_FOUND_ERR", success);
}
}
use of org.w3c.dom.NamedNodeMap in project robovm by robovm.
the class NamedNodeMapRemoveNamedItemNS method testRemoveNamedItemNS7.
public void testRemoveNamedItemNS7() throws Throwable {
Document doc;
NamedNodeMap attributes;
Node element;
NodeList elementList;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "employee");
element = elementList.item(1);
attributes = element.getAttributes();
{
boolean success = false;
try {
attributes.removeNamedItemNS("http://www.nist.gov", "domestic");
} catch (DOMException ex) {
success = (ex.code == DOMException.NOT_FOUND_ERR);
}
assertTrue("throw_NOT_FOUND_ERR", success);
}
}
use of org.w3c.dom.NamedNodeMap in project robovm by robovm.
the class NamedNodeMapSetNamedItemNS method testSetNamedItemNS2.
public void testSetNamedItemNS2() throws Throwable {
Document doc;
NamedNodeMap attributes;
Element element;
Attr attribute;
Attr attribute1;
String attrName;
doc = (Document) load("staffNS", builder);
element = doc.createElementNS("http://www.w3.org/DOM/Test", "root");
attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att");
attributes = element.getAttributes();
attributes.setNamedItemNS(attribute1);
attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "att");
attrName = attribute.getNodeName();
assertEquals("namednodemapsetnameditemns02", "L1:att", attrName);
}
Aggregations