/** Test that we can replace text in our Range with Unicode text. */
  public void testRangeReplacementOne() {

    HWPFDocument daDoc = HWPFTestDataSamples.openSampleFile(illustrativeDocFile);

    Range range = daDoc.getRange();
    assertEquals(1, range.numSections());

    Section section = range.getSection(0);
    assertEquals(5, section.numParagraphs());

    Paragraph para = section.getParagraph(2);

    String text = para.text();
    assertEquals(originalText, text);

    int offset = text.indexOf(searchText);
    assertEquals(181, offset);

    para.replaceText(searchText, replacementText, offset);

    assertEquals(1, range.numSections());
    section = range.getSection(0);

    assertEquals(4, section.numParagraphs());
    para = section.getParagraph(2);

    text = para.text();
    assertEquals(expectedText2, text);
  }
  /** Test (more "confirm" than test) that we have the general structure that we expect to have. */
  public void testDocStructure() {

    HWPFDocument daDoc = HWPFTestDataSamples.openSampleFile(illustrativeDocFile);

    Range range = daDoc.getRange();
    assertEquals(414, range.text().length());

    assertEquals(1, range.numSections());
    Section section = range.getSection(0);
    assertEquals(414, section.text().length());

    assertEquals(5, section.numParagraphs());
    Paragraph para = section.getParagraph(2);

    assertEquals(5, para.numCharacterRuns());
    String text =
        para.getCharacterRun(0).text()
            + para.getCharacterRun(1).text()
            + para.getCharacterRun(2).text()
            + para.getCharacterRun(3).text()
            + para.getCharacterRun(4).text();

    assertEquals(originalText, text);
  }
 protected void setUp() {
   doc = HWPFTestDataSamples.openSampleFile("test2.doc");
 }
  /** Test just opening the files */
  public void testOpen() {

    HWPFTestDataSamples.openSampleFile(illustrativeDocFile);
  }