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
JProgressBars:
- 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 voidassertIsInBetweenMinAndMax(int value, int min, int max) private voidassertIsInBetweenMinAndMax(JProgressBar progressBar, int value) voidrequireDeterminate(JProgressBar progressBar) Verifies that the givenis in determinate mode.JProgressBarvoidrequireIndeterminate(JProgressBar progressBar) Verifies that the givenis in indeterminate mode.JProgressBarprivate voidrequireIndeterminate(JProgressBar progressBar, boolean indeterminate) voidrequireText(JProgressBar progressBar, String expected) Asserts that the text of theis equal to the specifiedJProgressBarString.voidrequireText(JProgressBar progressBar, Pattern pattern) Asserts that the text of thematches the given regular expression pattern.JProgressBarvoidrequireValue(JProgressBar progressBar, int value) Verifies that the value of the givenis equal to the given one.JProgressBartextOf(JProgressBar progressBar) Returns the text of the given.JProgressBarprivate voidvalidateIsNotNull(Timeout timeout) voidwaitUntilIsDeterminate(JProgressBar progressBar) Waits until the value of the givenis in determinate mode.JProgressBarvoidwaitUntilIsDeterminate(JProgressBar progressBar, Timeout timeout) Waits until the value of the givenis in determinate mode.JProgressBarvoidwaitUntilValueIs(JProgressBar progressBar, int value) Waits until the value of the givenis equal to the given value.JProgressBarvoidwaitUntilValueIs(JProgressBar progressBar, int value, Timeout timeout) Waits until the value of the givenis equal to the given value.JProgressBarMethods 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
-
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 theis equal to the specifiedJProgressBarString.- Specified by:
requireTextin interfaceTextDisplayDriver<JProgressBar>- Parameters:
progressBar- the targetJProgressBar.expected- the text to match.- Throws:
AssertionError- if the text of theJProgressBaris not equal to the given one.- See Also:
-
requireText
Asserts that the text of thematches the given regular expression pattern.JProgressBar- Specified by:
requireTextin interfaceTextDisplayDriver<JProgressBar>- Parameters:
progressBar- the targetJProgressBar.pattern- the regular expression pattern to match.- Throws:
AssertionError- if the text of theJProgressBardoes not match the given regular expression pattern.NullPointerException- if the given regular expression pattern isnull.- See Also:
-
requireValue
Verifies that the value of the givenis equal to the given one.JProgressBar- Parameters:
progressBar- the targetJProgressBar.value- the expected value.- Throws:
AssertionError- if the value of theJProgressBaris not equal to the given one.
-
requireIndeterminate
Verifies that the givenis in indeterminate mode.JProgressBar- Parameters:
progressBar- the targetJProgressBar.- Throws:
AssertionError- if the givenJProgressBaris not in indeterminate mode.
-
requireDeterminate
Verifies that the givenis in determinate mode.JProgressBar- Parameters:
progressBar- the targetJProgressBar.- Throws:
AssertionError- if the givenJProgressBaris not in determinate mode.
-
requireIndeterminate
-
waitUntilValueIs
Waits until the value of the givenis 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 theJProgressBardoes not reach the expected value within 30 seconds.
-
waitUntilValueIs
Waits until the value of the givenis 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 theJProgressBardoes 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 givenis in determinate mode.JProgressBar- Parameters:
progressBar- the targetJProgressBar.- Throws:
WaitTimedOutError- if theJProgressBardoes not reach determinate mode within 30 seconds.
-
waitUntilIsDeterminate
Waits until the value of the givenis in determinate mode.JProgressBar- Parameters:
progressBar- the targetJProgressBar.timeout- the amount of time to wait.- Throws:
NullPointerException- if the given timeout isnull.WaitTimedOutError- if theJProgressBardoes not reach determinate mode within the specified timeout.
-
validateIsNotNull
-
textOf
Returns the text of the given.JProgressBar- Specified by:
textOfin interfaceTextDisplayDriver<JProgressBar>- Parameters:
progressBar- the targetJProgressBar.- Returns:
- the text of the given
.JProgressBar
-