Пример #1
0
  /** Test removing footers */
  public void testRemovingFooters() {
    Table table = new Table("Test table", createContainer());
    table.setColumnFooter("col1", "Footer1");
    table.setColumnFooter("col2", "Footer2");

    // Test removing footer
    assertNotNull(table.getColumnFooter("col1"));
    table.setColumnFooter("col1", null);
    assertNull(table.getColumnFooter("col1"));

    // The other footer should still be there
    assertNotNull(table.getColumnFooter("col2"));

    // Remove non-existing footer
    table.setColumnFooter("fail", null);
  }
Пример #2
0
  /** Tests adding footers to the columns */
  public void testAddingFooters() {
    Table table = new Table("Test table", createContainer());

    // Table should not contain any footers at initialization
    assertNull(table.getColumnFooter("col1"));
    assertNull(table.getColumnFooter("col2"));
    assertNull(table.getColumnFooter("col3"));

    // Adding column footer
    table.setColumnFooter("col1", "Footer1");
    assertEquals("Footer1", table.getColumnFooter("col1"));

    // Add another footer
    table.setColumnFooter("col2", "Footer2");
    assertEquals("Footer2", table.getColumnFooter("col2"));

    // Add footer for a non-existing column
    table.setColumnFooter("fail", "FooterFail");
  }