Package org.uispec4j.assertion

Examples of org.uispec4j.assertion.Assertion


    }
    return table;
  }

    public Assertion containsAttributeTable() {
        return new Assertion() {
          public void check() {
            Assert.assertTrue(findAttributeTable() != null);
          }
        };
      }
View Full Code Here


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

  public Assertion textContains(final String text) {
    return new Assertion() {
      public void check() {
        String actual = jTextComponent.getText().replaceAll("\n    ", "").replaceAll("\n  </body>", "</body>");
        AssertAdapter.assertTrue("The component text does not contain '" + text + "' - actual content is:" + actual,
                                 actual.indexOf(text.trim()) >= 0);
      }
View Full Code Here

      }
    };
  }

  public Assertion textDoesNotContain(final String text) {
    return new Assertion() {
      public void check() {
        String actual = jTextComponent.getText();
        AssertAdapter.assertTrue("The component text should not contain '" + text +
                                 "' - actual content is:" + actual,
                                 actual.indexOf(text) < 0);
View Full Code Here

      }
    };
  }

  public Assertion isEditable() {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertTrue("The text box is not editable", jTextComponent.isEditable());
      }
    };
  }
View Full Code Here

    try {
      display.add(interceptor);
      display.setCurrentPopup(null);
      TriggerRunner.runInSwingThread(trigger);
      UISpecAssert.waitUntil("No popup was shown",
                             new Assertion() {
                               public void check() {
                                 if (display.getCurrentPopup() == null) {
                                   AssertAdapter.fail("No popup shown");
                                 }
                                 ;
View Full Code Here

  /**
   * Checks that the spinner displays the given value
   */
  public Assertion valueEquals(final Object expectedValue) {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertEquals(expectedValue, jSpinner.getValue());
      }
    };
  }
View Full Code Here

  /**
   * Checks that the previous value is the given value
   */
  public Assertion previousValueEquals(final Object expectedPreviousValue) {
    return new Assertion() {
      public void check() {
        Object previousValue = jSpinner.getPreviousValue();
        if (previousValue == null) {
          AssertAdapter.fail("No previous value from the start");
        }
View Full Code Here

  /**
   * Checks that the next value is the given value
   */
  public Assertion nextValueEquals(final Object expectedNextValue) {
    return new Assertion() {
      public void check() {
        Object nextValue = jSpinner.getNextValue();
        if (nextValue == null) {
          AssertAdapter.fail("No previous value from the end");
        }
View Full Code Here

  /**
   * Checks the slider labels in order.
   */
  public Assertion labelsEqual(final String... expected) {
    return new Assertion() {
      public void check() {
        TreeMap<Integer, String> sortedTree = getSortedTree();
        Utils.assertEquals(expected, sortedTree.values().toArray(new Object[sortedTree.values().size()]));
      }
    };
View Full Code Here

  /**
   * Checks that the current position corresponds to the specified label
   */
  public Assertion positionEquals(final String expectedLabel) {
    return new Assertion() {
      public void check() {
        AssertAdapter.assertEquals(expectedLabel, getCurrentLabel());
      }
    };
  }
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.