|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.swing.fixture.ComponentFixture<T>
org.fest.swing.fixture.ContainerFixture<T>
org.fest.swing.fixture.WindowFixture<Frame>
org.fest.swing.fixture.FrameFixture
public class FrameFixture
Understands functional testing of
s:
Frame
Field Summary |
---|
Fields 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 | |
---|---|
FrameFixture(Frame target)
Creates a new . |
|
FrameFixture(Robot robot,
Frame target)
Creates a new . |
|
FrameFixture(Robot robot,
String name)
Creates a new . |
|
FrameFixture(String name)
Creates a new . |
Method Summary | |
---|---|
FrameFixture |
click()
Simulates a user clicking this fixture's . |
FrameFixture |
click(MouseButton button)
Simulates a user clicking this fixture's . |
FrameFixture |
click(MouseClickInfo mouseClickInfo)
Simulates a user clicking this fixture's . |
void |
close()
Simulates a user closing this fixture's . |
FrameFixture |
deiconify()
Simulates a user deiconifying this fixture's . |
FrameFixture |
doubleClick()
Simulates a user double-clicking this fixture's . |
protected void |
driver(FrameDriver newDriver)
Sets the to be used by this fixture. |
FrameFixture |
focus()
Gives input focus to this fixture's . |
FrameFixture |
iconify()
Simulates a user iconifying this fixture's . |
FrameFixture |
maximize()
Simulates a user maximizing this fixture's . |
FrameFixture |
moveTo(Point p)
Simulates a user moving this fixture's to the given point. |
FrameFixture |
moveToBack()
If the given is visible, sends it to the back and may cause it to lose focus or
activation if it is the focused or active. |
FrameFixture |
moveToFront()
If fixture's is visible, brings it to the front and may make it the focused one. |
FrameFixture |
normalize()
Simulates a user normalizing this fixture's . |
FrameFixture |
pressAndReleaseKey(KeyPressInfo keyPressInfo)
Simulates a user pressing given key with the given modifiers on this fixture's . |
FrameFixture |
pressAndReleaseKeys(int... keyCodes)
Simulates a user pressing and releasing the given keys on this fixture's . |
FrameFixture |
pressKey(int keyCode)
Simulates a user pressing the given key on this fixture's . |
FrameFixture |
releaseKey(int keyCode)
Simulates a user releasing the given key on this fixture's . |
FrameFixture |
requireDisabled()
Asserts that this fixture's is disabled. |
FrameFixture |
requireEnabled()
Asserts that this fixture's is enabled. |
FrameFixture |
requireEnabled(Timeout timeout)
Asserts that this fixture's is enabled. |
FrameFixture |
requireFocused()
Asserts that this fixture's has input focus. |
FrameFixture |
requireNotVisible()
Asserts that this fixture's is not visible. |
FrameFixture |
requireSize(Dimension size)
Asserts that the size of this fixture's is equal to given one. |
FrameFixture |
requireVisible()
Asserts that this fixture's is visible. |
FrameFixture |
resizeHeightTo(int height)
Simulates a user resizing vertically this fixture's . |
FrameFixture |
resizeTo(Dimension size)
Simulates a user resizing this fixture's . |
FrameFixture |
resizeWidthTo(int width)
Simulates a user resizing horizontally this fixture's . |
FrameFixture |
rightClick()
Simulates a user right-clicking this fixture's . |
FrameFixture |
show()
Shows this fixture's . |
FrameFixture |
show(Dimension size)
Shows this fixture's , resized to the given size. |
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. |
Methods inherited from class org.fest.swing.fixture.WindowFixture |
---|
cleanUp |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FrameFixture(Frame target)
FrameFixture
. This constructor creates a new Robot
containing the current AWT hierarchy.
target
- the Frame
to be managed by this fixture.
NullPointerException
- if the given frame is null
.BasicRobot.robotWithCurrentAwtHierarchy()
public FrameFixture(Robot robot, Frame target)
FrameFixture
.
robot
- performs user events on the given window and verifies expected output.target
- the Frame
to be managed by this fixture.
NullPointerException
- if the given robot is null
.
NullPointerException
- if the given frame is null
.public FrameFixture(Robot robot, String name)
FrameFixture
.
robot
- performs user events on the given window and verifies expected output.name
- the name of the Frame
to find using the given Robot
.
NullPointerException
- if the given robot is null
.
ComponentLookupException
- if a Frame
having a matching name could not be found.
ComponentLookupException
- if more than one Frame
having a matching name is found.public FrameFixture(String name)
FrameFixture
. This constructor creates a new Robot
containing the current AWT hierarchy.
name
- the name of the Frame
to find.
ComponentLookupException
- if a Frame
having a matching name could not be found.
ComponentLookupException
- if more than one Frame
having a matching name is found.Method Detail |
---|
protected final void driver(FrameDriver newDriver)
FrameDriver
to be used by this fixture.
newDriver
- the new FrameDriver
.
NullPointerException
- if the given driver is null
.public FrameFixture click()
Frame
.
click
in interface MouseInputSimulationFixture
public FrameFixture click(MouseButton button)
Frame
.
click
in interface MouseInputSimulationFixture
button
- the button to click.
public FrameFixture click(MouseClickInfo mouseClickInfo)
Frame
.
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 FrameFixture doubleClick()
Frame
.
doubleClick
in interface MouseInputSimulationFixture
public FrameFixture rightClick()
Frame
.
rightClick
in interface MouseInputSimulationFixture
public FrameFixture iconify()
Frame
.
iconify
in interface FrameLikeFixture
public FrameFixture deiconify()
Frame
.
deiconify
in interface FrameLikeFixture
public FrameFixture maximize()
Frame
.
maximize
in interface FrameLikeFixture
ActionFailedException
- if the operating system does not support maximizing frames.public FrameFixture normalize()
Frame
.
normalize
in interface FrameLikeFixture
public FrameFixture focus()
Frame
.
focus
in interface FocusableComponentFixture
public FrameFixture moveTo(Point p)
Frame
to the given point.
moveTo
in interface WindowLikeContainerFixture
p
- the point to move this fixture's Frame
to.
public FrameFixture pressAndReleaseKey(KeyPressInfo keyPressInfo)
Frame
.
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 FrameFixture pressAndReleaseKeys(int... keyCodes)
Frame
.
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 FrameFixture pressKey(int keyCode)
Frame
.
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 FrameFixture releaseKey(int keyCode)
Frame
.
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 FrameFixture requireFocused()
Frame
has input focus.
requireFocused
in interface FocusableComponentFixture
AssertionError
- if this fixture's Frame
does not have input focus.public FrameFixture requireDisabled()
Frame
is disabled.
requireDisabled
in interface StateVerificationFixture
AssertionError
- if this fixture's Frame
is enabled.public FrameFixture requireEnabled()
Frame
is enabled.
requireEnabled
in interface StateVerificationFixture
AssertionError
- if this fixture's Frame
is disabled.public FrameFixture requireEnabled(Timeout timeout)
Frame
is enabled.
requireEnabled
in interface StateVerificationFixture
timeout
- the time this fixture will wait for the component to be enabled.
WaitTimedOutError
- if this fixture's Frame
is never enabled.public FrameFixture requireNotVisible()
Frame
is not visible.
requireNotVisible
in interface StateVerificationFixture
AssertionError
- if this fixture's Frame
is visible.public FrameFixture requireSize(Dimension size)
Frame
is equal to given one.
requireSize
in interface WindowLikeContainerFixture
size
- the given size to match.
AssertionError
- if the size of this fixture's Frame
is not equal to the given size.public FrameFixture requireVisible()
Frame
is visible.
requireVisible
in interface StateVerificationFixture
AssertionError
- if this fixture's Frame
is not visible.public FrameFixture resizeHeightTo(int height)
Frame
.
resizeHeightTo
in interface WindowLikeContainerFixture
height
- the height that this fixture's Frame
should have after being resized.
public FrameFixture resizeTo(Dimension size)
Frame
.
resizeTo
in interface WindowLikeContainerFixture
size
- the size that the target window should have after being resized.
public FrameFixture resizeWidthTo(int width)
Frame
.
resizeWidthTo
in interface WindowLikeContainerFixture
width
- the width that this fixture's Frame
should have after being resized.
public FrameFixture show()
Frame
.
show
in class WindowFixture<Frame>
public FrameFixture show(Dimension size)
Frame
, resized to the given size.
show
in class WindowFixture<Frame>
size
- the size to resize this fixture's Frame
to.
public FrameFixture moveToFront()
Frame
is visible, brings it to the front and may make it the focused one.
moveToFront
in interface WindowLikeContainerFixture
public FrameFixture moveToBack()
Frame
is visible, sends it to the back and may cause it to lose focus or
activation if it is the focused or active.
moveToBack
in interface WindowLikeContainerFixture
public JPopupMenuFixture showPopupMenu()
Frame
as the invoker of the pop-up menu.
showPopupMenu
in interface JPopupMenuInvokerFixture
IllegalStateException
- if this fixture's Frame
is disabled.
IllegalStateException
- if this fixture's Frame
is not showing on the screen.
ComponentLookupException
- if a pop-up menu cannot be found.public JPopupMenuFixture showPopupMenuAt(Point p)
Frame
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 Frame
is disabled.
IllegalStateException
- if this fixture's Frame
is not showing on the screen.
ComponentLookupException
- if a pop-up menu cannot be found.public void close()
Frame
.
close
in interface WindowLikeContainerFixture
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |