@Test
public void onlyOneCellSelectedAtAnyTime() {
selectionLayer.getSelectionModel().setMultipleSelectionAllowed(false);
selectionLayer.clear();
selectionLayer.doCommand(new SelectRowsCommand(selectionLayer, 1, 0,
false, true));
Collection<PositionCoordinate> cells = ArrayUtil
.asCollection(selectionLayer.getSelectedCellPositions());
assertEquals(1, cells.size());
assertEquals(1, selectionLayer.getSelectedRowPositions().size());
assertEquals(1, selectionLayer.getSelectedRowCount());
// select another row with control mask
selectionLayer.doCommand(new SelectRowsCommand(selectionLayer, 1, 2,
false, true));
cells = ArrayUtil.asCollection(selectionLayer
.getSelectedCellPositions());
assertEquals(1, cells.size());
assertEquals(1, selectionLayer.getSelectedRowPositions().size());
assertEquals(1, selectionLayer.getSelectedRowCount());
// select additional rows with shift mask
selectionLayer.doCommand(new SelectRowsCommand(selectionLayer, 1, 5,
true, false));
cells = ArrayUtil.asCollection(selectionLayer
.getSelectedCellPositions());
assertEquals(1, cells.size());