Package org.fest.swing.driver
Interface TextDisplayDriver<T extends Component>
- Type Parameters:
T
- the type of
this driver supports.Component
- All Known Implementing Classes:
AbstractButtonDriver
,JLabelDriver
,JProgressBarDriver
,JTextComponentDriver
public interface TextDisplayDriver<T extends Component>
Understands functional testing of a
Component
that displays text.- Since:
- 1.2
-
Method Summary
Modifier and TypeMethodDescriptionvoid
requireText
(T component, String expected) Asserts that the text in the given component is equal to or matches the specifiedString
.void
requireText
(T component, Pattern pattern) Asserts that the text in the given component matches the given regular expression pattern.Returns the text of the given component.
-
Method Details
-
requireText
Asserts that the text in the given component is equal to or matches the specifiedString
.- Parameters:
component
- the given component.expected
- the text to match. It can be a regular expression.- Throws:
AssertionError
- if the text of the component is not equal to or does not match the given one.
-
requireText
Asserts that the text in the given component matches the given regular expression pattern.- Parameters:
component
- the given component.pattern
- the regular expression pattern to match.- Throws:
NullPointerException
- if the given regular expression pattern isnull
.AssertionError
- if the text of the component does not match the given regular expression pattern.- Since:
- 1.2
-
textOf
Returns the text of the given component.- Parameters:
component
- the given component.- Returns:
- the text of the given component.
-