Package javax.swing

Examples of javax.swing.JOptionPane


* @author Alex Ruiz
*/
public class JOptionPaneDriver_yesButton_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_find_Yes_button() {
    JOptionPane optionPane = confirmMessage();
    launch(optionPane, title());
    JButton button = driver.yesButton(optionPane);
    assertThatButtonHasText(button, "OptionPane.yesButtonText");
  }
View Full Code Here


* @author Alex Ruiz
*/
public class JOptionPaneDriver_requireMessageByPattern_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_pass_if_message_matches_pattern() {
    JOptionPane optionPane = messageWithValue("Leia");
    pack(optionPane, title());
    driver.requireMessage(optionPane, Pattern.compile("Le.*"));
  }
View Full Code Here

    driver.requireMessage(optionPane, Pattern.compile("Le.*"));
  }

  @Test
  public void should_pass_if_non_String_message_is_equal_to_expected() {
    JOptionPane optionPane = messageWithValue(new Person("Leia"));
    pack(optionPane, title());
    driver.requireMessage(optionPane, Pattern.compile("Le.*"));
  }
View Full Code Here

    driver.requireMessage(optionPane, Pattern.compile("Le.*"));
  }

  @Test
  public void should_fail_is_message_does_match_pattern() {
    JOptionPane optionPane = messageWithValue("Palpatine");
    pack(optionPane, title());
    try {
      driver.requireMessage(optionPane, Pattern.compile("Anakin"));
      failWhenExpectingException();
    } catch (AssertionError e) {
View Full Code Here

* @author Alex Ruiz
*/
public class JOptionPaneDriver_okButton_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_find_OK_button() {
    JOptionPane optionPane = informationMessage();
    launch(optionPane, title());
    JButton button = driver.okButton(optionPane);
    assertThatButtonHasText(button, "OptionPane.okButtonText");
  }
View Full Code Here

* @author Alex Ruiz
*/
public class JOptionPaneDriver_requireTitleAsText_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_pass_is_title_is_equal_to_expected() {
    JOptionPane optionPane = informationMessage();
    pack(optionPane, title());
    driver.requireTitle(optionPane, title());
  }
View Full Code Here

    driver.requireTitle(optionPane, title());
  }

  @Test
  public void should_pass_if_title_matches_pattern() {
    JOptionPane optionPane = informationMessage();
    pack(optionPane, title());
    driver.requireTitle(optionPane, "JOptionP.*");
  }
View Full Code Here

    driver.requireTitle(optionPane, "JOptionP.*");
  }

  @Test
  public void should_fail_if_title_is_not_equal_to_expected() {
    JOptionPane optionPane = informationMessage();
    pack(optionPane, title());
    try {
      driver.requireTitle(optionPane, "Yoda");
      failWhenExpectingException();
    } catch (AssertionError e) {
View Full Code Here

  @RunsInEDT
  static JOptionPane confirmMessage() {
    return execute(new GuiQuery<JOptionPane>() {
      @Override
      protected JOptionPane executeInEDT() {
        return new JOptionPane(MESSAGE, QUESTION_MESSAGE, YES_NO_CANCEL_OPTION);
      }
    });
  }
View Full Code Here

  @RunsInEDT
  static JOptionPane inputMessage() {
    return execute(new GuiQuery<JOptionPane>() {
      @Override
      protected JOptionPane executeInEDT() {
        JOptionPane optionPane = new JOptionPane(MESSAGE, QUESTION_MESSAGE, OK_CANCEL_OPTION);
        optionPane.setWantsInput(true);
        return optionPane;
      }
    });
  }
View Full Code Here

TOP

Related Classes of javax.swing.JOptionPane

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.