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
JLabels:
- 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 TypeMethodDescriptionvoidrequireText(JLabel label, String expected) Asserts that the text of theis equal to the specifiedJLabelString.voidrequireText(JLabel label, Pattern pattern) Asserts that the text of thematches the given regular expression pattern.JLabelReturns the text of the given.JLabelMethods inherited from class org.fest.swing.driver.JComponentDriver
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisibleMethods inherited from class org.fest.swing.driver.ContainerDriver
move, resize, resizeHeight, resizeWidthMethods 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 theis equal to the specifiedJLabelString.- Specified by:
requireTextin interfaceTextDisplayDriver<JLabel>- Parameters:
label- the targetJLabel.expected- the text to match.- Throws:
AssertionError- if the text of theJLabelis not equal to the given one.
-
requireText
Asserts that the text of thematches the given regular expression pattern.JLabel- Specified by:
requireTextin interfaceTextDisplayDriver<JLabel>- Parameters:
label- the targetJLabel.pattern- the regular expression pattern to match.- Throws:
AssertionError- if the text of theJLabeldoes 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:
textOfin interfaceTextDisplayDriver<JLabel>- Parameters:
label- the givenJLabel.- Returns:
- the text of the given
JLabel.
-