@InternalApi public class JProgressBarDriver extends JComponentDriver implements TextDisplayDriver<JProgressBar>
Supports functional testing of JProgressBar
s.
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 |
---|
JProgressBarDriver(Robot robot)
Creates a new
JProgressBarDriver . |
Modifier and Type | Method and Description |
---|---|
void |
requireDeterminate(JProgressBar progressBar)
Verifies that the given
JProgressBar is in determinate mode. |
void |
requireIndeterminate(JProgressBar progressBar)
Verifies that the given
JProgressBar is in indeterminate mode. |
void |
requireText(JProgressBar progressBar,
Pattern pattern)
Asserts that the text of the
JProgressBar matches the given regular expression pattern. |
void |
requireText(JProgressBar progressBar,
String expected)
Asserts that the text of the
JProgressBar is equal to the specified String . |
void |
requireValue(JProgressBar progressBar,
int value)
Verifies that the value of the given
JProgressBar is equal to the given one. |
String |
textOf(JProgressBar progressBar)
Returns the text of the given
JProgressBar . |
void |
waitUntilIsDeterminate(JProgressBar progressBar)
Waits until the value of the given
JProgressBar is in determinate mode. |
void |
waitUntilIsDeterminate(JProgressBar progressBar,
Timeout timeout)
Waits until the value of the given
JProgressBar is in determinate mode. |
void |
waitUntilValueIs(JProgressBar progressBar,
int value)
Waits until the value of the given
JProgressBar is equal to the given value. |
void |
waitUntilValueIs(JProgressBar progressBar,
int value,
Timeout timeout)
Waits until the value of the given
JProgressBar is equal to the given value. |
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisible
doResizeHeight, doResizeWidth, isResizable, move, resize
backgroundOf, checkClickAllowed, checkInEdtEnabledAndShowing, checkInEdtShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, drop, focus, focusAndWaitForFocusGain, fontOf, foregroundOf, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, pressKeyWhileRunning, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
public JProgressBarDriver(@Nonnull Robot robot)
JProgressBarDriver
.robot
- the robot to use to simulate user input.@RunsInEDT public void requireText(@Nonnull JProgressBar progressBar, @Nullable String expected)
JProgressBar
is equal to the specified String
.requireText
in interface TextDisplayDriver<JProgressBar>
progressBar
- the target JProgressBar
.expected
- the text to match.AssertionError
- if the text of the JProgressBar
is not equal to the given one.JProgressBar.getString()
@RunsInEDT public void requireText(@Nonnull JProgressBar progressBar, @Nonnull Pattern pattern)
JProgressBar
matches the given regular expression pattern.requireText
in interface TextDisplayDriver<JProgressBar>
progressBar
- the target JProgressBar
.pattern
- the regular expression pattern to match.AssertionError
- if the text of the JProgressBar
does not match the given regular expression pattern.NullPointerException
- if the given regular expression pattern is null
.JProgressBar.getString()
@RunsInEDT public void requireValue(@Nonnull JProgressBar progressBar, int value)
JProgressBar
is equal to the given one.progressBar
- the target JProgressBar
.value
- the expected value.AssertionError
- if the value of the JProgressBar
is not equal to the given one.@RunsInEDT public void requireIndeterminate(@Nonnull JProgressBar progressBar)
JProgressBar
is in indeterminate mode.progressBar
- the target JProgressBar
.AssertionError
- if the given JProgressBar
is not in indeterminate mode.@RunsInEDT public void requireDeterminate(@Nonnull JProgressBar progressBar)
JProgressBar
is in determinate mode.progressBar
- the target JProgressBar
.AssertionError
- if the given JProgressBar
is not in determinate mode.@RunsInEDT public void waitUntilValueIs(@Nonnull JProgressBar progressBar, int value)
JProgressBar
is equal to the given value.progressBar
- the target JProgressBar
.value
- the expected value.IllegalArgumentException
- if the given value is less than the JProgressBar
's minimum value.IllegalArgumentException
- if the given value is greater than the JProgressBar
's maximum value.WaitTimedOutError
- if the value of the JProgressBar
does not reach the
expected value within 30
seconds.@RunsInEDT public void waitUntilValueIs(@Nonnull JProgressBar progressBar, int value, @Nonnull Timeout timeout)
JProgressBar
is equal to the given value.progressBar
- the target JProgressBar
.value
- the expected value.timeout
- the amount of time to wait.IllegalArgumentException
- if the given value is less than the JProgressBar
's minimum value.IllegalArgumentException
- if the given value is greater than the JProgressBar
's maximum value.NullPointerException
- if the given timeout is null
.WaitTimedOutError
- if the value of the JProgressBar
does not reach the
expected value within the
specified timeout.@RunsInEDT public void waitUntilIsDeterminate(@Nonnull JProgressBar progressBar)
JProgressBar
is in determinate mode.progressBar
- the target JProgressBar
.WaitTimedOutError
- if the JProgressBar
does not reach determinate mode
within 30 seconds.@RunsInEDT public void waitUntilIsDeterminate(@Nonnull JProgressBar progressBar, @Nonnull Timeout timeout)
JProgressBar
is in determinate mode.progressBar
- the target JProgressBar
.timeout
- the amount of time to wait.NullPointerException
- if the given timeout is null
.WaitTimedOutError
- if the JProgressBar
does not reach determinate mode
within the specified timeout.@RunsInEDT @Nullable public String textOf(@Nonnull JProgressBar progressBar)
JProgressBar
.textOf
in interface TextDisplayDriver<JProgressBar>
progressBar
- the target JProgressBar
.JProgressBar
.Copyright © 2014–2019 AssertJ. All rights reserved.