org.fest.swing.fixture
Interface TextDisplayFixture

All Known Subinterfaces:
TextInputFixture
All Known Implementing Classes:
JButtonFixture, JCheckBoxFixture, JLabelFixture, JProgressBarFixture, JRadioButtonFixture, JTextComponentFixture, JToggleButtonFixture

public interface TextDisplayFixture

Understands state verification and property value queries of GUI components that display text.

Author:
Alex Ruiz

Method Summary
 TextDisplayFixture requireText(Pattern pattern)
          Asserts that the text of this fixture's Component matches the given regular expression pattern.
 TextDisplayFixture requireText(String expected)
          Asserts that the text of this fixture's Component is equal to or matches the specified String.
 String text()
          Returns the text of this fixture's Component.
 

Method Detail

text

String text()
Returns the text of this fixture's Component.

Returns:
the text of the managed Component.

requireText

TextDisplayFixture requireText(String expected)
Asserts that the text of this fixture's Component is equal to or matches the specified String.

Parameters:
expected - the text to match. It can be a regular expression.
Returns:
this fixture.
Throws:
AssertionError - if the text of the target component is not equal to or does not match the given one.

requireText

TextDisplayFixture requireText(Pattern pattern)
Asserts that the text of this fixture's Component matches the given regular expression pattern.

Parameters:
pattern - the regular expression pattern to match.
Returns:
this fixture.
Throws:
NullPointerException - if the given regular expression pattern is null.
AssertionError - if the text of the target component does not match the given regular expression pattern.
Since:
1.2


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.