Package org.uispec4j.assertion

Examples of org.uispec4j.assertion.Assertion


  /**
   * Checks that the date spinner computes previous and next value with the given value.
   * {@link java.util.Calendar} constants
   */
  public Assertion calendarFieldsEquals(final int expectedCalendarFields) {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertEquals(expectedCalendarFields, model.getCalendarField());
      }
    };
  }
View Full Code Here


      click();
    }
  }

  public Assertion isSelected() {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertTrue(jCheckBox.isSelected());
      }
    };
  }
View Full Code Here

  public void setCellValueConverter(ListBoxCellValueConverter cellValueConverter) {
    this.cellValueConverter = cellValueConverter;
  }

  public Assertion isEmpty() {
    return new Assertion() {
      public void check() {
        if (getSize() != 0) {
          AssertAdapter.fail("List should be empty but contains: " + ArrayUtils.toString(getContent()));
        }
      }
View Full Code Here

      }
    };
  }

  public Assertion contentEquals(final String... displayedValues) {
    return new Assertion() {
      public void check() {
        ArrayUtils.assertEquals(displayedValues, getContent());
      }
    };
  }
View Full Code Here

  public Assertion contains(String item) {
    return contains(new String[]{item});
  }

  public Assertion contains(final String... items) {
    return new Assertion() {
      public void check() {
        List content = Arrays.asList(getContent());
        for (String item : items) {
          if (!content.contains(item)) {
            AssertAdapter.fail("Item '" + item + "' not found - actual content:" + content);
View Full Code Here

      }
    };
  }

  public Assertion selectionIsEmpty() {
    return new Assertion() {
      public void check() {
        if (jList.getSelectedIndices().length != 0) {
          String[] names = getSelectedItemNames();
          AssertAdapter.fail("Selection should be empty but is: " + ArrayUtils.toString(names));
        }
View Full Code Here

      }
    };
  }

  public Assertion selectionEquals(final String... items) {
    return new Assertion() {
      public void check() {
        ArrayUtils.assertEquals(items, getSelectedItemNames());
      }
    };
  }
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/usingcolors.html">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 index, final Object expected) {
    return new Assertion() {
      public void check() {
        final Component component = getSwingRendererComponentAt(index);
        ColorUtils.assertSimilar("Error at (" + index + ")",
                                 expected, component.getForeground());
      }
View Full Code Here

      }
    };
  }

  public Assertion backgroundNear(final int index, final Object expected) {
    return new Assertion() {
      public void check() {
        final Component component = getSwingRendererComponentAt(index);
        ColorUtils.assertSimilar("Error at (" + index + ")",
                                 expected, component.getBackground());
      }
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.