* Test that hovering a cell correctly sets the style.
*/
public void testHover() {
// Initialize the grid
SelectionGrid testGrid = getSelectionGrid();
RowFormatter rowFormatter = testGrid.getRowFormatter();
CellFormatter cellFormatter = testGrid.getCellFormatter();
// Hover a cell
assertEquals(rowFormatter.getStyleName(1), "");
assertEquals(cellFormatter.getStyleName(1, 1), "");
testGrid.hoverCell(cellFormatter.getElement(1, 1));
assertEquals(rowFormatter.getStyleName(1), "hovering");
assertEquals(cellFormatter.getStyleName(1, 1), "hovering");
// Hover a cell in the same row
testGrid.hoverCell(cellFormatter.getElement(1, 3));
assertEquals(rowFormatter.getStyleName(1), "hovering");
assertEquals(cellFormatter.getStyleName(1, 1), "");
assertEquals(cellFormatter.getStyleName(1, 3), "hovering");
// Hover a cell in a different row
testGrid.hoverCell(cellFormatter.getElement(2, 4));
assertEquals(rowFormatter.getStyleName(1), "");
assertEquals(cellFormatter.getStyleName(1, 3), "");
assertEquals(rowFormatter.getStyleName(2), "hovering");
assertEquals(cellFormatter.getStyleName(2, 4), "hovering");
// Unhover the cell
testGrid.hoverCell(null);
assertEquals(rowFormatter.getStyleName(2), "");
assertEquals(cellFormatter.getStyleName(2, 4), "");
}