use of com.googlecode.gwt.test.utils.events.Browser.BrowserErrorHandler in project gwt-test-utils by gwt-test-utils.
the class CheckBoxTest method beforeCheckBoxTest.
@Before
public void beforeCheckBoxTest() {
errorStringBuilder.delete(0, errorStringBuilder.length());
setBrowserErrorHandler(new BrowserErrorHandler() {
public void onError(String errorMessage) {
errorStringBuilder.append(errorMessage);
}
});
}
use of com.googlecode.gwt.test.utils.events.Browser.BrowserErrorHandler in project gwt-test-utils by gwt-test-utils.
the class CellListTest method beforeCellListTest.
@Before
public void beforeCellListTest() {
sb.delete(0, sb.length());
setBrowserErrorHandler(new BrowserErrorHandler() {
public void onError(String errorMessage) {
sb.append(errorMessage);
}
});
// Create a cell to render each value.
TextCell textCell = new TextCell();
// Create the CellList that uses the cell.
cellList = new CellList<String>(textCell);
// Set the total row count. This isn't strictly necessary, but it affects
// paging calculations, so its good habit to keep the row count up to
// date.
cellList.setRowCount(DAYS.size(), true);
// Push the data into the widget.
cellList.setRowData(0, DAYS);
cellList.setVisibleRange(0, 5);
// Add it to the root panel.
RootPanel.get().add(cellList);
// Preconditions
assertThat(cellList.getRowCount()).isEqualTo(DAYS.size());
assertThat(cellList.getVisibleItemCount()).isEqualTo(5);
assertThat(cellList.getVisibleItem(cellList.getVisibleItemCount() - 1)).isEqualTo("Thursday");
}
Aggregations