use of org.w3c.dom.DOMException in project robovm by robovm.
the class CreateElementNS method testCreateElementNS3.
public void testCreateElementNS3() throws Throwable {
String namespaceURI = "http://www.wedding.com/";
String qualifiedName;
Document doc;
List<String> illegalQNames = new ArrayList<String>();
illegalQNames.add("person:{");
illegalQNames.add("person:}");
illegalQNames.add("person:~");
illegalQNames.add("person:'");
illegalQNames.add("person:!");
illegalQNames.add("person:@");
illegalQNames.add("person:#");
illegalQNames.add("person:$");
illegalQNames.add("person:%");
illegalQNames.add("person:^");
illegalQNames.add("person:&");
illegalQNames.add("person:*");
illegalQNames.add("person:(");
illegalQNames.add("person:)");
illegalQNames.add("person:+");
illegalQNames.add("person:=");
illegalQNames.add("person:[");
illegalQNames.add("person:]");
illegalQNames.add("person:\\");
illegalQNames.add("person:/");
illegalQNames.add("person:;");
illegalQNames.add("person:`");
illegalQNames.add("person:<");
illegalQNames.add("person:>");
illegalQNames.add("person:,");
illegalQNames.add("person:a ");
illegalQNames.add("person:\"");
doc = (Document) load("staffNS", builder);
for (int indexN10098 = 0; indexN10098 < illegalQNames.size(); indexN10098++) {
qualifiedName = (String) illegalQNames.get(indexN10098);
{
boolean success = false;
try {
doc.createElementNS(namespaceURI, qualifiedName);
} 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 CreateElementNS method testCreateElementNS2.
public void testCreateElementNS2() throws Throwable {
String namespaceURI = null;
String qualifiedName = "prefix:local";
Document doc;
doc = (Document) load("staffNS", builder);
{
boolean success = false;
try {
doc.createElementNS(namespaceURI, qualifiedName);
} 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 DOMImplementationCreateDocument method testCreateDocument7.
public void testCreateDocument7() throws Throwable {
Document doc;
DOMImplementation domImpl;
String namespaceURI = "http://www.w3.org/DOMTest/level2";
DocumentType docType = null;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
{
boolean success = false;
try {
domImpl.createDocument(namespaceURI, ":", docType);
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("domimplementationcreatedocument07", success);
}
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class DOMImplementationCreateDocument method testCreateDocument4.
public void testCreateDocument4() throws Throwable {
Document doc;
DOMImplementation domImpl;
String namespaceURI = null;
String qualifiedName = "dom:root";
DocumentType docType = null;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
{
boolean success = false;
try {
domImpl.createDocument(namespaceURI, qualifiedName, docType);
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("domimplementationcreatedocument04", success);
}
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class ElementSetAttributeNodeNS method testSetAttributeNodeNS5.
public void testSetAttributeNodeNS5() throws Throwable {
Document doc;
Document docAlt;
Element element;
Attr attribute;
doc = (Document) load("staffNS", builder);
docAlt = (Document) load("staffNS", builder);
element = doc.createElementNS("http://www.w3.org/DOM/Test", "elem1");
attribute = docAlt.createAttributeNS("http://www.w3.org/DOM/Test", "attr");
{
boolean success = false;
try {
element.setAttributeNodeNS(attribute);
} catch (DOMException ex) {
success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
}
assertTrue("throw_WRONG_DOCUMENT_ERR", success);
}
}
Aggregations