Package org.fest.swing.fixture
Class JProgressBarFixture
- All Implemented Interfaces:
ClientPropertyStorageFixture
,JComponentFixture
,StateVerificationFixture
,TextDisplayFixture
,ToolTipDisplayFixture
public class JProgressBarFixture
extends ComponentFixture<JProgressBar>
implements StateVerificationFixture, JComponentFixture, TextDisplayFixture
Understands functional testing of
JProgressBar
s:
- state verification
- property value query
- Since:
- 1.2
-
Field Summary
FieldsFields inherited from class org.fest.swing.fixture.ComponentFixture
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target
-
Constructor Summary
ConstructorsConstructorDescriptionJProgressBarFixture
(Robot robot, String labelName) Creates a new
.JProgressBarFixture
JProgressBarFixture
(Robot robot, JProgressBar target) Creates a new
.JProgressBarFixture
-
Method Summary
Modifier and TypeMethodDescriptionclientProperty
(Object key) Returns the client property stored in this fixture's
, under the given key.JProgressBar
private void
protected final void
driver
(JProgressBarDriver newDriver) Sets the
to be used by this fixture.JProgressBarDriver
Asserts that this fixture's
is in determinate mode.JProgressBar
Asserts that this fixture's
is disabled.JProgressBar
Asserts that this fixture's
is enabled.JProgressBar
requireEnabled
(Timeout timeout) Asserts that this fixture's
is enabled.JProgressBar
Asserts that this fixture's
is in indeterminate mode.JProgressBar
Asserts that this fixture's
is not visible.JProgressBar
requireText
(String expected) Asserts that the text of this fixture's
is equal to the specifiedJProgressBar
String
.requireText
(Pattern pattern) Asserts that the text of this fixture's
matches the given regular expression pattern.JProgressBar
requireToolTip
(String expected) Asserts that the toolTip in this fixture's
matches the given value.JProgressBar
requireToolTip
(Pattern pattern) Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JProgressBar
requireValue
(int value) Asserts that the value of this fixture's
is equal to the given one.JProgressBar
Asserts that this fixture's
is visible.JProgressBar
text()
Returns the text of this fixture's
.JProgressBar
Waits until the value of this fixture's
is in determinate mode.JProgressBar
waitUntilIsDeterminate
(Timeout timeout) Waits until the value of this fixture's
is in determinate mode.JProgressBar
waitUntilValueIs
(int value) Waits until the value of this fixture's
is equal to the given value.JProgressBar
waitUntilValueIs
(int value, Timeout timeout) Waits until the value of this fixture's
is equal to the given value.JProgressBar
Methods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
-
Field Details
-
driver
-
-
Constructor Details
-
JProgressBarFixture
Creates a new
.JProgressBarFixture
- Parameters:
robot
- performs simulation of user events on the givenJProgressBar
.target
- theJProgressBar
to be managed by this fixture.- Throws:
NullPointerException
- ifrobot
isnull
.NullPointerException
- iftarget
isnull
.
-
JProgressBarFixture
Creates a new
.JProgressBarFixture
- Parameters:
robot
- performs simulation of user events on aJProgressBar
.labelName
- the name of theJProgressBar
to find using the givenRobot
.- Throws:
NullPointerException
- ifrobot
isnull
.ComponentLookupException
- if a matchingJProgressBar
could not be found.ComponentLookupException
- if more than one matchingJProgressBar
is found.
-
-
Method Details
-
createDriver
private void createDriver() -
driver
Sets the
to be used by this fixture.JProgressBarDriver
- Parameters:
newDriver
- the newJProgressBarDriver
.- Throws:
NullPointerException
- if the given driver isnull
.
-
requireValue
Asserts that the value of this fixture's
is equal to the given one.JProgressBar
- Parameters:
value
- the expected value.- Returns:
- this fixture.
- Throws:
AssertionError
- if the value of this fixture'sJProgressBar
is not equal to the given one.
-
requireDeterminate
Asserts that this fixture's
is in determinate mode.JProgressBar
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJProgressBar
is not in determinate mode.
-
requireIndeterminate
Asserts that this fixture's
is in indeterminate mode.JProgressBar
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJProgressBar
is not in indeterminate mode.
-
text
Returns the text of this fixture's
.JProgressBar
- Specified by:
text
in interfaceTextDisplayFixture
- Returns:
- the text of this fixture's
JProgressBar
.
-
requireText
Asserts that the text of this fixture's
is equal to the specifiedJProgressBar
String
.- Specified by:
requireText
in interfaceTextDisplayFixture
- Parameters:
expected
- the text to match.- Returns:
- this fixture.
- Throws:
AssertionError
- if the text of this fixture'sJProgressBar
is not equal to the given one.
-
requireText
Asserts that the text of this fixture's
matches the given regular expression pattern.JProgressBar
- Specified by:
requireText
in interfaceTextDisplayFixture
- Parameters:
pattern
- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
AssertionError
- if the text of this fixture'sJProgressBar
does not match the given regular expression pattern.NullPointerException
- if the given regular expression pattern isnull
.
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given value.JProgressBar
- Specified by:
requireToolTip
in interfaceToolTipDisplayFixture
- Parameters:
expected
- the given value. It can be a regular expression.- Returns:
- this fixture.
- Throws:
AssertionError
- if the toolTip in this fixture'sJProgressBar
does not match the given value.
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JProgressBar
- Specified by:
requireToolTip
in interfaceToolTipDisplayFixture
- Parameters:
pattern
- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the given regular expression pattern isnull
.AssertionError
- if the toolTip in this fixture'sJProgressBar
does not match the given regular expression pattern.
-
requireEnabled
Asserts that this fixture's
is enabled.JProgressBar
- Specified by:
requireEnabled
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJProgressBar
is disabled.
-
requireEnabled
Asserts that this fixture's
is enabled.JProgressBar
- Specified by:
requireEnabled
in interfaceStateVerificationFixture
- Parameters:
timeout
- the time this fixture will wait for the component to be enabled.- Returns:
- this fixture.
- Throws:
WaitTimedOutError
- if this fixture'sJProgressBar
is never enabled.
-
requireDisabled
Asserts that this fixture's
is disabled.JProgressBar
- Specified by:
requireDisabled
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJProgressBar
is enabled.
-
requireVisible
Asserts that this fixture's
is visible.JProgressBar
- Specified by:
requireVisible
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJProgressBar
is not visible.
-
requireNotVisible
Asserts that this fixture's
is not visible.JProgressBar
- Specified by:
requireNotVisible
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJProgressBar
is visible.
-
clientProperty
Returns the client property stored in this fixture's
, under the given key.JProgressBar
- Specified by:
clientProperty
in interfaceClientPropertyStorageFixture
- Parameters:
key
- the key to use to retrieve the client property.- Returns:
- the value of the client property stored under the given key, or
null
if the property was not found. - Throws:
NullPointerException
- if the given key isnull
.
-
waitUntilValueIs
Waits until the value of this fixture's
is equal to the given value.JProgressBar
- Parameters:
value
- the expected value.- Returns:
- this fixture.
- 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 this fixture's
is equal to the given value.JProgressBar
- Parameters:
value
- the expected value.timeout
- the amount of time to wait.- Returns:
- this fixture.
- 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.
-
waitUntilIsDeterminate
Waits until the value of this fixture's
is in determinate mode.JProgressBar
- Returns:
- this fixture.
- Throws:
WaitTimedOutError
- if theJProgressBar
does not reach determinate mode within 30 seconds.
-
waitUntilIsDeterminate
Waits until the value of this fixture's
is in determinate mode.JProgressBar
- Parameters:
timeout
- the amount of time to wait.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the given timeout isnull
.WaitTimedOutError
- if theJProgressBar
does not reach determinate mode within the specified timeout.
-