Package org.fest.swing.fixture
Class JInternalFrameFixture
java.lang.Object
org.fest.swing.fixture.ComponentFixture<T>
org.fest.swing.fixture.ContainerFixture<JInternalFrame>
org.fest.swing.fixture.JInternalFrameFixture
- All Implemented Interfaces:
ClientPropertyStorageFixture
,CommonComponentFixture
,ComponentContainerFixture
,FocusableComponentFixture
,FrameLikeFixture
,JComponentFixture
,JPopupMenuInvokerFixture
,KeyboardInputSimulationFixture
,MouseInputSimulationFixture
,StateVerificationFixture
,ToolTipDisplayFixture
,WindowLikeContainerFixture
public class JInternalFrameFixture
extends ContainerFixture<JInternalFrame>
implements CommonComponentFixture, FrameLikeFixture, JComponentFixture, JPopupMenuInvokerFixture
Understands functional testing of
JInternalFrame
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
Fields inherited from interface org.fest.swing.fixture.ComponentContainerFixture
DEFAULT_DIALOG_LOOKUP_TIMEOUT
-
Constructor Summary
ConstructorsConstructorDescriptionJInternalFrameFixture
(Robot robot, String internalFrameName) Creates a new
.JInternalFrameFixture
JInternalFrameFixture
(Robot robot, JInternalFrame target) Creates a new
.JInternalFrameFixture
-
Method Summary
Modifier and TypeMethodDescriptionclick()
Simulates a user clicking this fixture's
.JInternalFrame
click
(MouseButton button) Simulates a user clicking this fixture's
.JInternalFrame
click
(MouseClickInfo mouseClickInfo) Simulates a user clicking this fixture's
.JInternalFrame
clientProperty
(Object key) Returns the client property stored in this fixture's
, under the given key.JInternalFrame
void
close()
Simulates a user closing this fixture's
.JInternalFrame
private void
Simulates a user deiconifying this fixture's
.JInternalFrame
Simulates a user double-clicking this fixture's
.JInternalFrame
protected final void
driver
(JInternalFrameDriver newDriver) Sets the
to be used by this fixture.JInternalFrameDriver
focus()
Gives input focus to this fixture's
.JInternalFrame
iconify()
Simulates a user iconifying this fixture's
.JInternalFrame
maximize()
Simulates a user maximizing this fixture's
, deconifying it first if it is iconified.JInternalFrame
Simulates a user moving this fixture's
to the given point.JInternalFrame
Brings this fixture's
to the back.JInternalFrame
Brings this fixture's
to the front.JInternalFrame
Simulates a user normalizing this fixture's
, deconifying it first if it is iconified.JInternalFrame
pressAndReleaseKey
(KeyPressInfo keyPressInfo) Simulates a user pressing given key with the given modifiers on this fixture's
.JInternalFrame
pressAndReleaseKeys
(int... keyCodes) Simulates a user pressing and releasing the given keys on this fixture's
.JInternalFrame
pressKey
(int keyCode) Simulates a user pressing given key on this fixture's
.JInternalFrame
releaseKey
(int keyCode) Simulates a user releasing the given key on this fixture's
.JInternalFrame
Asserts that this fixture's
is disabled.JInternalFrame
Asserts that this fixture's
is enabled.JInternalFrame
requireEnabled
(Timeout timeout) Asserts that this fixture's
is enabled.JInternalFrame
Asserts that this fixture's
has input focus.JInternalFrame
Asserts that this fixture's
is not visible.JInternalFrame
requireSize
(Dimension size) Asserts that the size of this fixture's
is equal to given one.JInternalFrame
requireToolTip
(String expected) Asserts that the toolTip in this fixture's
matches the given value.JInternalFrame
requireToolTip
(Pattern pattern) Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JInternalFrame
Asserts that this fixture's
is visible.JInternalFrame
resizeHeightTo
(int height) Simulates a user resizing vertically this fixture's
.JInternalFrame
Simulates a user resizing this fixture's
.JInternalFrame
resizeWidthTo
(int width) Simulates a user resizing horizontally this fixture's
.JInternalFrame
Simulates a user right-clicking this fixture's
.JInternalFrame
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JInternalFrame
Shows a pop-up menu at the given point using this fixture's
as the invoker of the pop-up menu.JInternalFrame
Methods inherited from class org.fest.swing.fixture.ContainerFixture
button, button, button, checkBox, checkBox, checkBox, comboBox, comboBox, comboBox, dialog, dialog, dialog, dialog, dialog, dialog, fileChooser, fileChooser, fileChooser, fileChooser, fileChooser, fileChooser, find, findByName, findByType, finder, label, label, label, list, list, list, menuItem, menuItem, menuItemWithPath, optionPane, optionPane, panel, panel, panel, progressBar, progressBar, progressBar, radioButton, radioButton, radioButton, scrollBar, scrollBar, scrollBar, scrollPane, scrollPane, scrollPane, slider, slider, slider, spinner, spinner, spinner, splitPane, splitPane, splitPane, tabbedPane, tabbedPane, tabbedPane, table, table, table, textBox, textBox, textBox, toggleButton, toggleButton, toggleButton, toolBar, toolBar, toolBar, tree, tree, tree, with
Methods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
-
Field Details
-
driver
-
-
Constructor Details
-
JInternalFrameFixture
Creates a new
.JInternalFrameFixture
- Parameters:
robot
- performs simulation of user events on aJInternalFrame
.internalFrameName
- the name of theJInternalFrame
to find using the givenRobot
.- Throws:
NullPointerException
- ifrobot
isnull
.ComponentLookupException
- if a matchingJInternalFrame
could not be found.ComponentLookupException
- if more than one matchingJInternalFrame
is found.
-
JInternalFrameFixture
Creates a new
.JInternalFrameFixture
- Parameters:
robot
- performs simulation of user events on the givenJInternalFrame
.target
- theJInternalFrame
to be managed by this fixture.- Throws:
NullPointerException
- ifrobot
isnull
.NullPointerException
- iftarget
isnull
.
-
-
Method Details
-
createDriver
private void createDriver() -
driver
Sets the
to be used by this fixture.JInternalFrameDriver
- Parameters:
newDriver
- the newJInternalFrameDriver
.- Throws:
NullPointerException
- if the given driver isnull
.
-
moveToFront
Brings this fixture's
to the front.JInternalFrame
- Specified by:
moveToFront
in interfaceWindowLikeContainerFixture
- Returns:
- this fixture.
-
moveToBack
Brings this fixture's
to the back.JInternalFrame
- Specified by:
moveToBack
in interfaceWindowLikeContainerFixture
- Returns:
- this fixture.
-
deiconify
Simulates a user deiconifying this fixture's
.JInternalFrame
- Specified by:
deiconify
in interfaceFrameLikeFixture
- Returns:
- this fixture.
- Throws:
ActionFailedException
- if theJInternalFrame
vetoes the action.
-
iconify
Simulates a user iconifying this fixture's
.JInternalFrame
- Specified by:
iconify
in interfaceFrameLikeFixture
- Returns:
- this fixture.
- Throws:
ActionFailedException
- if the givenJInternalFrame
is not iconifiable.ActionFailedException
- if theJInternalFrame
vetoes the action.
-
maximize
Simulates a user maximizing this fixture's
, deconifying it first if it is iconified.JInternalFrame
- Specified by:
maximize
in interfaceFrameLikeFixture
- Returns:
- this fixture.
- Throws:
ActionFailedException
- if the givenJInternalFrame
is not maximizable.ActionFailedException
- if theJInternalFrame
vetoes the action.
-
normalize
Simulates a user normalizing this fixture's
, deconifying it first if it is iconified.JInternalFrame
- Specified by:
normalize
in interfaceFrameLikeFixture
- Returns:
- this fixture.
- Throws:
ActionFailedException
- if theJInternalFrame
vetoes the action.
-
close
public void close()Simulates a user closing this fixture's
.JInternalFrame
- Specified by:
close
in interfaceWindowLikeContainerFixture
- Throws:
ActionFailedException
- if theJInternalFrame
is not closable.
-
requireSize
Asserts that the size of this fixture's
is equal to given one.JInternalFrame
- Specified by:
requireSize
in interfaceWindowLikeContainerFixture
- Parameters:
size
- the given size to match.- Returns:
- this fixture.
- Throws:
AssertionError
- if the size of this fixture'sJInternalFrame
is not equal to the given size.
-
resizeWidthTo
Simulates a user resizing horizontally this fixture's
.JInternalFrame
- Specified by:
resizeWidthTo
in interfaceWindowLikeContainerFixture
- Parameters:
width
- the width that this fixture'sJInternalFrame
should have after being resized.- Returns:
- this fixture.
-
resizeHeightTo
Simulates a user resizing vertically this fixture's
.JInternalFrame
- Specified by:
resizeHeightTo
in interfaceWindowLikeContainerFixture
- Parameters:
height
- the height that this fixture'sJInternalFrame
should have after being resized.- Returns:
- this fixture.
-
resizeTo
Simulates a user resizing this fixture's
.JInternalFrame
- Specified by:
resizeTo
in interfaceWindowLikeContainerFixture
- Parameters:
size
- the size that the targetJInternalFrame
should have after being resized.- Returns:
- this fixture.
-
moveTo
Simulates a user moving this fixture's
to the given point.JInternalFrame
- Specified by:
moveTo
in interfaceWindowLikeContainerFixture
- Parameters:
p
- the point to move this fixture'sJInternalFrame
to.- Returns:
- this fixture.
-
click
Simulates a user clicking this fixture's
.JInternalFrame
- Specified by:
click
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
-
click
Simulates a user clicking this fixture's
.JInternalFrame
- Specified by:
click
in interfaceMouseInputSimulationFixture
- Parameters:
button
- the button to click.- Returns:
- this fixture.
-
click
Simulates a user clicking this fixture's
.JInternalFrame
- 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
.
-
rightClick
Simulates a user right-clicking this fixture's
.JInternalFrame
- Specified by:
rightClick
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
-
doubleClick
Simulates a user double-clicking this fixture's
.JInternalFrame
- Specified by:
doubleClick
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
-
focus
Gives input focus to this fixture's
.JInternalFrame
- Specified by:
focus
in interfaceFocusableComponentFixture
- Returns:
- this fixture.
-
pressAndReleaseKey
Simulates a user pressing given key with the given modifiers on this fixture's
. Modifiers is a mask from the availableJInternalFrame
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.- See Also:
-
pressAndReleaseKeys
Simulates a user pressing and releasing the given keys on this fixture's
.JInternalFrame
- 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.- See Also:
-
pressKey
Simulates a user pressing given key on this fixture's
.JInternalFrame
- 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.- See Also:
-
releaseKey
Simulates a user releasing the given key on this fixture's
.JInternalFrame
- 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.- See Also:
-
requireFocused
Asserts that this fixture's
has input focus.JInternalFrame
- Specified by:
requireFocused
in interfaceFocusableComponentFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJInternalFrame
does not have input focus.
-
requireEnabled
Asserts that this fixture's
is enabled.JInternalFrame
- Specified by:
requireEnabled
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if the managedJInternalFrame
is disabled.
-
requireEnabled
Asserts that this fixture's
is enabled.JInternalFrame
- 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 the managedJInternalFrame
is never enabled.
-
requireDisabled
Asserts that this fixture's
is disabled.JInternalFrame
- Specified by:
requireDisabled
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if the managedJInternalFrame
is enabled.
-
requireVisible
Asserts that this fixture's
is visible.JInternalFrame
- Specified by:
requireVisible
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if the managedJInternalFrame
is not visible.
-
requireNotVisible
Asserts that this fixture's
is not visible.JInternalFrame
- Specified by:
requireNotVisible
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if the managedJInternalFrame
is visible.
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given value.JInternalFrame
- 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'sJInternalFrame
does not match the given value.- Since:
- 1.2
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JInternalFrame
- 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'sJInternalFrame
does not match the given regular expression.- Since:
- 1.2
-
clientProperty
Returns the client property stored in this fixture's
, under the given key.JInternalFrame
- 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.JInternalFrame
- Specified by:
showPopupMenu
in interfaceJPopupMenuInvokerFixture
- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException
- if this fixture'sJInternalFrame
is disabled.IllegalStateException
- if this fixture'sJInternalFrame
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.JInternalFrame
- 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'sJInternalFrame
is disabled.IllegalStateException
- if this fixture'sJInternalFrame
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.
-