Package org.fest.swing.fixture
Class WindowFixture<T extends Window>
java.lang.Object
org.fest.swing.fixture.ComponentFixture<T>
org.fest.swing.fixture.ContainerFixture<T>
org.fest.swing.fixture.WindowFixture<T>
- Type Parameters:
T
- the type of window handled by this fixture.
- All Implemented Interfaces:
CommonComponentFixture
,ComponentContainerFixture
,FocusableComponentFixture
,JPopupMenuInvokerFixture
,KeyboardInputSimulationFixture
,MouseInputSimulationFixture
,StateVerificationFixture
,WindowLikeContainerFixture
- Direct Known Subclasses:
DialogFixture
,FrameFixture
public abstract class WindowFixture<T extends Window>
extends ContainerFixture<T>
implements CommonComponentFixture, WindowLikeContainerFixture, JPopupMenuInvokerFixture
Understands functional testing of
Window
s:
- user input simulation
- state verification
- property value query
-
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
ConstructorsConstructorDescriptionWindowFixture
(Class<? extends T> type) Creates a new
.WindowFixture
WindowFixture
(String name, Class<? extends T> type) Creates a new
.WindowFixture
WindowFixture
(Robot robot, Class<? extends T> type) Creates a new
.WindowFixture
WindowFixture
(Robot robot, String name, Class<? extends T> type) Creates a new
.WindowFixture
WindowFixture
(Robot robot, T target) Creates a new
.WindowFixture
WindowFixture
(T target) Creates a new
.WindowFixture
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
cleanUp()
Cleans up any used resources (keyboard, mouse, open windows and
) used by this robot.ScreenLock
protected abstract WindowFixture<T>
show()
Shows this fixture's
.Window
protected abstract WindowFixture<T>
Shows this fixture's
, resized to the given size.Window
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
Methods inherited from interface org.fest.swing.fixture.FocusableComponentFixture
focus, requireFocused
Methods inherited from interface org.fest.swing.fixture.JPopupMenuInvokerFixture
showPopupMenu, showPopupMenuAt
Methods inherited from interface org.fest.swing.fixture.KeyboardInputSimulationFixture
pressAndReleaseKey, pressAndReleaseKeys, pressKey, releaseKey
Methods inherited from interface org.fest.swing.fixture.MouseInputSimulationFixture
click, click, click, doubleClick, rightClick
Methods inherited from interface org.fest.swing.fixture.StateVerificationFixture
requireDisabled, requireEnabled, requireEnabled, requireNotVisible, requireVisible
Methods inherited from interface org.fest.swing.fixture.WindowLikeContainerFixture
close, moveTo, moveToBack, moveToFront, requireSize, resizeHeightTo, resizeTo, resizeWidthTo
-
Constructor Details
-
WindowFixture
Creates a new
. This constructor creates a newWindowFixture
containing the current AWT hierarchy.Robot
- Parameters:
type
- the type ofWindow
to find using the createdRobot
.- Throws:
NullPointerException
- if the givenWindow
type isnull
.ComponentLookupException
- if aWindow
having a matching type could not be found.ComponentLookupException
- if more than oneWindow
having a matching type is found.- See Also:
-
WindowFixture
Creates a new
.WindowFixture
- Parameters:
robot
- performs simulation of user events on aWindow
.type
- the type ofWindow
to find using the givenRobot
.- Throws:
NullPointerException
- if the given robot isnull
.NullPointerException
- if the givenWindow
type isnull
.ComponentLookupException
- if aWindow
having a matching type could not be found.ComponentLookupException
- if more than oneWindow
having a matching type is found.
-
WindowFixture
Creates a new
. This constructor creates a newWindowFixture
containing the current AWT hierarchy.Robot
- Parameters:
name
- the name of theWindow
to find.type
- the type ofWindow
to find using the createdRobot
.- Throws:
NullPointerException
- if the givenWindow
type isnull
.ComponentLookupException
- if aWindow
having a matching name could not be found.ComponentLookupException
- if more than oneWindow
having a matching name is found.- See Also:
-
WindowFixture
Creates a new
.WindowFixture
- Parameters:
robot
- performs simulation of user events on aWindow
.name
- the name of theWindow
to find using the givenRobot
.type
- the type ofWindow
to find using the givenRobot
.- Throws:
NullPointerException
- if the given robot isnull
.NullPointerException
- if the givenWindow
type isnull
.ComponentLookupException
- if aWindow
having a matching name could not be found.ComponentLookupException
- if more than oneWindow
having a matching name is found.
-
WindowFixture
Creates a new
. This constructor creates a newWindowFixture
containing the current AWT hierarchy.Robot
- Parameters:
target
- theWindow
to be managed by this fixture.- Throws:
NullPointerException
- if the given targetWindow
isnull
.
-
WindowFixture
Creates a new
.WindowFixture
- Parameters:
robot
- performs simulation of user events on the givenWindow
.target
- theWindow
to be managed by this fixture.- Throws:
NullPointerException
- if the given robot isnull
.NullPointerException
- if the given targetWindow
isnull
.
-
-
Method Details
-
show
Shows this fixture's
.Window
- Returns:
- this fixture.
-
show
Shows this fixture's
, resized to the given size.Window
- Parameters:
size
- the size to resize this fixture'sWindow
to.- Returns:
- this fixture.
-
cleanUp
public final void cleanUp()Cleans up any used resources (keyboard, mouse, open windows and
) used by this robot.ScreenLock
-