Package 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.
-
Method Summary
Modifier and TypeMethodDescriptionrequireText
(String expected) Asserts that the text of this fixture's
is equal to or matches the specifiedComponent
String
.requireText
(Pattern pattern) Asserts that the text of this fixture's
matches the given regular expression pattern.Component
text()
Returns the text of this fixture's
.Component
-
Method Details
-
text
String text()Returns the text of this fixture's
.Component
- Returns:
- the text of the managed
Component
.
-
requireText
Asserts that the text of this fixture's
is equal to or matches the specifiedComponent
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
Asserts that the text of this fixture's
matches the given regular expression pattern.Component
- Parameters:
pattern
- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the given regular expression pattern isnull
.AssertionError
- if the text of the target component does not match the given regular expression pattern.- Since:
- 1.2
-