public class JInternalFrameFixture extends ContainerFixture<JInternalFrame> implements CommonComponentFixture, FrameLikeFixture, JComponentFixture, JPopupMenuInvokerFixture
JInternalFrame
s:
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target
DEFAULT_DIALOG_LOOKUP_TIMEOUT
Constructor and Description |
---|
JInternalFrameFixture(Robot robot,
JInternalFrame target)
Creates a new
. |
JInternalFrameFixture(Robot robot,
String internalFrameName)
Creates a new
. |
Modifier and Type | Method and Description |
---|---|
JInternalFrameFixture |
click()
Simulates a user clicking this fixture's
. |
JInternalFrameFixture |
click(MouseButton button)
Simulates a user clicking this fixture's
. |
JInternalFrameFixture |
click(MouseClickInfo mouseClickInfo)
Simulates a user clicking this fixture's
. |
Object |
clientProperty(Object key)
Returns the client property stored in this fixture's
, under the given key. |
void |
close()
Simulates a user closing this fixture's
. |
JInternalFrameFixture |
deiconify()
Simulates a user deiconifying this fixture's
. |
JInternalFrameFixture |
doubleClick()
Simulates a user double-clicking this fixture's
. |
protected void |
driver(JInternalFrameDriver newDriver)
Sets the
to be used by this fixture. |
JInternalFrameFixture |
focus()
Gives input focus to this fixture's
. |
JInternalFrameFixture |
iconify()
Simulates a user iconifying this fixture's
. |
JInternalFrameFixture |
maximize()
Simulates a user maximizing this fixture's
, deconifying it first if it is
iconified. |
JInternalFrameFixture |
moveTo(Point p)
Simulates a user moving this fixture's
to the given point. |
JInternalFrameFixture |
moveToBack()
Brings this fixture's
to the back. |
JInternalFrameFixture |
moveToFront()
Brings this fixture's
to the front. |
JInternalFrameFixture |
normalize()
Simulates a user normalizing this fixture's
, deconifying it first if it is
iconified. |
JInternalFrameFixture |
pressAndReleaseKey(KeyPressInfo keyPressInfo)
Simulates a user pressing given key with the given modifiers on this fixture's
. |
JInternalFrameFixture |
pressAndReleaseKeys(int... keyCodes)
Simulates a user pressing and releasing the given keys on this fixture's
. |
JInternalFrameFixture |
pressKey(int keyCode)
Simulates a user pressing given key on this fixture's
. |
JInternalFrameFixture |
releaseKey(int keyCode)
Simulates a user releasing the given key on this fixture's
. |
JInternalFrameFixture |
requireDisabled()
Asserts that this fixture's
is disabled. |
JInternalFrameFixture |
requireEnabled()
Asserts that this fixture's
is enabled. |
JInternalFrameFixture |
requireEnabled(Timeout timeout)
Asserts that this fixture's
is enabled. |
JInternalFrameFixture |
requireFocused()
Asserts that this fixture's
has input focus. |
JInternalFrameFixture |
requireNotVisible()
Asserts that this fixture's
is not visible. |
JInternalFrameFixture |
requireSize(Dimension size)
Asserts that the size of this fixture's
is equal to given one. |
JInternalFrameFixture |
requireToolTip(Pattern pattern)
Asserts that the toolTip in this fixture's
matches the given regular expression
pattern. |
JInternalFrameFixture |
requireToolTip(String expected)
Asserts that the toolTip in this fixture's
matches the given value. |
JInternalFrameFixture |
requireVisible()
Asserts that this fixture's
is visible. |
JInternalFrameFixture |
resizeHeightTo(int height)
Simulates a user resizing vertically this fixture's
. |
JInternalFrameFixture |
resizeTo(Dimension size)
Simulates a user resizing this fixture's
. |
JInternalFrameFixture |
resizeWidthTo(int width)
Simulates a user resizing horizontally this fixture's
. |
JInternalFrameFixture |
rightClick()
Simulates a user right-clicking this fixture's
. |
JPopupMenuFixture |
showPopupMenu()
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu. |
JPopupMenuFixture |
showPopupMenuAt(Point p)
Shows a pop-up menu at the given point using this fixture's
as the invoker of
the pop-up menu. |
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
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
public JInternalFrameFixture(Robot robot, String internalFrameName)
JInternalFrameFixture
.robot
- performs simulation of user events on a JInternalFrame
.internalFrameName
- the name of the JInternalFrame
to find using the given Robot
.NullPointerException
- if robot
is null
.ComponentLookupException
- if a matching JInternalFrame
could not be found.ComponentLookupException
- if more than one matching JInternalFrame
is found.public JInternalFrameFixture(Robot robot, JInternalFrame target)
JInternalFrameFixture
.robot
- performs simulation of user events on the given JInternalFrame
.target
- the JInternalFrame
to be managed by this fixture.NullPointerException
- if robot
is null
.NullPointerException
- if target
is null
.protected final void driver(JInternalFrameDriver newDriver)
JInternalFrameDriver
to be used by this fixture.newDriver
- the new JInternalFrameDriver
.NullPointerException
- if the given driver is null
.public JInternalFrameFixture moveToFront()
JInternalFrame
to the front.moveToFront
in interface WindowLikeContainerFixture
public JInternalFrameFixture moveToBack()
JInternalFrame
to the back.moveToBack
in interface WindowLikeContainerFixture
public JInternalFrameFixture deiconify()
JInternalFrame
.deiconify
in interface FrameLikeFixture
ActionFailedException
- if the JInternalFrame
vetoes the action.public JInternalFrameFixture iconify()
JInternalFrame
.iconify
in interface FrameLikeFixture
ActionFailedException
- if the given JInternalFrame
is not iconifiable.ActionFailedException
- if the JInternalFrame
vetoes the action.public JInternalFrameFixture maximize()
JInternalFrame
, deconifying it first if it is
iconified.maximize
in interface FrameLikeFixture
ActionFailedException
- if the given JInternalFrame
is not maximizable.ActionFailedException
- if the JInternalFrame
vetoes the action.public JInternalFrameFixture normalize()
JInternalFrame
, deconifying it first if it is
iconified.normalize
in interface FrameLikeFixture
ActionFailedException
- if the JInternalFrame
vetoes the action.public void close()
JInternalFrame
.close
in interface WindowLikeContainerFixture
ActionFailedException
- if the JInternalFrame
is not closable.public JInternalFrameFixture requireSize(Dimension size)
JInternalFrame
is equal to given one.requireSize
in interface WindowLikeContainerFixture
size
- the given size to match.AssertionError
- if the size of this fixture's JInternalFrame
is not equal to the given size.public JInternalFrameFixture resizeWidthTo(int width)
JInternalFrame
.resizeWidthTo
in interface WindowLikeContainerFixture
width
- the width that this fixture's JInternalFrame
should have after being resized.public JInternalFrameFixture resizeHeightTo(int height)
JInternalFrame
.resizeHeightTo
in interface WindowLikeContainerFixture
height
- the height that this fixture's JInternalFrame
should have after being resized.public JInternalFrameFixture resizeTo(Dimension size)
JInternalFrame
.resizeTo
in interface WindowLikeContainerFixture
size
- the size that the target JInternalFrame
should have after being resized.public JInternalFrameFixture moveTo(Point p)
JInternalFrame
to the given point.moveTo
in interface WindowLikeContainerFixture
p
- the point to move this fixture's JInternalFrame
to.public JInternalFrameFixture click()
JInternalFrame
.click
in interface MouseInputSimulationFixture
public JInternalFrameFixture click(MouseButton button)
JInternalFrame
.click
in interface MouseInputSimulationFixture
button
- the button to click.public JInternalFrameFixture click(MouseClickInfo mouseClickInfo)
JInternalFrame
.click
in interface MouseInputSimulationFixture
mouseClickInfo
- specifies the button to click and the times the button should be clicked.NullPointerException
- if the given MouseClickInfo
is null
.public JInternalFrameFixture rightClick()
JInternalFrame
.rightClick
in interface MouseInputSimulationFixture
public JInternalFrameFixture doubleClick()
JInternalFrame
.doubleClick
in interface MouseInputSimulationFixture
public JInternalFrameFixture focus()
JInternalFrame
.focus
in interface FocusableComponentFixture
public JInternalFrameFixture pressAndReleaseKey(KeyPressInfo keyPressInfo)
JInternalFrame
.
Modifiers is a mask from the available InputEvent
masks.pressAndReleaseKey
in interface KeyboardInputSimulationFixture
keyPressInfo
- specifies the key and modifiers to press.NullPointerException
- if the given KeyPressInfo
is null
.IllegalArgumentException
- if the given code is not a valid key code.KeyPressInfo
public JInternalFrameFixture pressAndReleaseKeys(int... keyCodes)
JInternalFrame
.pressAndReleaseKeys
in interface KeyboardInputSimulationFixture
keyCodes
- one or more codes of the keys to press.NullPointerException
- if the given array of codes is null
.IllegalArgumentException
- if any of the given code is not a valid key code.KeyEvent
public JInternalFrameFixture pressKey(int keyCode)
JInternalFrame
.pressKey
in interface KeyboardInputSimulationFixture
keyCode
- the code of the key to press.IllegalArgumentException
- if any of the given code is not a valid key code.KeyEvent
public JInternalFrameFixture releaseKey(int keyCode)
JInternalFrame
.releaseKey
in interface KeyboardInputSimulationFixture
keyCode
- the code of the key to release.IllegalArgumentException
- if any of the given code is not a valid key code.KeyEvent
public JInternalFrameFixture requireFocused()
JInternalFrame
has input focus.requireFocused
in interface FocusableComponentFixture
AssertionError
- if this fixture's JInternalFrame
does not have input focus.public JInternalFrameFixture requireEnabled()
JInternalFrame
is enabled.requireEnabled
in interface StateVerificationFixture
AssertionError
- if the managed JInternalFrame
is disabled.public JInternalFrameFixture requireEnabled(Timeout timeout)
JInternalFrame
is enabled.requireEnabled
in interface StateVerificationFixture
timeout
- the time this fixture will wait for the component to be enabled.WaitTimedOutError
- if the managed JInternalFrame
is never enabled.public JInternalFrameFixture requireDisabled()
JInternalFrame
is disabled.requireDisabled
in interface StateVerificationFixture
AssertionError
- if the managed JInternalFrame
is enabled.public JInternalFrameFixture requireVisible()
JInternalFrame
is visible.requireVisible
in interface StateVerificationFixture
AssertionError
- if the managed JInternalFrame
is not visible.public JInternalFrameFixture requireNotVisible()
JInternalFrame
is not visible.requireNotVisible
in interface StateVerificationFixture
AssertionError
- if the managed JInternalFrame
is visible.public JInternalFrameFixture requireToolTip(String expected)
JInternalFrame
matches the given value.requireToolTip
in interface ToolTipDisplayFixture
expected
- the given value. It can be a regular expression.AssertionError
- if the toolTip in this fixture's JInternalFrame
does not match the given value.public JInternalFrameFixture requireToolTip(Pattern pattern)
JInternalFrame
matches the given regular expression
pattern.requireToolTip
in interface ToolTipDisplayFixture
pattern
- the regular expression pattern to match.NullPointerException
- if the given regular expression pattern is null
.AssertionError
- if the toolTip in this fixture's JInternalFrame
does not match the given
regular expression.public Object clientProperty(Object key)
JInternalFrame
, under the given key.clientProperty
in interface ClientPropertyStorageFixture
key
- the key to use to retrieve the client property.null
if the property was
not found.NullPointerException
- if the given key is null
.public JPopupMenuFixture showPopupMenu()
JInternalFrame
as the invoker of the pop-up menu.showPopupMenu
in interface JPopupMenuInvokerFixture
IllegalStateException
- if this fixture's JInternalFrame
is disabled.IllegalStateException
- if this fixture's JInternalFrame
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.public JPopupMenuFixture showPopupMenuAt(Point p)
JInternalFrame
as the invoker of
the pop-up menu.showPopupMenuAt
in interface JPopupMenuInvokerFixture
p
- the given point where to show the pop-up menu.IllegalStateException
- if this fixture's JInternalFrame
is disabled.IllegalStateException
- if this fixture's JInternalFrame
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.