Exemplo n.º 1
0
  @Test
  public void testCaptionSetterAndGetter() throws Exception {
    assertNull(l.getCaption());

    ImageCaptionImpl caption = (ImageCaptionImpl) TestHelperDoc.genElem("imgcaption");
    l.setCaption(caption);
    assertTrue(caption == l.getCaption());
    assertTrue(caption == l.getFirstChild());
    assertTrue(caption == l.getLastChild());

    l.setCaption(null);
    assertNull(l.getCaption());
    assertNull(l.getFirstChild());
    assertNull(l.getLastChild());
  }
Exemplo n.º 2
0
  @Test
  public void testReplaceCaption() throws Exception {
    ImageCaptionImpl caption = (ImageCaptionImpl) TestHelperDoc.genElem("imgcaption");
    l.setCaption(caption);

    ImageCaptionImpl newCaption = (ImageCaptionImpl) TestHelperDoc.genElem("imgcaption");
    l.replaceChild(newCaption, caption);
    assertTrue(newCaption == l.getCaption());
    assertTrue(newCaption == l.getFirstChild());
    assertTrue(newCaption == l.getLastChild());
  }