Package org.jpacman.framework.ui

Examples of org.jpacman.framework.ui.MainUI


  /**
   * Factory method to make the UI to be tested.
   * @return A new instance of Pacman's top level user interface.
   */
  public MainUI makeUI() {
    return new MainUI();
  }
View Full Code Here


  /**
   * Create a MainUI to test with.
   */
  @Before
  public void setUp() {
    mainUI = new MainUI();
  }
View Full Code Here

   *             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());

  }
View Full Code Here

   * @throws FactoryException If reading board fails.
   * @throws InterruptedException Since we're timing.
   */
  @Test
  public void testUIActions() throws FactoryException, InterruptedException {
    MainUI ui = new MainUI();
    ui.initializeNormalGame();
    ui.start();
    IPacmanInteraction eventHandler = ui.eventHandler();

    // now trigger interesting events.
    eventHandler.start();
    eventHandler.up();
    eventHandler.left();
View Full Code Here

TOP

Related Classes of org.jpacman.framework.ui.MainUI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.