package com.vaadin.tests.components.table;
import java.util.HashSet;
import java.util.Set;
import com.vaadin.annotations.AutoGenerated;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.Align;
import com.vaadin.ui.Table.ColumnGenerator;
import com.vaadin.ui.VerticalLayout;
public class LargeSelectionCausesNPE extends TestBase {
@AutoGenerated
private Table table;
private static final String ID = "id";
private static final String NAME = "name";
private static final String CODE = "code";
@Override
protected void setup() {
addComponent(new SelectionExample());
}
@Override
protected String getDescription() {
return "Attempting to update table contents while selection reaches beyond cache limits causes a NPE. "
+ " Select a large amount of rows, e.g. from name2 to name262, return to the top of the table,"
+ " then try to update the first item twice. "
+ " Test is broken if the original values don't reappear on the second click of the button.";
}
@Override
protected Integer getTicketNumber() {
return 8519;
}
public class SelectionExample extends VerticalLayout {
Table table = new Table();
Button button = new Button("Update the first item");
Label nameLabel = new Label();
HashSet