Class DataProviderListenersTest

java.lang.Object
com.vaadin.tests.DataProviderListenersTest

public final class DataProviderListenersTest extends Object
Util class for testing how components with data provider handles the data provider listener on attaching/detaching and on setting a new data provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <C extends com.vaadin.flow.data.provider.HasListDataView<Object, ?>>
    void
    checkOldListenersRemovedOnComponentAttachAndDetach(C component, int expectedListenersCountAfterDataProviderSetup, int expectedListenersCountAfterComponentAttach, int[] expectedRemovedListenerIndexes, com.vaadin.flow.component.UI mockUI)
    Checks the old data provider listeners of the component are removed after component attach/detach and a new ones are added.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • checkOldListenersRemovedOnComponentAttachAndDetach

      public static <C extends com.vaadin.flow.data.provider.HasListDataView<Object, ?>> void checkOldListenersRemovedOnComponentAttachAndDetach(C component, int expectedListenersCountAfterDataProviderSetup, int expectedListenersCountAfterComponentAttach, int[] expectedRemovedListenerIndexes, com.vaadin.flow.component.UI mockUI)
      Checks the old data provider listeners of the component are removed after component attach/detach and a new ones are added.
      Type Parameters:
      C - component type
      Parameters:
      component - to be attached/detached
      expectedListenersCountAfterDataProviderSetup - expected listeners count after setting a data provider to component
      expectedListenersCountAfterComponentAttach - expected listeners count after attaching the component
      expectedRemovedListenerIndexes - indexes of listeners which are supposed to be removed after attach and detach of component, index starts from 0.
      mockUI - UI the component is attached to