Assert.assertEquals(9, getColumnIndexesInGroup(9).get(0).intValue());
}
@Test
public void shouldUngroupMiddleSelectedColumns() {
selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 0, 0,
false, true));
selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 1, 0,
false, true));
selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 2, 0,
false, true));
final String columnGroupName = "Test Group 3";
handler.loadSelectedColumnsIndexesWithPositions();
handler.handleGroupColumnsCommand(columnGroupName);
Assert.assertEquals(3, getColumnIndexesInGroup(0).size());
Assert.assertEquals(0, getColumnIndexesInGroup(0).get(0).intValue());
Assert.assertEquals(1, getColumnIndexesInGroup(0).get(1).intValue());
Assert.assertEquals(2, getColumnIndexesInGroup(0).get(2).intValue());
// Test ungrouping column in middle
selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 1, 0,
false, false));
handler.handleUngroupCommand();
Assert.assertEquals(2, getColumnIndexesInGroup(0).size());
Assert.assertEquals(0, getColumnIndexesInGroup(0).get(0).intValue());