Package org.uispec4j.assertion

Examples of org.uispec4j.assertion.Assertion


   * not being defined for Icon implementations, you will have to provide a pointer
   * to the actual Icon instance that is used in the production code. This make
   * this method mostly suited to unit testing.
   */
  public Assertion iconEquals(final Icon expected) {
    return new Assertion() {
      public void check() {
        Icon actual = abstractButton.getIcon();
        if (expected != null) {
          AssertAdapter.assertNotNull("The component contains no icon.", actual);
        }
View Full Code Here


  /**
   * Checks whether a header is displayed for this table.
   */
  public Assertion hasHeader() {
    return new Assertion() {
      public void check() {
        if (jTable.getTableHeader() == null) {
          AssertAdapter.fail("The table contains an header");
        }
      }
View Full Code Here

   * The conversion between the displayed values and the objects to
   * be given in the array can be customized with
   * {@link #setCellValueConverter(int,TableCellValueConverter)}
   */
  public Assertion contentEquals(final Object[][] expected) {
    return new Assertion() {
      public void check() {
        try {
          int expectedLength = expected.length;
          AssertAdapter.assertEquals(lengthErrorMessage(expectedLength),
                                     expectedLength, getRowCount());
View Full Code Here

    };
  }

  public Assertion blockEquals(final int fromRowIndex, final int fromColumnIndex,
                               final int columnCount, final int rowCount, final Object[][] expected) {
    return new Assertion() {
      public void check() {
        try {
          AssertAdapter.assertTrue(lengthErrorMessage(fromRowIndex),
                                     fromColumnIndex + rowCount <= getRowCount());
          for (int i = fromColumnIndex; i < fromColumnIndex + rowCount; i++) {
View Full Code Here

   * Checks the values displayed in the table for a given set of columns.
   *
   * @see #contentEquals(Object[][])
   */
  public Assertion contentEquals(final String[] columnNames, final Object[][] expected) {
    return new Assertion() {
      public void check() {
        int rowCount = jTable.getRowCount();
        if (expected.length != rowCount) {
          throwError("Expected " + expected.length + " rows but found " + rowCount,
                     columnNames, expected);
View Full Code Here

   * @see #getContentAt(int,int,TableCellValueConverter)
   */
  public Assertion cellEquals(final int row, final int column,
                              final Object expectedValue,
                              final TableCellValueConverter converter) {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertEquals("Error at (" + row + "," + column + ") -",
                                   expectedValue, getContentAt(row, column, converter));
      }
    };
View Full Code Here

      }
    };
  }

  public Assertion rowEquals(final int rowIndex, final Object[] expectedRow) {
    return new Assertion() {
      public void check() {
        if (rowIndex < 0) {
          AssertAdapter.fail("Row index should be positive");
        }
        if (rowIndex >= jTable.getRowCount()) {
View Full Code Here

      }
    };
  }

  public Assertion rowEquals(final int rowIndex, final int fromColumnIndex, final int columnCount, final Object[] expectedRow) {
    return new Assertion() {
      public void check() {
        if (rowIndex < 0) {
          AssertAdapter.fail("Row index should be positive");
        }
        if (rowIndex >= jTable.getRowCount()) {
View Full Code Here

      }
    };
  }

  public Assertion rowEquals(final int rowIndex, final String[] columnNames, final Object[] expected) {
    return new Assertion() {
      public void check() {
        if (rowIndex < 0) {
          AssertAdapter.fail("Row index should be positive");
        }
        if (rowIndex >= jTable.getRowCount()) {
View Full Code Here

      }
    };
  }

  public Assertion columnEquals(final int columnIndex, final Object[] expectedColumn) {
    return new Assertion() {
      public void check() {
        if (columnIndex < 0) {
          AssertAdapter.fail("Column index should be positive");
        }
        if (columnIndex >= jTable.getColumnCount()) {
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.