public class JFileChooserFixture extends ComponentFixture<JFileChooser> implements CommonComponentFixture
JFileChooser
s:
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target
Constructor and Description |
---|
JFileChooserFixture(Robot robot)
Creates a new
. |
JFileChooserFixture(Robot robot,
JFileChooser target)
Creates a new
. |
JFileChooserFixture(Robot robot,
String fileChooserName)
Creates a new
. |
Modifier and Type | Method and Description |
---|---|
void |
approve()
Simulates a user pressing the "Approve" button in this fixture's
. |
JButtonFixture |
approveButton()
Finds the "Approve" button in this fixture's
. |
void |
cancel()
Simulates a user pressing the "Cancel" button in this fixture's
. |
JButtonFixture |
cancelButton()
Finds the "Cancel" button in this fixture's
. |
JFileChooserFixture |
click()
Simulates a user clicking this fixture's
. |
JFileChooserFixture |
click(MouseButton button)
Simulates a user clicking this fixture's
. |
JFileChooserFixture |
click(MouseClickInfo mouseClickInfo)
Simulates a user clicking this fixture's
. |
JFileChooserFixture |
doubleClick()
Simulates a user double-clicking this fixture's
. |
protected void |
driver(JFileChooserDriver newDriver)
Sets the
to be used by this fixture. |
JTextComponentFixture |
fileNameTextBox()
Returns a fixture that manages the field where the user can enter the name of the file to select in this fixture's
. |
JFileChooserFixture |
focus()
Gives input focus to this fixture's
. |
JFileChooserFixture |
pressAndReleaseKey(KeyPressInfo keyPressInfo)
Simulates a user pressing given key with the given modifiers on this fixture's
. |
JFileChooserFixture |
pressAndReleaseKeys(int... keyCodes)
Simulates a user pressing and releasing the given keys on the
managed by this
fixture. |
JFileChooserFixture |
pressKey(int keyCode)
Simulates a user pressing the given key on this fixture's
. |
JFileChooserFixture |
releaseKey(int keyCode)
Simulates a user releasing the given key on this fixture's
. |
JFileChooserFixture |
requireDisabled()
Asserts that this fixture's
is disabled. |
JFileChooserFixture |
requireEnabled()
Asserts that this fixture's
is enabled. |
JFileChooserFixture |
requireEnabled(Timeout timeout)
Asserts that this fixture's
is enabled. |
JFileChooserFixture |
requireFocused()
Asserts that this fixture's
has input focus. |
JFileChooserFixture |
requireNotVisible()
Asserts that this fixture's
is not visible. |
JFileChooserFixture |
requireVisible()
Asserts that this fixture's
is visible. |
JFileChooserFixture |
rightClick()
Simulates a user right-clicking this fixture's
. |
JFileChooserFixture |
selectFile(File file)
Selects the given file in this fixture's
. |
JFileChooserFixture |
selectFiles(File... files)
Selects the given files in this fixture's
. |
JFileChooserFixture |
setCurrentDirectory(File dir)
Sets the current directory of this fixture's
to the given one. |
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
public JFileChooserFixture(Robot robot)
JFileChooserFixture
.robot
- performs simulation of user events on a JFileChooser
.NullPointerException
- if robot
is null
.ComponentLookupException
- if a matching JFileChooser
could not be found.ComponentLookupException
- if more than one matching JFileChooser
is found.public JFileChooserFixture(Robot robot, JFileChooser target)
JFileChooserFixture
.robot
- performs simulation of user events on the given JFileChooser
.target
- the JFileChooser
to be managed by this fixture.NullPointerException
- if robot
is null
.NullPointerException
- if target
is null
.public JFileChooserFixture(Robot robot, String fileChooserName)
JFileChooserFixture
.robot
- performs simulation of user events on a JFileChooser
.fileChooserName
- the name of the JFileChooser
to find using the given RobotFixture
.NullPointerException
- if robot
is null
.ComponentLookupException
- if a matching JFileChooser
could not be found.ComponentLookupException
- if more than one matching JFileChooser
is found.protected final void driver(JFileChooserDriver newDriver)
JFileChooserDriver
to be used by this fixture.newDriver
- the new JFileChooserDriver
.NullPointerException
- if the given driver is null
.public void approve()
JFileChooser
.ComponentLookupException
- if the "Approve" button cannot be found.IllegalStateException
- if the "Approve" button is disabled.IllegalStateException
- if the "Approve" button is not showing on the screen.public JButtonFixture approveButton()
JFileChooser
.ComponentLookupException
- if the "Approve" button cannot be found.public void cancel()
JFileChooser
.ComponentLookupException
- if the "Cancel" button cannot be found.IllegalStateException
- if the "Cancel" button is disabled.IllegalStateException
- if the "Cancel" button is not showing on the screen.public JButtonFixture cancelButton()
JFileChooser
.ComponentLookupException
- if the "Cancel" button cannot be found.public JTextComponentFixture fileNameTextBox()
JFileChooser
.ComponentLookupException
- if a matching textToMatch field could not be found.public JFileChooserFixture selectFile(File file)
JFileChooser
.file
- the file to select.NullPointerException
- if the given file is null
.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.IllegalArgumentException
- if this fixture's JFileChooser
can select directories only and the
file to select is not a directory.IllegalArgumentException
- if this fixture's JFileChooser
cannot select directories and the file
to select is a directory.public JFileChooserFixture selectFiles(File... files)
JFileChooser
.files
- the files to select.NullPointerException
- if the given array of files is null
.IllegalArgumentException
- if the given array of files is empty.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.IllegalStateException
- if this fixture's JFileChooser
does not support multiple selection and
there is more than one file to select.IllegalArgumentException
- if this fixture's JFileChooser
can select directories only and any of
the files to select is not a directory.IllegalArgumentException
- if this fixture's JFileChooser
cannot select directories and any of
the files to select is a directory.public JFileChooserFixture setCurrentDirectory(File dir)
JFileChooser
to the given one.dir
- the directory to set as current.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.public JFileChooserFixture click()
JFileChooser
.click
in interface MouseInputSimulationFixture
IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.public JFileChooserFixture click(MouseButton button)
JFileChooser
.click
in interface MouseInputSimulationFixture
button
- the button to click.NullPointerException
- if the given MouseButton
is null
.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.public JFileChooserFixture click(MouseClickInfo mouseClickInfo)
JFileChooser
.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
.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.public JFileChooserFixture doubleClick()
JFileChooser
.doubleClick
in interface MouseInputSimulationFixture
IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.public JFileChooserFixture rightClick()
JFileChooser
.rightClick
in interface MouseInputSimulationFixture
IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.public JFileChooserFixture focus()
JFileChooser
.focus
in interface FocusableComponentFixture
IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.public JFileChooserFixture pressAndReleaseKey(KeyPressInfo keyPressInfo)
JFileChooser
.
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.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.KeyPressInfo
public JFileChooserFixture pressAndReleaseKeys(int... keyCodes)
JFileChooser
managed by this
fixture.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.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.KeyEvent
public JFileChooserFixture pressKey(int keyCode)
JFileChooser
.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.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.KeyEvent
public JFileChooserFixture releaseKey(int keyCode)
JFileChooser
.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.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.KeyEvent
public JFileChooserFixture requireFocused()
JFileChooser
has input focus.requireFocused
in interface FocusableComponentFixture
AssertionError
- if this fixture's JFileChooser
does not have input focus.public JFileChooserFixture requireEnabled()
JFileChooser
is enabled.requireEnabled
in interface StateVerificationFixture
AssertionError
- if this fixture's JFileChooser
is disabled.public JFileChooserFixture requireEnabled(Timeout timeout)
JFileChooser
is enabled.requireEnabled
in interface StateVerificationFixture
timeout
- the time this fixture will wait for the component to be enabled.WaitTimedOutError
- if this fixture's JFileChooser
is never enabled.public JFileChooserFixture requireDisabled()
JFileChooser
is disabled.requireDisabled
in interface StateVerificationFixture
AssertionError
- if this fixture's JFileChooser
is enabled.public JFileChooserFixture requireVisible()
JFileChooser
is visible.requireVisible
in interface StateVerificationFixture
AssertionError
- if this fixture's JFileChooser
is not visible.public JFileChooserFixture requireNotVisible()
JFileChooser
is not visible.requireNotVisible
in interface StateVerificationFixture
AssertionError
- if this fixture's JFileChooser
is visible.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.