use of org.w3c.dom.DOMException in project robovm by robovm.
the class CreateAttributeNS method testCreateAttributeNS3.
public void testCreateAttributeNS3() 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 indexN10090 = 0; indexN10090 < illegalQNames.size(); indexN10090++) {
qualifiedName = (String) illegalQNames.get(indexN10090);
{
boolean success = false;
try {
doc.createAttributeNS(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 CreateAttributeNS method testCreateAttributeNS6.
public void testCreateAttributeNS6() throws Throwable {
String namespaceURI = "http://www.example.com/";
Document doc;
doc = (Document) load("hc_staff", builder);
// Our exception priorities differ from the spec
try {
doc.createAttributeNS(namespaceURI, "");
fail();
} catch (DOMException ex) {
}
// END android-changed
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class DocumentCreateElementNS method testCreateElementNS5.
public void testCreateElementNS5() throws Throwable {
Document doc;
String namespaceURI = null;
String qualifiedName = "null:xml";
doc = (Document) load("staffNS", builder);
{
boolean success = false;
try {
doc.createElementNS(namespaceURI, qualifiedName);
} catch (DOMException ex) {
success = (ex.code == DOMException.NAMESPACE_ERR);
}
assertTrue("documentcreateelementNS05", success);
}
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class DocumentImportNode method testImportNode8.
public void testImportNode8() throws Throwable {
Document doc;
DocumentType docType;
DOMImplementation domImpl;
String nullNS = null;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
docType = domImpl.createDocumentType("test:root", nullNS, nullNS);
{
boolean success = false;
try {
doc.importNode(docType, true);
} catch (DOMException ex) {
success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
}
assertTrue("throw_NOT_SUPPORTED_ERR", success);
}
}
use of org.w3c.dom.DOMException in project robovm by robovm.
the class DocumentCreateAttributeNS method testCreateAttributeNS3.
public void testCreateAttributeNS3() throws Throwable {
Document doc;
String namespaceURI = "http://www.w3.org/DOM/Test/Level2";
String qualifiedName;
List<String> qualifiedNames = new ArrayList<String>();
qualifiedNames.add("/");
qualifiedNames.add("//");
qualifiedNames.add("\\");
qualifiedNames.add(";");
qualifiedNames.add("&");
qualifiedNames.add("*");
qualifiedNames.add("]]");
qualifiedNames.add(">");
qualifiedNames.add("<");
doc = (Document) load("staffNS", builder);
for (int indexN1005A = 0; indexN1005A < qualifiedNames.size(); indexN1005A++) {
qualifiedName = (String) qualifiedNames.get(indexN1005A);
{
boolean success = false;
try {
doc.createAttributeNS(namespaceURI, qualifiedName);
} catch (DOMException ex) {
success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
}
assertTrue("documentcreateattributeNS03", success);
}
}
}
Aggregations