GoogleTableDisplayer extends GoogleDisplayer<GoogleTableDisplayer.View> { @Override public View getView() { return view; } @Inject  GoogleTableDisplayer(View view, FilterLabelSet filterLabelSet); @Override View getView(); @Override DisplayerConstraints createDisplayerConstraints(); void sortBy(String column); void gotoPage(int pageNumber); int getLeftMostPageNumber(); int getRightMostPageNumber(); int getCurrentPage(); @Override void onFilterEnabled(Displayer displayer, DataSetGroup groupOp); @Override void onFilterEnabled(Displayer displayer, DataSetFilter filter); @Override void onFilterReset(Displayer displayer, List<DataSetGroup> groupOps); @Override void onFilterReset(Displayer displayer, DataSetFilter filter);  }
@Test public void testTableDraw() { DisplayerSettings allRows = DisplayerSettingsFactory.newTableSettings() .dataset(EXPENSES) .tableOrderDefault(COLUMN_DEPARTMENT, SortOrder.DESCENDING) .tableOrderEnabled(true) .tablePageSize(10) .tableWidth(1000) .buildSettings(); GoogleTableDisplayer table = createTableDisplayer(allRows); GoogleTableDisplayer.View tableView = table.getView(); table.ready(); verify(tableView).setWidth(1000); verify(tableView).setSortEnabled(true); verify(tableView).setPageSize(10); verify(tableView).setTotalRows(50); verify(tableView).setTotalPages(5); verify(tableView).setPagerEnabled(true); verify(tableView).drawTable(); }
@Test public void testEmptyTableDraw() { DisplayerSettings allRows = DisplayerSettingsFactory.newTableSettings() .dataset(EXPENSES) .filter(COLUMN_ID, FilterFactory.isNull()) .tablePageSize(10) .buildSettings(); GoogleTableDisplayer table = createTableDisplayer(allRows); GoogleTableDisplayer.View tableView = table.getView(); table.ready(); verify(tableView).setPageSize(10); verify(tableView).setTotalRows(0); verify(tableView).setTotalPages(1); verify(tableView).setPagerEnabled(false); verify(tableView).nodata(); }