|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fest.swing.fixture.ComponentFixture<JMenuItem>
org.fest.swing.fixture.JMenuItemFixture
public class JMenuItemFixture
Understands functional testing of s:
JMenuItem
| Field Summary |
|---|
| Fields inherited from class org.fest.swing.fixture.ComponentFixture |
|---|
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target |
| Constructor Summary | |
|---|---|
JMenuItemFixture(Robot robot,
JMenuItem target)
Creates a new . |
|
JMenuItemFixture(Robot robot,
String menuItemName)
Creates a new . |
|
| Method Summary | |
|---|---|
JMenuItemFixture |
click()
Simulates a user selecting this fixture's . |
protected void |
driver(JMenuItemDriver newDriver)
Sets the to be used by this fixture. |
JMenuItemFixture |
focus()
Gives input focus to this fixture's . |
JMenuItemFixture |
pressAndReleaseKey(KeyPressInfo keyPressInfo)
Simulates a user pressing given key with the given modifiers on this fixture's . |
JMenuItemFixture |
pressAndReleaseKeys(int... keyCodes)
Simulates a user pressing and releasing the given keys on this fixture's . |
JMenuItemFixture |
pressKey(int keyCode)
Simulates a user pressing the given key on this fixture's . |
JMenuItemFixture |
releaseKey(int keyCode)
Simulates a user releasing the given key on this fixture's . |
JMenuItemFixture |
requireDisabled()
Asserts that this fixture's is disabled. |
JMenuItemFixture |
requireEnabled()
Asserts that this fixture's is enabled. |
JMenuItemFixture |
requireEnabled(Timeout timeout)
Asserts that this fixture's is enabled. |
JMenuItemFixture |
requireNotVisible()
Asserts that this fixture's is not visible. |
JMenuItemFixture |
requireVisible()
Asserts that this fixture's is visible. |
| 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 JMenuItemFixture(Robot robot,
String menuItemName)
JMenuItemFixture.
robot - performs simulation of user events on a JMenuItem.menuItemName - the name of the JMenuItem to find using the given Robot.
NullPointerException - if robot is null.
ComponentLookupException - if a matching JMenuItem could not be found.
ComponentLookupException - if more than one matching JMenuItem is found.
public JMenuItemFixture(Robot robot,
JMenuItem target)
JMenuItemFixture.
robot - performs simulation of user events on the given JMenuItem.target - the JMenuItem to be managed by this fixture.
NullPointerException - if robot is null.
NullPointerException - if target is null.| Method Detail |
|---|
protected final void driver(JMenuItemDriver newDriver)
JMenuItemDriver to be used by this fixture.
newDriver - the new JMenuItemDriver.
NullPointerException - if the given driver is null.public JMenuItemFixture click()
JMenuItem.
IllegalStateException - if this fixture's JMenuItem is disabled.
IllegalStateException - if this fixture's JMenuItem is not showing on the screen.
ActionFailedException - if the menu has a pop-up and it fails to show up.public JMenuItemFixture focus()
JMenuItem.
IllegalStateException - if this fixture's JMenuItem is disabled.
IllegalStateException - if this fixture's JMenuItem is not showing on the screen.public JMenuItemFixture pressAndReleaseKey(KeyPressInfo keyPressInfo)
JMenuItem.
Modifiers is a mask from the available InputEvent masks.
pressAndReleaseKey in interface KeyboardInputSimulationFixturekeyPressInfo - 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.
IllegalStateException - if this fixture's JMenuItem is disabled.
IllegalStateException - if this fixture's JMenuItem is not showing on the screen.KeyPressInfopublic JMenuItemFixture pressAndReleaseKeys(int... keyCodes)
JMenuItem.
pressAndReleaseKeys in interface KeyboardInputSimulationFixturekeyCodes - one or more codes of the keys to press.
IllegalStateException - if this fixture's JMenuItem is disabled.
IllegalStateException - if this fixture's JMenuItem is not showing on the screen.KeyEventpublic JMenuItemFixture pressKey(int keyCode)
JMenuItem.
pressKey in interface KeyboardInputSimulationFixturekeyCode - the code of the key to press.
IllegalStateException - if this fixture's JMenuItem is disabled.
IllegalStateException - if this fixture's JMenuItem is not showing on the screen.KeyEventpublic JMenuItemFixture releaseKey(int keyCode)
JMenuItem.
releaseKey in interface KeyboardInputSimulationFixturekeyCode - the code of the key to release.
IllegalStateException - if this fixture's JMenuItem is disabled.
IllegalStateException - if this fixture's JMenuItem is not showing on the screen.KeyEventpublic JMenuItemFixture requireEnabled()
JMenuItem is enabled.
requireEnabled in interface StateVerificationFixtureAssertionError - if this fixture's JMenuItem is disabled.public JMenuItemFixture requireEnabled(Timeout timeout)
JMenuItem is enabled.
requireEnabled in interface StateVerificationFixturetimeout - the time this fixture will wait for the component to be enabled.
WaitTimedOutError - if this fixture's JMenuItem is never enabled.public JMenuItemFixture requireDisabled()
JMenuItem is disabled.
requireDisabled in interface StateVerificationFixtureAssertionError - if this fixture's JMenuItem is enabled.public JMenuItemFixture requireVisible()
JMenuItem is visible.
requireVisible in interface StateVerificationFixtureAssertionError - if this fixture's JMenuItem is not visible.public JMenuItemFixture requireNotVisible()
JMenuItem is not visible.
requireNotVisible in interface StateVerificationFixtureAssertionError - if this fixture's JMenuItem is visible.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||