void runTest() {
Document doc=new org.apache.xerces.dom.DocumentImpl();
reportAllMutations(doc);
Element root=addNoisyElement(doc,doc,0);
Element e=null;
int i;
// Individual nodes
e=addNoisyElement(doc,root,0);
Attr a=addNoisyAttr(doc,e,0);
a.setNodeValue("Updated A0 of E0, prepare to be acidulated.");
NamedNodeMap nnm=e.getAttributes();
nnm.removeNamedItem(a.getName());
nnm.setNamedItem(a);
// InsertedInto/RemovedFrom tests.
// ***** These do not currently cross the Attr/Element barrier.
// DOM spec is pretty clear on that, but this may not be the intent.
System.out.println("\nAdd/remove a preconstructed tree; tests AddedToDocument\n");
sharedReporter.off();
Element lateAdd=doc.createElement("lateAdd");
reportAllMutations(lateAdd);
e=lateAdd;
for(i=0;i< 2;++i)
{
e=addNoisyElement(doc,e,i);
addNoisyAttr(doc,e,i);
}
sharedReporter.on();
root.appendChild(lateAdd);
root.removeChild(lateAdd);
System.out.println("\nReplace a preconstructed tree; tests AddedToDocument\n");
sharedReporter.off();
Node e0=root.replaceChild(lateAdd,root.getFirstChild());
sharedReporter.on();
root.replaceChild(e0,lateAdd);
System.out.println("Done");
}
|