c = dom.debugGetRawDocument();
ContentElement root = c.getDocumentElement();
ContentTextNode t1 = c.createTextNode("hello", root, null);
ContentTextNode t2 = c.createTextNode("blah", root, null);
Text txt1 = t1.getImplNodelet();
Text txt2 = t2.getImplNodelet();
txt1.removeFromParent();
try {
t1.getImplData();
fail("Did not throw HtmlMissing exception");
} catch (HtmlMissing e) {
assertEquals(t1, e.getBrokenNode());
assertEquals(root.getImplNodelet(), e.getNode());
}
txt2.getParentNode().insertBefore(txt1, txt2);
txt2.removeFromParent();
try {
t1.getImplData();
fail("Did not throw HtmlMissing exception");
} catch (HtmlMissing e) {
assertEquals(t2, e.getBrokenNode());
assertEquals(root.getImplNodelet(), e.getNode());
}
Text txt1b = txt1.splitText(2);
try {
t1.getImplData();
fail("Did not throw HtmlMissing exception");
} catch (HtmlMissing e) {
assertEquals(t2, e.getBrokenNode());
assertEquals(root.getImplNodelet(), e.getNode());
}
txt1b.getParentNode().insertAfter(t2.getImplNodelet(), txt1b);
try {
assertEquals("hello", t1.getImplData());
} catch (HtmlMissing e) {
fail(e.getMessage());
e.printStackTrace();