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
Windows:
- 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, targetFields inherited from interface org.fest.swing.fixture.ComponentContainerFixture
DEFAULT_DIALOG_LOOKUP_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionWindowFixture(Class<? extends T> type) Creates a new.WindowFixtureWindowFixture(String name, Class<? extends T> type) Creates a new.WindowFixtureWindowFixture(Robot robot, Class<? extends T> type) Creates a new.WindowFixtureWindowFixture(Robot robot, String name, Class<? extends T> type) Creates a new.WindowFixtureWindowFixture(Robot robot, T target) Creates a new.WindowFixtureWindowFixture(T target) Creates a new.WindowFixture -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcleanUp()Cleans up any used resources (keyboard, mouse, open windows and) used by this robot.ScreenLockprotected abstract WindowFixture<T>show()Shows this fixture's.Windowprotected abstract WindowFixture<T>Shows this fixture's, resized to the given size.WindowMethods 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, withMethods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNullMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.fest.swing.fixture.FocusableComponentFixture
focus, requireFocusedMethods inherited from interface org.fest.swing.fixture.JPopupMenuInvokerFixture
showPopupMenu, showPopupMenuAtMethods inherited from interface org.fest.swing.fixture.KeyboardInputSimulationFixture
pressAndReleaseKey, pressAndReleaseKeys, pressKey, releaseKeyMethods inherited from interface org.fest.swing.fixture.MouseInputSimulationFixture
click, click, click, doubleClick, rightClickMethods inherited from interface org.fest.swing.fixture.StateVerificationFixture
requireDisabled, requireEnabled, requireEnabled, requireNotVisible, requireVisibleMethods 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 newWindowFixturecontaining the current AWT hierarchy.Robot- Parameters:
type- the type ofWindowto find using the createdRobot.- Throws:
NullPointerException- if the givenWindowtype isnull.ComponentLookupException- if aWindowhaving a matching type could not be found.ComponentLookupException- if more than oneWindowhaving a matching type is found.- See Also:
-
WindowFixture
Creates a new.WindowFixture- Parameters:
robot- performs simulation of user events on aWindow.type- the type ofWindowto find using the givenRobot.- Throws:
NullPointerException- if the given robot isnull.NullPointerException- if the givenWindowtype isnull.ComponentLookupException- if aWindowhaving a matching type could not be found.ComponentLookupException- if more than oneWindowhaving a matching type is found.
-
WindowFixture
Creates a new. This constructor creates a newWindowFixturecontaining the current AWT hierarchy.Robot- Parameters:
name- the name of theWindowto find.type- the type ofWindowto find using the createdRobot.- Throws:
NullPointerException- if the givenWindowtype isnull.ComponentLookupException- if aWindowhaving a matching name could not be found.ComponentLookupException- if more than oneWindowhaving 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 theWindowto find using the givenRobot.type- the type ofWindowto find using the givenRobot.- Throws:
NullPointerException- if the given robot isnull.NullPointerException- if the givenWindowtype isnull.ComponentLookupException- if aWindowhaving a matching name could not be found.ComponentLookupException- if more than oneWindowhaving a matching name is found.
-
WindowFixture
Creates a new. This constructor creates a newWindowFixturecontaining the current AWT hierarchy.Robot- Parameters:
target- theWindowto be managed by this fixture.- Throws:
NullPointerException- if the given targetWindowisnull.
-
WindowFixture
Creates a new.WindowFixture- Parameters:
robot- performs simulation of user events on the givenWindow.target- theWindowto be managed by this fixture.- Throws:
NullPointerException- if the given robot isnull.NullPointerException- if the given targetWindowisnull.
-
-
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'sWindowto.- Returns:
- this fixture.
-
cleanUp
public final void cleanUp()Cleans up any used resources (keyboard, mouse, open windows and) used by this robot.ScreenLock
-