Methods Summary |
---|
protected void | setUp()
super.setUp();
try {
factory = new DOMDocumentBuilderFactory(DOMDocumentBuilderFactory
.getConfiguration2());
builder = factory.getBuilder();
} catch (Exception e) {
fail("Unexpected exception" + e.getMessage());
}
|
protected void | tearDown()
factory = null;
builder = null;
super.tearDown();
|
public void | testGetElementsByTagNameNS1()Runs the test case.
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());
|
public void | testGetElementsByTagNameNS2()
Document doc;
Element docElem;
Element element;
NodeList childList;
doc = (Document) load("staffNS", builder);
docElem = doc.getDocumentElement();
element = doc.createElementNS("test", "employeeId");
docElem.appendChild(element);
childList = doc.getElementsByTagNameNS("*", "employeeId");
assertEquals("documentgetelementsbytagnameNS02", 6, childList
.getLength());
|
public void | testGetElementsByTagNameNS3()
Document doc;
NodeList childList;
doc = (Document) load("staffNS", builder);
childList = doc.getElementsByTagNameNS("**", "*");
assertEquals("documentgetelementsbytagnameNS03", 0, childList
.getLength());
|
public void | testGetElementsByTagNameNS4()
Document doc;
NodeList childList;
String nullNS = null;
doc = (Document) load("staffNS", builder);
childList = doc.getElementsByTagNameNS(nullNS, "0");
assertEquals("documentgetelementsbytagnameNS04", 0, childList
.getLength());
|
public void | testGetElementsByTagNameNS5()
Document doc;
NodeList childList;
doc = (Document) load("staffNS", builder);
childList = doc.getElementsByTagNameNS("null", "elementId");
assertEquals("documentgetelementsbytagnameNS05", 0, childList
.getLength());
|