@InternalApi public class JLabelDriver extends JComponentDriver implements TextDisplayDriver<JLabel>
Supports functional testing of JLabels.
Note: This class is intended for internal use only. Please use the classes in the package
org.assertj.swing.fixture in your tests.
robot| Constructor and Description |
|---|
JLabelDriver(Robot robot)
Creates a new
JLabelDriver. |
| Modifier and Type | Method and Description |
|---|---|
void |
requireText(JLabel label,
Pattern pattern)
Asserts that the text of the
JLabel matches the given regular expression pattern. |
void |
requireText(JLabel label,
String expected)
Asserts that the text of the
JLabel is equal to the specified String. |
String |
textOf(JLabel label)
Returns the text of the given
JLabel. |
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisibledoResizeHeight, doResizeWidth, isResizable, move, resizebackgroundOf, checkInEdtEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, fontOf, foregroundOf, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowingpublic JLabelDriver(@Nonnull Robot robot)
JLabelDriver.robot - the robot to use to simulate user input.@RunsInEDT public void requireText(@Nonnull JLabel label, @Nullable String expected)
JLabel is equal to the specified String.requireText in interface TextDisplayDriver<JLabel>label - the target JLabel.expected - the text to match.AssertionError - if the text of the JLabel is not equal to the given one.@RunsInEDT public void requireText(@Nonnull JLabel label, @Nonnull Pattern pattern)
JLabel matches the given regular expression pattern.requireText in interface TextDisplayDriver<JLabel>label - the target JLabel.pattern - the regular expression pattern to match.AssertionError - if the text of the JLabel does not match the given regular expression pattern.NullPointerException - if the given regular expression pattern is null.@RunsInEDT @Nullable public String textOf(@Nonnull JLabel label)
JLabel.textOf in interface TextDisplayDriver<JLabel>label - the given JLabel.JLabel.Copyright © 2014 AssertJ. All rights reserved.