Package org.uispec4j.assertion

Examples of org.uispec4j.assertion.Assertion


      }
    };
  }

  public Assertion isEmpty() {
    return new Assertion() {
      public void check() {
        try {
          AssertAdapter.assertEquals(0, jTable.getRowCount());
        }
        catch (Error e) {
View Full Code Here


   * Checks the foreground color of the table cells using either Color or String objects
   *
   * @see <a href="http://www.uispec4j.org/colors">Using colors</a>
   */
  public Assertion foregroundEquals(final Object[][] colors) {
    return new Assertion() {
      public void check() {
        checkColors(colors, ComponentColorChecker.FOREGROUND);
      }
    };
  }
View Full Code Here

      }
    };
  }

  public Assertion foregroundNear(final int row, final int column, final Object expected) {
    return new Assertion() {
      public void check() {
        final Component component = getSwingRendererComponentAt(row, column);
        ColorUtils.assertSimilar("Error at (" + row + ", " + column + ")",
                                 expected, component.getForeground());
      }
View Full Code Here

      }
    };
  }

  public Assertion backgroundNear(final int row, final int column, final Object expected) {
    return new Assertion() {
      public void check() {
        final Component component = getSwingRendererComponentAt(row, column);
        ColorUtils.assertSimilar("Error at (" + row + ", " + column + ")",
                                 expected, component.getBackground());
      }
View Full Code Here

   * Checks the background color of the table cells using either Color or String objects
   *
   * @see <a href="http://www.uispec4j.org/colors">Using colors</a>
   */
  public Assertion backgroundEquals(final Object[][] colors) {
    return new Assertion() {
      public void check() {
        checkColors(colors, ComponentColorChecker.BACKGROUND);
      }
    };
  }
View Full Code Here

  private interface ComponentPropertyAccessor {
    Object getProperty(Component component);
  }

  public Assertion borderEquals(final Border[][] borders) {
    return new Assertion() {
      public void check() {
        assertCellPropertyEquals(borders, new ComponentPropertyAccessor() {
          public Object getProperty(Component component) {
            if (!JComponent.class.isInstance(component)) {
              throw new RuntimeException("Component '" + component.getClass() + "' does not support borders");
View Full Code Here

    AssertAdapter.fail("Column '" + columnName + "' not found - actual names: " + names);
    return -1;
  }

  public Assertion isEditable(final boolean[][] expected) {
    return new Assertion() {
      public void check() {
        Boolean[][] actual = new Boolean[jTable.getRowCount()][jTable.getColumnCount()];
        for (int i = 0; i < actual.length; i++) {
          Boolean[] row = actual[i];
          for (int j = 0; j < row.length; j++) {
View Full Code Here

      }
    };
  }

  public Assertion columnIsEditable(final int columnIndex, final boolean isEditable) {
    return new Assertion() {
      public void check() {
        for (int i = 0; i < jTable.getRowCount(); i++) {
          if (jTable.isCellEditable(i, columnIndex) != isEditable) {
            if (isEditable) {
              AssertAdapter.fail("Cell at row " + i + " is not editable");
View Full Code Here

      }
    };
  }

  public Assertion cellIsEditable(final int rowIndex, final int columnIndex) {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertTrue(jTable.isCellEditable(rowIndex, columnIndex));
      }
    };
  }
View Full Code Here

  public Assertion columnIsEditable(final String columnName, final boolean shouldBeEditable) {
    return columnIsEditable(getColumnIndex(columnName), shouldBeEditable);
  }

  public Assertion selectionIsEmpty() {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertTrue("Selection is not empty", jTable.getSelectionModel().isSelectionEmpty());
      }
    };
  }
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.