@Override protected TreeTable createTable(Container container) { return new TreeTable(null, container); } });
@Before public void setUp() throws Exception { // testing with a plain Vaadin TreeTable setUp(new TreeViewImpl() { @Override protected TreeTable createTable(Container container) { return new TreeTable(null, container); } }); }
/** * Should this test start to fail right after focusParent, returning null selection instead of a Set containing null, * then we'd consider it a Vaadin fix and remove the attached workaround in ListViewImpl. */ @Test public void proveVaadinTableValueCanBeASetContainingNull() throws Exception { // when an itemId is selected and we process e.g. an itemClick, we want to unselect it // make sure this doesn't fail if value ends up being a set containing null // GIVEN TreeTable tree = new TreeTable(null, buildContainer()); tree.setSelectable(true); tree.setMultiSelect(true); assertThat(tree.getValue(), anyOf(nullValue(), instanceOf(Set.class))); // WHEN produceTableValueContainingNull(tree); // THEN assertThat((Set<?>) tree.getValue(), contains((Object) null)); }