Package org.fest.swing.driver
Class JProgressBarDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JProgressBarDriver
- All Implemented Interfaces:
TextDisplayDriver<JProgressBar>
Understands functional testing of
JProgressBar
s:
- state verification
- property value query
org.fest.swing.fixture
in your tests.- Since:
- 1.2
-
Field Summary
FieldsFields inherited from class org.fest.swing.driver.ComponentDriver
robot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertIsInBetweenMinAndMax
(int value, int min, int max) private void
assertIsInBetweenMinAndMax
(JProgressBar progressBar, int value) void
requireDeterminate
(JProgressBar progressBar) Verifies that the given
is in determinate mode.JProgressBar
void
requireIndeterminate
(JProgressBar progressBar) Verifies that the given
is in indeterminate mode.JProgressBar
private void
requireIndeterminate
(JProgressBar progressBar, boolean indeterminate) void
requireText
(JProgressBar progressBar, String expected) Asserts that the text of the
is equal to the specifiedJProgressBar
String
.void
requireText
(JProgressBar progressBar, Pattern pattern) Asserts that the text of the
matches the given regular expression pattern.JProgressBar
void
requireValue
(JProgressBar progressBar, int value) Verifies that the value of the given
is equal to the given one.JProgressBar
textOf
(JProgressBar progressBar) Returns the text of the given
.JProgressBar
private void
validateIsNotNull
(Timeout timeout) void
waitUntilIsDeterminate
(JProgressBar progressBar) Waits until the value of the given
is in determinate mode.JProgressBar
void
waitUntilIsDeterminate
(JProgressBar progressBar, Timeout timeout) Waits until the value of the given
is in determinate mode.JProgressBar
void
waitUntilValueIs
(JProgressBar progressBar, int value) Waits until the value of the given
is equal to the given value.JProgressBar
void
waitUntilValueIs
(JProgressBar progressBar, int value, Timeout timeout) Waits until the value of the given
is equal to the given value.JProgressBar
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
-
DEFAULT_TIMEOUT
-
TEXT_PROPERTY
- See Also:
-
-
Constructor Details
-
JProgressBarDriver
Creates a newJProgressBarDriver
.- Parameters:
robot
- the robot to use to simulate user input.
-
-
Method Details
-
requireText
Asserts that the text of the
is equal to the specifiedJProgressBar
String
.- Specified by:
requireText
in interfaceTextDisplayDriver<JProgressBar>
- Parameters:
progressBar
- the targetJProgressBar
.expected
- the text to match.- Throws:
AssertionError
- if the text of theJProgressBar
is not equal to the given one.- See Also:
-
requireText
Asserts that the text of the
matches the given regular expression pattern.JProgressBar
- Specified by:
requireText
in interfaceTextDisplayDriver<JProgressBar>
- Parameters:
progressBar
- the targetJProgressBar
.pattern
- the regular expression pattern to match.- Throws:
AssertionError
- if the text of theJProgressBar
does not match the given regular expression pattern.NullPointerException
- if the given regular expression pattern isnull
.- See Also:
-
requireValue
Verifies that the value of the given
is equal to the given one.JProgressBar
- Parameters:
progressBar
- the targetJProgressBar
.value
- the expected value.- Throws:
AssertionError
- if the value of theJProgressBar
is not equal to the given one.
-
requireIndeterminate
Verifies that the given
is in indeterminate mode.JProgressBar
- Parameters:
progressBar
- the targetJProgressBar
.- Throws:
AssertionError
- if the givenJProgressBar
is not in indeterminate mode.
-
requireDeterminate
Verifies that the given
is in determinate mode.JProgressBar
- Parameters:
progressBar
- the targetJProgressBar
.- Throws:
AssertionError
- if the givenJProgressBar
is not in determinate mode.
-
requireIndeterminate
-
waitUntilValueIs
Waits until the value of the given
is equal to the given value.JProgressBar
- Parameters:
progressBar
- the targetJProgressBar
.value
- the expected value.- Throws:
IllegalArgumentException
- if the given value is less than theJProgressBar
's minimum value.IllegalArgumentException
- if the given value is greater than theJProgressBar
's maximum value.WaitTimedOutError
- if the value of theJProgressBar
does not reach the expected value within 30 seconds.
-
waitUntilValueIs
Waits until the value of the given
is equal to the given value.JProgressBar
- Parameters:
progressBar
- the targetJProgressBar
.value
- the expected value.timeout
- the amount of time to wait.- Throws:
IllegalArgumentException
- if the given value is less than theJProgressBar
's minimum value.IllegalArgumentException
- if the given value is greater than theJProgressBar
's maximum value.NullPointerException
- if the given timeout isnull
.WaitTimedOutError
- if the value of theJProgressBar
does not reach the expected value within the specified timeout.
-
assertIsInBetweenMinAndMax
-
assertIsInBetweenMinAndMax
private void assertIsInBetweenMinAndMax(int value, int min, int max) -
waitUntilIsDeterminate
Waits until the value of the given
is in determinate mode.JProgressBar
- Parameters:
progressBar
- the targetJProgressBar
.- Throws:
WaitTimedOutError
- if theJProgressBar
does not reach determinate mode within 30 seconds.
-
waitUntilIsDeterminate
Waits until the value of the given
is in determinate mode.JProgressBar
- Parameters:
progressBar
- the targetJProgressBar
.timeout
- the amount of time to wait.- Throws:
NullPointerException
- if the given timeout isnull
.WaitTimedOutError
- if theJProgressBar
does not reach determinate mode within the specified timeout.
-
validateIsNotNull
-
textOf
Returns the text of the given
.JProgressBar
- Specified by:
textOf
in interfaceTextDisplayDriver<JProgressBar>
- Parameters:
progressBar
- the targetJProgressBar
.- Returns:
- the text of the given
.JProgressBar
-