Package org.fest.swing.fixture
Class JSplitPaneFixture
- All Implemented Interfaces:
ClientPropertyStorageFixture
,CommonComponentFixture
,FocusableComponentFixture
,JComponentFixture
,JPopupMenuInvokerFixture
,KeyboardInputSimulationFixture
,MouseInputSimulationFixture
,StateVerificationFixture
,ToolTipDisplayFixture
public class JSplitPaneFixture
extends ComponentFixture<JSplitPane>
implements CommonComponentFixture, JComponentFixture, JPopupMenuInvokerFixture
Understands functional testing of
JSplitPane
s:
- user input simulation
- state verification
- property value query
-
Field Summary
FieldsFields inherited from class org.fest.swing.fixture.ComponentFixture
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target
-
Constructor Summary
ConstructorsConstructorDescriptionJSplitPaneFixture
(Robot robot, String spinnerName) Creates a new
.JSplitPaneFixture
JSplitPaneFixture
(Robot robot, JSplitPane target) Creates a new
.JSplitPaneFixture
-
Method Summary
Modifier and TypeMethodDescriptionclick()
Simulates a user clicking this fixture's
.JSplitPane
click
(MouseButton button) Simulates a user clicking this fixture's
.JSplitPane
click
(MouseClickInfo mouseClickInfo) Simulates a user clicking this fixture's
.JSplitPane
clientProperty
(Object key) Returns the client property stored in this fixture's
, under the given key.JSplitPane
private void
Simulates a user double-clicking this fixture's
.JSplitPane
protected final void
driver
(JSplitPaneDriver newDriver) Sets the
to be used by this fixture.JSplitPaneDriver
focus()
Gives input focus to this fixture's
.JSplitPane
moveDividerTo
(int location) Simulates a user moving the divider of this fixture's
.JSplitPane
pressAndReleaseKey
(KeyPressInfo keyPressInfo) Simulates a user pressing given key with the given modifiers on this fixture's
.JSplitPane
pressAndReleaseKeys
(int... keyCodes) Simulates a user pressing and releasing the given keys on this fixture's
.JSplitPane
pressKey
(int keyCode) Simulates a user pressing the given key on this fixture's
.JSplitPane
releaseKey
(int keyCode) Simulates a user releasing the given key on this fixture's
.JSplitPane
Asserts that this fixture's
is disabled.JSplitPane
Asserts that this fixture's
is enabled.JSplitPane
requireEnabled
(Timeout timeout) Asserts that this fixture's
is enabled.JSplitPane
Asserts that this fixture's
has input focus.JSplitPane
Asserts that this fixture's
is not visible.JSplitPane
requireToolTip
(String expected) Asserts that the toolTip in this fixture's
matches the given value.JSplitPane
requireToolTip
(Pattern pattern) Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JSplitPane
Asserts that this fixture's
is visible.JSplitPane
Simulates a user right-clicking this fixture's
.JSplitPane
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JSplitPane
Shows a pop-up menu at the given point using this fixture's
as the invoker of the pop-up menu.JSplitPane
Methods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
-
Field Details
-
driver
-
-
Constructor Details
-
JSplitPaneFixture
Creates a new
.JSplitPaneFixture
- Parameters:
robot
- performs simulation of user events on the givenJSplitPane
.target
- theJSplitPane
to be managed by this fixture.- Throws:
NullPointerException
- ifrobot
isnull
.NullPointerException
- iftarget
isnull
.
-
JSplitPaneFixture
Creates a new
.JSplitPaneFixture
- Parameters:
robot
- performs simulation of user events on aJSplitPane
.spinnerName
- the name of theJSplitPane
to find using the givenRobot
.- Throws:
ComponentLookupException
- if a matchingJSplitPane
could not be found.ComponentLookupException
- if more than one matchingJSplitPane
is found.
-
-
Method Details
-
createDriver
private void createDriver() -
driver
Sets the
to be used by this fixture.JSplitPaneDriver
- Parameters:
newDriver
- the newJSplitPaneDriver
.- Throws:
NullPointerException
- if the given driver isnull
.
-
moveDividerTo
Simulates a user moving the divider of this fixture's
.JSplitPane
Since 1.2, this method respects the minimum and maximum values of the left and right components inside this fixture's
JSplitPane
.- Parameters:
location
- the location to move the divider to.- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.
-
click
Simulates a user clicking this fixture's
.JSplitPane
- Specified by:
click
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.
-
click
Simulates a user clicking this fixture's
.JSplitPane
- Specified by:
click
in interfaceMouseInputSimulationFixture
- Parameters:
button
- the button to click.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenMouseButton
isnull
.IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.
-
click
Simulates a user clicking this fixture's
.JSplitPane
- Specified by:
click
in interfaceMouseInputSimulationFixture
- Parameters:
mouseClickInfo
- specifies the button to click and the times the button should be clicked.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenMouseClickInfo
isnull
.IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.
-
doubleClick
Simulates a user double-clicking this fixture's
.JSplitPane
- Specified by:
doubleClick
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.
-
rightClick
Simulates a user right-clicking this fixture's
.JSplitPane
- Specified by:
rightClick
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.
-
focus
Gives input focus to this fixture's
.JSplitPane
- Specified by:
focus
in interfaceFocusableComponentFixture
- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.
-
pressAndReleaseKey
Simulates a user pressing given key with the given modifiers on this fixture's
. Modifiers is a mask from the availableJSplitPane
masks.InputEvent
- Specified by:
pressAndReleaseKey
in interfaceKeyboardInputSimulationFixture
- Parameters:
keyPressInfo
- specifies the key and modifiers to press.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenKeyPressInfo
isnull
.IllegalArgumentException
- if the given code is not a valid key code.IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.- See Also:
-
pressAndReleaseKeys
Simulates a user pressing and releasing the given keys on this fixture's
. This method does not affect the current focus.JSplitPane
- Specified by:
pressAndReleaseKeys
in interfaceKeyboardInputSimulationFixture
- Parameters:
keyCodes
- one or more codes of the keys to press.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the given array of codes isnull
.IllegalArgumentException
- if any of the given code is not a valid key code.IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.- See Also:
-
pressKey
Simulates a user pressing the given key on this fixture's
.JSplitPane
- Specified by:
pressKey
in interfaceKeyboardInputSimulationFixture
- Parameters:
keyCode
- the code of the key to press.- Returns:
- this fixture.
- Throws:
IllegalArgumentException
- if any of the given code is not a valid key code.IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.- See Also:
-
releaseKey
Simulates a user releasing the given key on this fixture's
.JSplitPane
- Specified by:
releaseKey
in interfaceKeyboardInputSimulationFixture
- Parameters:
keyCode
- the code of the key to release.- Returns:
- this fixture.
- Throws:
IllegalArgumentException
- if any of the given code is not a valid key code.IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.- See Also:
-
requireFocused
Asserts that this fixture's
has input focus.JSplitPane
- Specified by:
requireFocused
in interfaceFocusableComponentFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJSplitPane
does not have input focus.
-
requireEnabled
Asserts that this fixture's
is enabled.JSplitPane
- Specified by:
requireEnabled
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJSplitPane
is disabled.
-
requireEnabled
Asserts that this fixture's
is enabled.JSplitPane
- 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'sJSplitPane
is never enabled.
-
requireDisabled
Asserts that this fixture's
is disabled.JSplitPane
- Specified by:
requireDisabled
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJSplitPane
is enabled.
-
requireVisible
Asserts that this fixture's
is visible.JSplitPane
- Specified by:
requireVisible
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJSplitPane
is not visible.
-
requireNotVisible
Asserts that this fixture's
is not visible.JSplitPane
- Specified by:
requireNotVisible
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJSplitPane
is visible.
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given value.JSplitPane
- 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'sJSplitPane
does not match the given value.- Since:
- 1.2
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JSplitPane
- 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'sJSplitPane
does not match the given regular expression.- Since:
- 1.2
-
clientProperty
Returns the client property stored in this fixture's
, under the given key.JSplitPane
- 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
.- Since:
- 1.2
-
showPopupMenu
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JSplitPane
- Specified by:
showPopupMenu
in interfaceJPopupMenuInvokerFixture
- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.
-
showPopupMenuAt
Shows a pop-up menu at the given point using this fixture's
as the invoker of the pop-up menu.JSplitPane
- Specified by:
showPopupMenuAt
in interfaceJPopupMenuInvokerFixture
- Parameters:
p
- the given point where to show the pop-up menu.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException
- if this fixture'sJSplitPane
is disabled.IllegalStateException
- if this fixture'sJSplitPane
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.
-