Package org.uispec4j.assertion

Examples of org.uispec4j.assertion.Assertion


   *
   * @param expectedValue an int between 0 and 100, or -1 if the status is undeterminate
   * @see #setPrecision(int)
   */
  public Assertion relativePositionEquals(final int expectedValue) {
    return new Assertion() {
      public void check() {
        int relativePosition = getRelativePosition();
        AssertAdapter.assertTrue("Expected " + expectedValue + " but was " + relativePosition,
                                 isRoughlyEqual(expectedValue, relativePosition));
      }
View Full Code Here


  /**
   * Checks the names displayed in the menu, ommiting separators.
   */
  public Assertion contentEquals(final String... menuNames) {
    return new Assertion() {
      public void check() {
        String[] actual = new String[jMenuBar.getMenuCount()];
        for (int i = 0; i < actual.length; i++) {
          actual[i] = jMenuBar.getMenu(i).getText();
        }
View Full Code Here

    }
    return menuItem;
  }

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

    }
    return actualWrappersList.toArray(new String[actualWrappersList.size()]);
  }

  public Assertion contentEquals(final String xmlContent) {
    return new Assertion() {
      public void check() {
        StringWriter writer = new StringWriter();
        XmlWriter.Tag tag = XmlWriter.startTag(writer, getDescriptionTypeName());
        if (wrapper.getText() != null) {
          tag.addAttribute("name", wrapper.getText());
View Full Code Here

  public String getDescriptionTypeName() {
    return TYPE_NAME;
  }

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

    }
    return result;
  }

  public Assertion containsWindow(final String title) {
    return new Assertion() {
      public void check() {
        JInternalFrame[] allFrames = jDesktopPane.getAllFrames();
        for (JInternalFrame allFrame : allFrames) {
          if (Utils.equals(title, allFrame.getTitle())) {
            return;
View Full Code Here

   * for more information)</li>
   * <li>The "bold" property, if present, must be placed before the "color" property</li>
   * </ul>
   */
  public Assertion contentEquals(final String expectedContents) {
    return new Assertion() {
      public void check() {
        String trimmedExpected = expectedContents.trim();
        AssertAdapter.assertTrue("Expected tree description should not be empty",
                                 (trimmedExpected != null) && (trimmedExpected.length() > 0));
        checkContents(trimmedExpected);
View Full Code Here

  /**
   * Checks that a node identified by the given path is present in the jTree.
   */
  public Assertion contains(final String path) {
    return new Assertion() {
      public void check() {
        getTreePath(path);
      }
    };
  }
View Full Code Here

  /**
   * Checks that a given node is selected, and that is is the only selection.
   */
  public Assertion selectionEquals(final String path) {
    return new Assertion() {
      public void check() {
        TreePath selectionPath = jTree.getSelectionPath();
        AssertAdapter.assertNotNull("The current tree selection is null.", selectionPath);
        TreePath expectedPath = getTreePath(path);
        AssertAdapter.assertNotNull("The expected path is not valid.", expectedPath);
View Full Code Here

  /**
   * Checks the selection contents.
   */
  public Assertion selectionEquals(final String[] paths) {
    return new Assertion() {
      public void check() {
        String[] expectedPaths = paths.clone();
        TreePath[] selectionPaths = jTree.getSelectionPaths();
        if (selectionPaths == null) {
          selectionPaths = new TreePath[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.