Examples of JOptionPane


Examples of javax.swing.JOptionPane

    driver.requireMessage(optionPane, "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, new Person("Leia"));
  }
View Full Code Here

Examples of javax.swing.JOptionPane

    driver.requireMessage(optionPane, new Person("Leia"));
  }

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

Examples of javax.swing.JOptionPane

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

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

Examples of javax.swing.JOptionPane

   * @return the {@code String} representation of the given {@code JOptionPane}.
   */
  @RunsInCurrentThread
  @Override
  protected @Nonnull String doFormat(@Nonnull Component c) {
    JOptionPane optionPane = (JOptionPane)c;
    String format = "%s[message=%s, messageType=%s, optionType=%s, enabled=%b, visible=%b, showing=%b]";
    return String.format(format, optionPane.getClass().getName(), quote(optionPane.getMessage()),
        MESSAGE_TYPES.get(optionPane.getMessageType()), OPTION_TYPES.get(optionPane.getOptionType()),
        optionPane.isEnabled(), optionPane.isVisible(), optionPane.isShowing());
  }
View Full Code Here

Examples of javax.swing.JOptionPane

* @author Alex Ruiz
*/
public class JOptionPaneDriver_cancelButton_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_find_Cancel_button() {
    JOptionPane optionPane = inputMessage();
    launch(optionPane, title());
    JButton button = driver.cancelButton(optionPane);
    assertThatButtonHasText(button, "OptionPane.cancelButtonText");
  }
View Full Code Here

Examples of javax.swing.JOptionPane

* @author Alex Ruiz
*/
public class JOptionPaneDriver_buttonWithTextAsString_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_find_button_with_given_text() {
    JOptionPane optionPane = messageWithOptions("First", "Second");
    launch(optionPane, title());
    JButton button = driver.buttonWithText(optionPane, "Second");
    assertThat(textOf(button)).isEqualTo("Second");
  }
View Full Code Here

Examples of javax.swing.JOptionPane

    assertThat(textOf(button)).isEqualTo("Second");
  }

  @Test
  public void should_find_button_with_text_matching_pattern() {
    JOptionPane optionPane = messageWithOptions("First", "Second");
    launch(optionPane, title());
    JButton button = driver.buttonWithText(optionPane, "Sec.*");
    assertThat(textOf(button)).isEqualTo("Second");
  }
View Full Code Here

Examples of javax.swing.JOptionPane

* @author Alex Ruiz
*/
public class JOptionPaneDriver_requirePlainMessage_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_pass_if_error_type_is_equal_to_expected() {
    JOptionPane optionPane = plainMessage();
    pack(optionPane, title());
    driver.requirePlainMessage(optionPane);
  }
View Full Code Here

Examples of javax.swing.JOptionPane

    return messageOfType(PLAIN_MESSAGE);
  }

  @Test
  public void should_fail_if_error_type_is_not_equal_to_expected() {
    JOptionPane optionPane = errorMessage();
    pack(optionPane, title());
    try {
      driver.requireInformationMessage(optionPane);
      failWhenExpectingException();
    } catch (AssertionError e) {
View Full Code Here

Examples of javax.swing.JOptionPane

* @author Alex Ruiz
*/
public class JOptionPaneDriver_requireErrorMessage_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_pass_if_error_type_is_equal_to_expected() {
    JOptionPane optionPane = errorMessage();
    pack(optionPane, title());
    driver.requireErrorMessage(optionPane);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.