use of org.gwtproject.view.client.AbstractDataProviderTest.MockDataProvider in project gwtproject by treblereel.
the class DefaultNodeInfoTest method testSetDataDisplay.
public void testSetDataDisplay() {
SelectionModel<String> model = new SingleSelectionModel<String>();
org.gwtproject.view.client.DefaultSelectionEventManager<String> manager = DefaultSelectionEventManager.createDefaultManager();
MockDataProvider<String> provider = new MockDataProvider<String>(null);
DefaultNodeInfo<String> nodeInfo = new DefaultNodeInfo<String>(provider, new TextCell(), model, manager, null);
MockHasData<String> display = new MockHasData<String>();
display.setVisibleRange(0, 10);
display.clearLastRowDataAndRange();
assertEquals(0, display.getHandlerCount(org.gwtproject.view.client.CellPreviewEvent.getType()));
// setDataDisplay.
nodeInfo.setDataDisplay(display);
assertEquals(1, display.getHandlerCount(org.gwtproject.view.client.CellPreviewEvent.getType()));
provider.assertLastRangeChanged(display);
provider.clearLastRangeChanged();
display.setVisibleRange(0, 5);
provider.assertLastRangeChanged(display);
provider.clearLastRangeChanged();
// unsetDataDisplay.
nodeInfo.unsetDataDisplay();
assertEquals(0, display.getHandlerCount(CellPreviewEvent.getType()));
display.setVisibleRange(0, 5);
provider.assertLastRangeChanged(null);
}
Aggregations