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
JProgressBars:
- 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.JProgressBarFixtureJProgressBarFixture(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.JProgressBarprivate voidprotected final voiddriver(JProgressBarDriver newDriver) Sets theto be used by this fixture.JProgressBarDriverAsserts that this fixture'sis in determinate mode.JProgressBarAsserts that this fixture'sis disabled.JProgressBarAsserts that this fixture'sis enabled.JProgressBarrequireEnabled(Timeout timeout) Asserts that this fixture'sis enabled.JProgressBarAsserts that this fixture'sis in indeterminate mode.JProgressBarAsserts that this fixture'sis not visible.JProgressBarrequireText(String expected) Asserts that the text of this fixture'sis equal to the specifiedJProgressBarString.requireText(Pattern pattern) Asserts that the text of this fixture'smatches the given regular expression pattern.JProgressBarrequireToolTip(String expected) Asserts that the toolTip in this fixture'smatches the given value.JProgressBarrequireToolTip(Pattern pattern) Asserts that the toolTip in this fixture'smatches the given regular expression pattern.JProgressBarrequireValue(int value) Asserts that the value of this fixture'sis equal to the given one.JProgressBarAsserts that this fixture'sis visible.JProgressBartext()Returns the text of this fixture's.JProgressBarWaits until the value of this fixture'sis in determinate mode.JProgressBarwaitUntilIsDeterminate(Timeout timeout) Waits until the value of this fixture'sis in determinate mode.JProgressBarwaitUntilValueIs(int value) Waits until the value of this fixture'sis equal to the given value.JProgressBarwaitUntilValueIs(int value, Timeout timeout) Waits until the value of this fixture'sis equal to the given value.JProgressBarMethods 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- theJProgressBarto be managed by this fixture.- Throws:
NullPointerException- ifrobotisnull.NullPointerException- iftargetisnull.
-
JProgressBarFixture
Creates a new.JProgressBarFixture- Parameters:
robot- performs simulation of user events on aJProgressBar.labelName- the name of theJProgressBarto find using the givenRobot.- Throws:
NullPointerException- ifrobotisnull.ComponentLookupException- if a matchingJProgressBarcould not be found.ComponentLookupException- if more than one matchingJProgressBaris found.
-
-
Method Details
-
createDriver
private void createDriver() -
driver
Sets theto 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'sis equal to the given one.JProgressBar- Parameters:
value- the expected value.- Returns:
- this fixture.
- Throws:
AssertionError- if the value of this fixture'sJProgressBaris not equal to the given one.
-
requireDeterminate
Asserts that this fixture'sis in determinate mode.JProgressBar- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJProgressBaris not in determinate mode.
-
requireIndeterminate
Asserts that this fixture'sis in indeterminate mode.JProgressBar- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJProgressBaris not in indeterminate mode.
-
text
Returns the text of this fixture's.JProgressBar- Specified by:
textin interfaceTextDisplayFixture- Returns:
- the text of this fixture's
JProgressBar.
-
requireText
Asserts that the text of this fixture'sis equal to the specifiedJProgressBarString.- Specified by:
requireTextin interfaceTextDisplayFixture- Parameters:
expected- the text to match.- Returns:
- this fixture.
- Throws:
AssertionError- if the text of this fixture'sJProgressBaris not equal to the given one.
-
requireText
Asserts that the text of this fixture'smatches the given regular expression pattern.JProgressBar- Specified by:
requireTextin interfaceTextDisplayFixture- Parameters:
pattern- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
AssertionError- if the text of this fixture'sJProgressBardoes not match the given regular expression pattern.NullPointerException- if the given regular expression pattern isnull.
-
requireToolTip
Asserts that the toolTip in this fixture'smatches the given value.JProgressBar- Specified by:
requireToolTipin interfaceToolTipDisplayFixture- Parameters:
expected- the given value. It can be a regular expression.- Returns:
- this fixture.
- Throws:
AssertionError- if the toolTip in this fixture'sJProgressBardoes not match the given value.
-
requireToolTip
Asserts that the toolTip in this fixture'smatches the given regular expression pattern.JProgressBar- Specified by:
requireToolTipin 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'sJProgressBardoes not match the given regular expression pattern.
-
requireEnabled
Asserts that this fixture'sis enabled.JProgressBar- Specified by:
requireEnabledin interfaceStateVerificationFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJProgressBaris disabled.
-
requireEnabled
Asserts that this fixture'sis enabled.JProgressBar- Specified by:
requireEnabledin interfaceStateVerificationFixture- Parameters:
timeout- the time this fixture will wait for the component to be enabled.- Returns:
- this fixture.
- Throws:
WaitTimedOutError- if this fixture'sJProgressBaris never enabled.
-
requireDisabled
Asserts that this fixture'sis disabled.JProgressBar- Specified by:
requireDisabledin interfaceStateVerificationFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJProgressBaris enabled.
-
requireVisible
Asserts that this fixture'sis visible.JProgressBar- Specified by:
requireVisiblein interfaceStateVerificationFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJProgressBaris not visible.
-
requireNotVisible
Asserts that this fixture'sis not visible.JProgressBar- Specified by:
requireNotVisiblein interfaceStateVerificationFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJProgressBaris visible.
-
clientProperty
Returns the client property stored in this fixture's, under the given key.JProgressBar- Specified by:
clientPropertyin 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
nullif the property was not found. - Throws:
NullPointerException- if the given key isnull.
-
waitUntilValueIs
Waits until the value of this fixture'sis 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 theJProgressBardoes not reach the expected value within 30 seconds.
-
waitUntilValueIs
Waits until the value of this fixture'sis 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 theJProgressBardoes not reach the expected value within the specified timeout.
-
waitUntilIsDeterminate
Waits until the value of this fixture'sis in determinate mode.JProgressBar- Returns:
- this fixture.
- Throws:
WaitTimedOutError- if theJProgressBardoes not reach determinate mode within 30 seconds.
-
waitUntilIsDeterminate
Waits until the value of this fixture'sis in determinate mode.JProgressBar- Parameters:
timeout- the amount of time to wait.- Returns:
- this fixture.
- Throws:
NullPointerException- if the given timeout isnull.WaitTimedOutError- if theJProgressBardoes not reach determinate mode within the specified timeout.
-