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>
public class JLabelDriver
- extends JComponentDriver
- implements TextDisplayDriver<JLabel>
Understands functional testing of JLabels:
- user input simulation
- state verification
- property value query
This class is intended for internal use only. Please use the classes in the package
org.fest.swing.fixture in your tests.
- Author:
- Alex Ruiz
| 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JLabelDriver
public JLabelDriver(Robot robot)
- Creates a new
JLabelDriver.
- Parameters:
robot - the robot to use to simulate user input.
requireText
@RunsInEDT
public void requireText(JLabel label,
String expected)
- Asserts that the text of the
JLabel is equal to the specified String.
- Specified by:
requireText in interface TextDisplayDriver<JLabel>
- Parameters:
label - the target JLabel.expected - the text to match.
- Throws:
AssertionError - if the text of the JLabel is not equal to the given one.
requireText
@RunsInEDT
public void requireText(JLabel label,
Pattern pattern)
- Asserts that the text of the
JLabel matches the given regular expression pattern.
- Specified by:
requireText in interface TextDisplayDriver<JLabel>
- Parameters:
label - the target JLabel.pattern - the regular expression pattern to match.
- Throws:
AssertionError - if the text of the JLabel does not match the given regular expression pattern.
NullPointerException - if the given regular expression pattern is null.- Since:
- 1.2
textOf
@RunsInEDT
public String textOf(JLabel label)
- Returns the text of the given
JLabel.
- Specified by:
textOf in interface TextDisplayDriver<JLabel>
- Parameters:
label - the given JLabel.
- Returns:
- the text of the given
JLabel.
Copyright © 2007-2010 FEST (Fixtures for Easy Software Testing). All Rights Reserved.