use of org.w3c.dom.DocumentType in project robovm by robovm.
the class ImportNode method _testImportNode1.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void _testImportNode1() throws Throwable {
Document doc;
Document aNewDoc;
Attr newAttr;
Text importedChild;
Node aNode;
Document ownerDocument;
Element attrOwnerElement;
DocumentType docType;
String system;
boolean specified;
NodeList childList;
String nodeName;
Node child;
String childValue;
List<String> expectedResult = new ArrayList<String>();
expectedResult.add("elem:attr1");
expectedResult.add("importedText");
doc = (Document) load("staffNS", builder);
aNewDoc = (Document) load("staffNS", builder);
newAttr = aNewDoc.createAttribute("elem:attr1");
importedChild = aNewDoc.createTextNode("importedText");
aNode = newAttr.appendChild(importedChild);
aNode = doc.importNode(newAttr, false);
ownerDocument = aNode.getOwnerDocument();
docType = ownerDocument.getDoctype();
system = docType.getSystemId();
assertNotNull("aNode", aNode);
assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, null, null, null, system);
attrOwnerElement = ((Attr) /* Node */
aNode).getOwnerElement();
assertNull("ownerElement", attrOwnerElement);
specified = ((Attr) /* Node */
aNode).getSpecified();
assertTrue("specified", specified);
childList = aNode.getChildNodes();
assertEquals("childList", 1, childList.getLength());
nodeName = aNode.getNodeName();
assertEquals("nodeName", "elem:attr1", nodeName);
child = aNode.getFirstChild();
childValue = child.getNodeValue();
assertEquals("childValue", "importedText", childValue);
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class DocumentGetElementsByTagnameNS method testGetElementsByTagNameNS1.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testGetElementsByTagNameNS1() throws Throwable {
Document doc;
Document newDoc;
DocumentType docType = null;
DOMImplementation domImpl;
NodeList childList;
String nullNS = null;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
newDoc = domImpl.createDocument(nullNS, "root", docType);
childList = newDoc.getElementsByTagNameNS("*", "*");
assertEquals("documentgetelementsbytagnameNS01", 1, childList.getLength());
}
use of org.w3c.dom.DocumentType 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.DocumentType in project robovm by robovm.
the class DOMImplementationCreateDocumentType method testCreateDocumentType1.
/**
* Runs the test case.
*
* @throws Throwable
* Any uncaught exception causes test to fail
*/
public void testCreateDocumentType1() throws Throwable {
Document doc;
DOMImplementation domImpl;
DocumentType newDocType;
Document ownerDocument;
String qualifiedName = "test:root";
String publicId;
String systemId;
List<String> publicIds = new ArrayList<String>();
publicIds.add("1234");
publicIds.add("test");
List<String> systemIds = new ArrayList<String>();
systemIds.add("");
systemIds.add("test");
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
for (int indexN1005D = 0; indexN1005D < publicIds.size(); indexN1005D++) {
publicId = (String) publicIds.get(indexN1005D);
for (int indexN10061 = 0; indexN10061 < systemIds.size(); indexN10061++) {
systemId = (String) systemIds.get(indexN10061);
newDocType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
assertNotNull("domimplementationcreatedocumenttype01_newDocType", newDocType);
ownerDocument = newDocType.getOwnerDocument();
assertNull("domimplementationcreatedocumenttype01_ownerDocument", ownerDocument);
}
}
}
use of org.w3c.dom.DocumentType in project robovm by robovm.
the class CreateDocument method testCreateDocument7.
public void testCreateDocument7() throws Throwable {
String namespaceURI = "http://www.ecommerce.org/schema";
String qualifiedName = "y:x";
Document doc;
DocumentType docType = null;
DOMImplementation domImpl;
Document aNewDoc;
String nodeName;
String nodeValue;
doc = (Document) load("staffNS", builder);
domImpl = doc.getImplementation();
aNewDoc = domImpl.createDocument(namespaceURI, qualifiedName, docType);
nodeName = aNewDoc.getNodeName();
nodeValue = aNewDoc.getNodeValue();
assertEquals("nodeName", "#document", nodeName);
assertNull("nodeValue", nodeValue);
}
Aggregations