"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "flow-data/src/test/java/com/vaadin/flow/data/provider/AbstractListDataViewTest.java" between
vaadin-flow-4.0.5.tar.gz and vaadin-flow-4.0.6.tar.gz

About: Vaadin flow is a Java framework binding Vaadin web components to Java.

AbstractListDataViewTest.java  (vaadin-flow-4.0.5):AbstractListDataViewTest.java  (vaadin-flow-4.0.6)
skipping to change at line 896 skipping to change at line 896
Assert.assertEquals("Wrong item returned for index", "middle", Assert.assertEquals("Wrong item returned for index", "middle",
dataView.getItem(0)); dataView.getItem(0));
} }
@Test @Test
public void getItem_indexOutsideOfSize_throwsException() { public void getItem_indexOutsideOfSize_throwsException() {
exceptionRule.expect(IndexOutOfBoundsException.class); exceptionRule.expect(IndexOutOfBoundsException.class);
dataView.getItem(items.size()); dataView.getItem(items.size());
} }
@Test
public void createListDataProviderFromArrayOfItems_addingOneItem_itemCountSh
ouldBeIncreasedByOne() {
ListDataProvider<Item> localListDataProvider = DataProvider.ofItems(
new Item(1L, "First"), new Item(2L, "Second")
);
ListDataView<Item, AbstractListDataView<Item>> listDataView =
new ItemListDataView(() -> localListDataProvider, component);
long itemCount = listDataView.getItemCount();
listDataView.addItem(new Item(3L, "Third"));
Assert.assertEquals(itemCount + 1, listDataView.getItemCount());
}
@Test
public void createListDataProviderFromArrayOfItems_removingOneItem_itemCount
ShouldBeDecreasedByOne() {
Item first = new Item(1L, "First");
Item second = new Item(2L, "Second");
ListDataProvider<Item> localListDataProvider = DataProvider.ofItems(
first, second);
ListDataView<Item, AbstractListDataView<Item>> listDataView =
new ItemListDataView(() -> localListDataProvider, component);
long itemCount = listDataView.getItemCount();
listDataView.removeItem(first);
Assert.assertEquals(itemCount - 1, listDataView.getItemCount());
}
private static class ListDataViewImpl extends AbstractListDataView<String> { private static class ListDataViewImpl extends AbstractListDataView<String> {
public ListDataViewImpl( public ListDataViewImpl(
SerializableSupplier<DataProvider<String, ?>> dataProviderSuppli er, SerializableSupplier<DataProvider<String, ?>> dataProviderSuppli er,
Component component) { Component component) {
super(dataProviderSupplier, component); super(dataProviderSupplier, component);
} }
} }
private static class ItemListDataView extends AbstractListDataView<Item> { private static class ItemListDataView extends AbstractListDataView<Item> {
 End of changes. 1 change blocks. 
0 lines changed or deleted 33 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)