use of org.w3c.dom.DOMException in project robovm by robovm.
the class SetAttributeNS method testSetAttributeNS6.
public void testSetAttributeNS6() throws Throwable {
String namespaceURI = "http://www.nist.gov";
String qualifiedName = "xml:qualifiedName";
Document doc;
NodeList elementList;
Node testAddr;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagName("employee");
testAddr = elementList.item(0);
{
boolean success = false;
try {
((Element) /* Node */
testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("throw_NAMESPACE_ERR", success);
}
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class SetAttributeNS method testSetAttributeNS1.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testSetAttributeNS1() throws Throwable {
String namespaceURI = "http://www.nist.gov";
String qualifiedName = "emp:qual?name";
Document doc;
NodeList elementList;
Node testAddr;
doc = (Document) load("staffNS", builder);
elementList = doc.getElementsByTagName("employee");
testAddr = elementList.item(0);
{
boolean success = false;
try {
((Element) /* Node */
testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
} catch (DOMException ex) {
success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
}
assertTrue("throw_INVALID_CHARACTER_ERR", success);
}
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class SetAttributeNS method testSetAttributeNS10.
public void testSetAttributeNS10() throws Throwable {
String namespaceURI = "http://www.example.gov";
Document doc;
NodeList elementList;
Node testAddr;
doc = (Document) load("hc_staff", builder);
elementList = doc.getElementsByTagName("em");
testAddr = elementList.item(0);
{
// Our exception priorities differ from the spec
try {
((Element) /* Node */
testAddr).setAttributeNS(namespaceURI, "", "newValue");
fail();
} catch (DOMException ex) {
}
// END android-changed
}
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class SetAttributeNodeNS method testSetAttributeNode5.
public void testSetAttributeNode5() throws Throwable {
String namespaceURI = "http://www.newattr.com";
String qualifiedName = "emp:newAttr";
Document doc1;
Document doc2;
Attr newAttr;
NodeList elementList;
Node testAddr;
doc1 = (Document) load("staffNS", builder);
doc2 = (Document) load("staffNS", builder);
newAttr = doc2.createAttributeNS(namespaceURI, qualifiedName);
elementList = doc1.getElementsByTagName("emp:address");
testAddr = elementList.item(0);
{
boolean success = false;
try {
((Element) /* Node */
testAddr).setAttributeNodeNS(newAttr);
} catch (DOMException ex) {
success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
}
assertTrue("throw_WRONG_DOCUMENT_ERR", success);
}
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class SetNamedItemNS method testSetNamedItemNS2.
public void testSetNamedItemNS2() throws Throwable {
String namespaceURI = "http://www.usa.com";
String qualifiedName = "dmstc:domestic";
Document doc;
Document anotherDoc;
Node arg;
NodeList elementList;
Node testAddress;
NamedNodeMap attributes;
doc = (Document) load("staffNS", builder);
anotherDoc = (Document) load("staffNS", builder);
arg = anotherDoc.createAttributeNS(namespaceURI, qualifiedName);
arg.setNodeValue("Maybe");
elementList = doc.getElementsByTagName("address");
testAddress = elementList.item(0);
attributes = testAddress.getAttributes();
{
boolean success = false;
try {
attributes.setNamedItemNS(arg);
} catch (DOMException ex) {
success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
}
assertTrue("throw_WRONG_DOCUMENT_ERR", success);
}
}
Aggregations