Package org.uispec4j.assertion

Examples of org.uispec4j.assertion.Assertion


  public TextBoxHandlerForRawTextComponent(JTextComponent textComponent) {
    super(textComponent);
  }

  public Assertion textIsEmpty() {
    return new Assertion() {
      public void check() {
        String actualText = jTextComponent.getText();
        AssertAdapter.assertTrue("Text should be empty but contains: " + actualText,
                                  actualText.length() == 0);
      }
View Full Code Here


    };
  }

  public Assertion textEquals(final String text) {
    return "".equals(text) ? textIsEmpty() :
           new Assertion() {
             public void check() {
               AssertAdapter.assertEquals(text, jTextComponent.getText());
             }
           };
  }
View Full Code Here

  public void clickOnHyperlink(String link) {
    AssertAdapter.fail("This component does not support hyperlinks.");
  }

  public Assertion htmlEquals(String html) {
    return new Assertion() {
      public void check() {
        AssertAdapter.fail("This component does not support html.");
      }
    };
  }
View Full Code Here

   * The color can be given in either hexadecimal ("FF45C0") or human-readable ("red") format.
   *
   * @see <a href="http://www.uispec4j.org/colors">Using colors</a>
   */
  public Assertion foregroundEquals(final String expectedColor) {
    return new Assertion() {
      public void check() {
        Color foreground = getAwtComponent().getForeground();
        if (foreground == null) {
          foreground = Color.BLACK;
        }
View Full Code Here

   * The color can be given in either hexadecimal ("FF45C0") or human-readable ("red") format.
   *
   * @see <a href="http://www.uispec4j.org/colors">Using colors</a>
   */
  public Assertion foregroundNear(final String expectedColor) {
    return new Assertion() {
      public void check() {
        Color foreground = getAwtComponent().getForeground();
        if (foreground == null) {
          foreground = Color.BLACK;
        }
View Full Code Here

   * The color can be given in either hexadecimal ("FF45C0") or human-readable ("red") format.
   *
   * @see <a href="http://www.uispec4j.org/colors">Using colors</a>
   */
  public Assertion backgroundEquals(final String expectedColor) {
    return new Assertion() {
      public void check() {
        ColorUtils.assertEquals(expectedColor, getAwtComponent().getBackground());
      }
    };
  }
View Full Code Here

   * The color can be given in either hexadecimal ("FF45C0") or human-readable ("red") format.
   *
   * @see <a href="http://www.uispec4j.org/colors">Using colors</a>
   */
  public Assertion backgroundNear(final String expectedColor) {
    return new Assertion() {
      public void check() {
        Color background = getAwtComponent().getBackground();
        if (background == null) {
          background = Color.BLACK;
        }
View Full Code Here

public abstract class AbstractSwingUIComponent extends AbstractUIComponent implements TooltipComponent {

  public abstract JComponent getAwtComponent();

  public Assertion tooltipEquals(final String text) {
    return new Assertion() {
      public void check() {
        String actualText = getAwtComponent().getToolTipText();
        AssertAdapter.assertEquals(actualText, text);
      }
    };
View Full Code Here

      }
    };
  }

  public Assertion tooltipContains(final String text) {
    return new Assertion() {
      public void check() {
        String actualText = getAwtComponent().getToolTipText();
        AssertAdapter.assertNotNull("No tooltip set", actualText);
        AssertAdapter.assertTrue("Actual tooltip:" + actualText, actualText.contains(text));
      }
View Full Code Here

  public String getText() {
    return jLabel.getText();
  }

  public Assertion textIsEmpty() {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertTrue("Text should be empty but contains: " + jLabel.getText(),
                                  jLabel.getText().length() == 0);
      }
    };
View Full Code Here

TOP

Related Classes of org.uispec4j.assertion.Assertion

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.