}
public void testRunElement() {
htmlDoc.lockWrite();
RunElement run = htmlDoc.new RunElement(leaf1, as[2],
3, 9);
assertSame(leaf1, run.getParent());
assertSame(leaf1, run.getParentElement());
assertSame(run, run.getAttributes());
assertEquals(as[2].getAttributeCount(), run.getAttributeCount());
assertEquals(3, run.getStartOffset());
assertEquals(9, run.getEndOffset());
int[] start = {-1, 3, 3, 3}; // start offset
int[] expStart = {0, 3, 3, 3}; // expectations for start offset
int[] end = {9, -1, 1, 20}; // end offset
int[] expEnd = {9, 0, 1, 20}; // expectations for end offset
int[] intEnd = {9, 3, 3, 20}; // expectations for DRL's end offset
for (int i = 0; i < start.length; i++) {
run = htmlDoc.new RunElement(null, null, start[i], end[i]);
assertEquals("Start (" + i + ")", expStart[i],
run.getStartOffset());
assertEquals("End (" + i + ")",
isHarmony() ? intEnd[i] : expEnd[i],
run.getEndOffset());
}
htmlDoc.unlockWrite();
}