|
|
@@ -127,6 +127,26 @@ public class GridRowDraggerOneGridTest { |
|
|
|
verifyDataProvider("1", "2", "0"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void listDataProvider_calledOnlyOnce() { |
|
|
|
|
|
|
|
final int[] times = new int[1]; |
|
|
|
|
|
|
|
source.setItems("0", "1", "2"); |
|
|
|
|
|
|
|
source.getDataProvider().addDataProviderListener(ev -> times[0]++); |
|
|
|
|
|
|
|
dragger.setDropIndexCalculator(event -> { |
|
|
|
return Integer.MAX_VALUE; |
|
|
|
}); |
|
|
|
|
|
|
|
drop("1", DropLocation.ABOVE, "0"); |
|
|
|
|
|
|
|
verifyDataProvider("1", "2", "0"); |
|
|
|
|
|
|
|
Assert.assertArrayEquals("DataProvider should be invoked only once", new int[] { 1 }, times); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void noopSourceUpdater() { |
|
|
|
source.setItems("0", "1", "2"); |