Package org.fest.swing.driver
Class JLabelDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JLabelDriver
- All Implemented Interfaces:
TextDisplayDriver<JLabel>
Understands functional testing of
JLabel
s:
- user input simulation
- state verification
- property value query
org.fest.swing.fixture
in your tests.-
Field Summary
FieldsFields inherited from class org.fest.swing.driver.ComponentDriver
robot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
requireText
(JLabel label, String expected) Asserts that the text of the
is equal to the specifiedJLabel
String
.void
requireText
(JLabel label, Pattern pattern) Asserts that the text of the
matches the given regular expression pattern.JLabel
Returns the text of the given
.JLabel
Methods inherited from class org.fest.swing.driver.JComponentDriver
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisible
Methods inherited from class org.fest.swing.driver.ContainerDriver
move, resize, resizeHeight, resizeWidth
Methods inherited from class org.fest.swing.driver.ComponentDriver
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
-
Field Details
-
TEXT_PROPERTY
- See Also:
-
-
Constructor Details
-
JLabelDriver
Creates a newJLabelDriver
.- Parameters:
robot
- the robot to use to simulate user input.
-
-
Method Details
-
requireText
Asserts that the text of the
is equal to the specifiedJLabel
String
.- Specified by:
requireText
in interfaceTextDisplayDriver<JLabel>
- Parameters:
label
- the targetJLabel
.expected
- the text to match.- Throws:
AssertionError
- if the text of theJLabel
is not equal to the given one.
-
requireText
Asserts that the text of the
matches the given regular expression pattern.JLabel
- Specified by:
requireText
in interfaceTextDisplayDriver<JLabel>
- Parameters:
label
- the targetJLabel
.pattern
- the regular expression pattern to match.- Throws:
AssertionError
- if the text of theJLabel
does not match the given regular expression pattern.NullPointerException
- if the given regular expression pattern isnull
.- Since:
- 1.2
-
textOf
Returns the text of the given
.JLabel
- Specified by:
textOf
in interfaceTextDisplayDriver<JLabel>
- Parameters:
label
- the givenJLabel
.- Returns:
- the text of the given
JLabel
.
-