* If reading board fails.
*/
@Test
public void testFocusHandling() throws FactoryException {
MainUI ui = new MainUI();
ui.withModelInteractor(pi);
Robot robot = BasicRobot.robotWithCurrentAwtHierarchy();
ui.main();
//hit start
robot.click(robot.finder().findByName(ButtonPanel.START_BUTTON_NAME));
// perform tab key press and wait until it took place
robot.pressAndReleaseKey(KeyEvent.VK_TAB);
robot.waitForIdle();
// perform left key press and wait until it took place
robot.pressAndReleaseKey(KeyEvent.VK_LEFT);
robot.waitForIdle();
// verify that the game registered the left key press and that it didn't
// lose focus
verify(pi).left();
assertTrue(ui.isFocusOwner());
}