use of org.jowidgets.cap.common.tools.bean.BeanDtosDeletionUpdate in project jo-client-platform by jo-source.
the class BeanTableModelImplTest method testBeanDeletionUpdate.
@Test
public void testBeanDeletionUpdate() {
tableModel.getSortModel().setCurrentSorting(Arrays.asList(new ISort() {
@Override
public SortOrder getSortOrder() {
return SortOrder.ASC;
}
@Override
public String getPropertyName() {
return "key";
}
}));
tableModel.load();
triggerPageLoading();
final IUpdatableResultCallback<IBeanDtosUpdate, List<IBeanDto>> updatableCallback = assertUpdatableResultCallback(resultCallback);
updatableCallback.finished(new ArrayList<IBeanDto>());
updatableCallback.update(new BeanDtosInsertionUpdate(Arrays.asList((IBeanDto) bean1, (IBeanDto) bean2)));
updatableCallback.update(new BeanDtosDeletionUpdate(Arrays.asList(bean1.getId())));
final int size = tableModel.getSize();
assertTrue("Only 1 beans should be loaded, but was " + size, size == 1);
assertTrue("bean2 should be left", tableModel.getBean(0).getValue("value").equals(bean2.getValue("value")));
}
Aggregations