HWPFDocument daDoc = new HWPFDocument(new FileInputStream(illustrativeDocFile));
Range range;
Section section;
Paragraph para;
PAPX paraDef;
// First, check overall
range = daDoc.getOverallRange();
assertEquals(1, range.numSections());
assertEquals(5, range.numParagraphs());
// Now, onto just the doc bit
range = daDoc.getRange();
assertEquals(1, range.numSections());
assertEquals(1, daDoc.getSectionTable().getSections().size());
section = range.getSection(0);
assertEquals(5, section.numParagraphs());
para = section.getParagraph(0);
assertEquals(1, para.numCharacterRuns());
assertEquals(introText, para.text());
para = section.getParagraph(1);
assertEquals(5, para.numCharacterRuns());
assertEquals(fillerText, para.text());
paraDef = (PAPX)daDoc.getParagraphTable().getParagraphs().get(2);
assertEquals(132, paraDef.getStart());
assertEquals(400, paraDef.getEnd());
para = section.getParagraph(2);
assertEquals(5, para.numCharacterRuns());
assertEquals(originalText, para.text());
paraDef = (PAPX)daDoc.getParagraphTable().getParagraphs().get(3);
assertEquals(400, paraDef.getStart());
assertEquals(438, paraDef.getEnd());
para = section.getParagraph(3);
assertEquals(1, para.numCharacterRuns());
assertEquals(lastText, para.text());