use of org.w3c.dom.DocumentType in project robovm by robovm.
the class ImportNode method testImportNode16.
public void testImportNode16() throws Throwable {
Document doc;
Document anotherDoc;
DocumentType docType;
doc = (Document) load("staffNS", builder);
anotherDoc = (Document) load("staffNS", builder);
docType = anotherDoc.getDoctype();
{
boolean success = false;
try {
doc.importNode(docType, false);
} catch (DOMException ex) {
success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
}
assertTrue("throw_NOT_SUPPORTED_ERR", success);
}
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class ImportNode method testImportNode2.
public void testImportNode2() throws Throwable {
Document doc;
Document aNewDoc;
CDATASection cDataSec;
Node aNode;
Document ownerDocument;
DocumentType docType;
String system;
String value;
doc = (Document) load("staffNS", builder);
aNewDoc = (Document) load("staffNS", builder);
cDataSec = aNewDoc.createCDATASection("this is CDATASection data");
aNode = doc.importNode(cDataSec, false);
ownerDocument = aNode.getOwnerDocument();
assertNotNull("ownerDocumentNotNull", ownerDocument);
docType = ownerDocument.getDoctype();
system = docType.getSystemId();
assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
value = aNode.getNodeValue();
assertEquals("nodeValue", "this is CDATASection data", value);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class ImportNode method testImportNode10.
// Assumes validation.
// public void testImportNode9() throws Throwable {
// Document doc;
// Document aNewDoc;
//
// NamedNodeMap entityList;
// Entity entity2;
// Entity entity1;
// Document ownerDocument;
// DocumentType docType;
// String system;
// String entityName;
// String publicVal;
// String notationName;
// doc = (Document) load("staffNS", builder);
// aNewDoc = (Document) load("staffNS", builder);
// docType = aNewDoc.getDoctype();
// entityList = docType.getEntities();
// assertNotNull("entitiesNotNull", entityList);
// entity2 = (Entity) entityList.getNamedItem("ent6");
// entity1 = (Entity) doc.importNode(entity2, false);
// ownerDocument = entity1.getOwnerDocument();
// docType = ownerDocument.getDoctype();
// system = docType.getSystemId();
// assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null,
// null, null, null, system);
// entityName = entity1.getNodeName();
// assertEquals("entityName", "ent6", entityName);
// publicVal = entity1.getPublicId();
// assertEquals("entityPublicId", "uri", publicVal);
// system = entity1.getSystemId();
// assertURIEquals("entitySystemId", null, null, null, "file", null, null,
// null, null, system);
// notationName = entity1.getNotationName();
// assertEquals("notationName", "notation2", notationName);
// }
public void testImportNode10() throws Throwable {
Document doc;
Document aNewDoc;
EntityReference entRef;
Node aNode;
Document ownerDocument;
DocumentType docType;
String system;
String name;
doc = (Document) load("staffNS", builder);
aNewDoc = (Document) load("staffNS", builder);
entRef = aNewDoc.createEntityReference("entRef1");
assertNotNull("createdEntRefNotNull", entRef);
entRef.setNodeValue("entRef1Value");
aNode = doc.importNode(entRef, false);
ownerDocument = aNode.getOwnerDocument();
docType = ownerDocument.getDoctype();
system = docType.getSystemId();
assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
name = aNode.getNodeName();
assertEquals("nodeName", "entRef1", name);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class HCNotationsRemoveNamedItemNS method testRemoveNamedItemNS.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testRemoveNamedItemNS() throws Throwable {
Document doc;
NamedNodeMap notations;
DocumentType docType;
doc = (Document) load("hc_staff", builder);
docType = doc.getDoctype();
if (!(("text/html".equals(getContentType())))) {
assertNotNull("docTypeNotNull", docType);
notations = docType.getNotations();
assertNotNull("notationsNotNull", notations);
try {
notations.removeNamedItemNS("http://www.w3.org/1999/xhtml", "alpha");
fail("throw_NO_MOD_OR_NOT_FOUND_ERR");
} catch (DOMException ex) {
switch(ex.code) {
case 7:
break;
case 8:
break;
default:
throw ex;
}
}
}
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class DocumentImportNode method testImportNode7.
public void testImportNode7() throws Throwable {
Document doc;
DocumentType docType;
doc = (Document) load("staffNS", builder);
docType = doc.getDoctype();
{
boolean success = false;
try {
doc.importNode(docType, true);
} catch (DOMException ex) {
success = (ex.code == DOMException.NOT_SUPPORTED_ERR);
}
assertTrue("throw_NOT_SUPPORTED_ERR", success);
}
}
Aggregations