Package org.fest.swing.fixture
Class JTableFixture
- All Implemented Interfaces:
ClientPropertyStorageFixture
,CommonComponentFixture
,FocusableComponentFixture
,JComponentFixture
,JPopupMenuInvokerFixture
,KeyboardInputSimulationFixture
,MouseInputSimulationFixture
,StateVerificationFixture
,ToolTipDisplayFixture
public class JTableFixture
extends ComponentFixture<JTable>
implements CommonComponentFixture, JComponentFixture, JPopupMenuInvokerFixture
Understands functional testing of
JTable
s:
- user input simulation
- state verification
- property value query
The conversion between the values given in tests and the values being displayed by a
renderer is performed by a JTable
. This fixture uses a
JTableCellReader
by default.
BasicJTableCellReader
-
Field Summary
FieldsFields inherited from class org.fest.swing.fixture.ComponentFixture
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target
-
Constructor Summary
ConstructorsConstructorDescriptionJTableFixture
(Robot robot, String tableName) Creates a new
.JTableFixture
JTableFixture
(Robot robot, JTable target) Creates a new
.JTableFixture
-
Method Summary
Modifier and TypeMethodDescriptionbackgroundAt
(TableCell cell) Returns a fixture that verifies the background color of the given table cell.Returns a fixture that manages the table cell whose value matches the given one.Returns a fixture that manages the table cell whose value matches the given regular expression pattern.Returns a fixture that manages the table cell specified by the given row and column.cell
(TableCellFinder cellFinder) Returns a fixture that manages the table cell found by the given
.TableCellFinder
private org.fest.assertions.Description
cellProperty
(TableCell cell, String propertyName) cellReader
(JTableCellReader cellReader) Updates the implementation of
to use when comparing internal values of this fixture'sJTableCellReader
and the values expected in a test.JTable
cellWriter
(JTableCellWriter cellWriter) Updates the implementation of
to use when comparing internal values of this fixture'sJTableCellWriter
and the values expected in a test.JTable
click()
Simulates a user clicking this fixture's
.JTable
click
(MouseButton button) Simulates a user clicking this fixture's
.JTable
click
(MouseClickInfo mouseClickInfo) Simulates a user clicking this fixture's
.JTable
click
(TableCell cell, MouseButton button) Simulates a user clicking a cell in this fixture's
once, using the specified mouse button.JTable
(package private) void
click
(TableCell cell, MouseButton button, int times) click
(TableCell cell, MouseClickInfo mouseClickInfo) Simulates a user clicking a cell in this fixture's
, using the specified mouse button the given number of times.JTable
clientProperty
(Object key) Returns the client property stored in this fixture's
, under the given key.JTable
int
columnIndexFor
(Object columnName) Returns the index of the column in this fixture's
whose name matches the given one.JTable
String[][]
contents()
Returns theString
representation of the cells in the in this fixture's
, using this fixture'sJTable
.JTableCellReader
private void
Simulates a user double-clicking this fixture's
.JTable
Simulates a user dragging an item from this fixture's
.JTable
protected final JTableDriver
driver()
Returns the
used by this fixture.JTableDriver
protected final void
driver
(JTableDriver newDriver) Sets the
to be used by this fixture.JTableDriver
Simulates a user dropping an item to this fixture's
.JTable
enterValue
(TableCell cell, String value) Enters the given value in the given cell of this fixture's
, using this fixture'sJTable
.JTableCellWriter
focus()
Gives input focus to this fixture's
.JTable
Returns a fixture that verifies the font of the given table cell.foregroundAt
(TableCell cell) Returns a fixture that verifies the foreground color of the given table cell.Converts the given cell into a coordinate pair.pressAndReleaseKey
(KeyPressInfo keyPressInfo) Simulates a user pressing given key with the given modifiers on this fixture's
.JTable
pressAndReleaseKeys
(int... keyCodes) Simulates a user pressing and releasing the given keys on this fixture's
.JTable
pressKey
(int keyCode) Simulates a user pressing the given key on this fixture's
.JTable
releaseKey
(int keyCode) Simulates a user releasing the given key on this fixture's
.JTable
requireCellValue
(TableCell cell, String value) Asserts that the value of the given cell matches the given value.requireCellValue
(TableCell cell, Pattern pattern) Asserts that the value of the given cell matches the given regular expression pattern.requireColumnCount
(int expected) Asserts that this fixture's
has the given number of columns.JTable
requireContents
(String[][] contents) Asserts that theString
representation of the cell values in this fixture's
is equal to the givenJTable
String
array.Asserts that this fixture's
is disabled.JTable
requireEditable
(TableCell cell) Asserts that the given cell in this fixture's
is editable.JTable
Asserts that this fixture's
is enabled.JTable
requireEnabled
(Timeout timeout) Asserts that this fixture's
is enabled.JTable
Asserts that this fixture's
has input focus.JTable
Verifies that this fixture's
does not have any selection.JTable
requireNotEditable
(TableCell cell) Asserts that the given cell in this fixture's
is not editable.JTable
Asserts that this fixture's
is not visible.JTable
requireRowCount
(int expected) Asserts that this fixture's
has the given number of rows.JTable
requireSelectedRows
(int... rows) Asserts that the set of selected rows in this fixture's
contains to the given row indices.JTable
requireToolTip
(String expected) Asserts that the toolTip in this fixture's
matches the given value.JTable
requireToolTip
(Pattern pattern) Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JTable
Asserts that this fixture's
is visible.JTable
Simulates a user right-clicking this fixture's
.JTable
int
rowCount()
Returns the number of rows that can be shown in this fixture's
, given unlimited space.JTable
selectCell
(TableCell cell) Simulates a user selecting the given cell (row and column) of this fixture's
.JTable
selectCells
(TableCell... cells) Simulates a user selecting the given cells of this fixture's
.JTable
Returns theString
representation of the selected cell in this fixture's
, using this fixture'sJTable
.JTableCellReader
selectRows
(int... rows) Simulates a user selecting the given rows in this fixture's
.JTable
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JTable
Shows a pop-up menu at the given point using this fixture's
as the invoker of the pop-up menu.JTable
showPopupMenuAt
(TableCell cell) Shows a pop-up menu at the given cell.Returns theString
representation of the value of a cell in this fixture's
, using this fixture'sJTable
.JTableCellReader
Methods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
-
Field Details
-
driver
-
-
Constructor Details
-
JTableFixture
Creates a new
.JTableFixture
- Parameters:
robot
- performs simulation of user events on the givenJTable
.target
- theJTable
to be managed by this fixture.- Throws:
NullPointerException
- ifrobot
isnull
.NullPointerException
- iftarget
isnull
.
-
JTableFixture
Creates a new
.JTableFixture
- Parameters:
robot
- performs simulation of user events on aJTable
.tableName
- the name of theJTable
to find using the givenRobot
.- Throws:
NullPointerException
- ifrobot
isnull
.ComponentLookupException
- if a matchingJTable
could not be found.ComponentLookupException
- if more than one matchingJTable
is found.
-
-
Method Details
-
createDriver
private void createDriver() -
driver
Sets the
to be used by this fixture.JTableDriver
- Parameters:
newDriver
- the newJTableDriver
.- Throws:
NullPointerException
- if the given driver isnull
.
-
driver
Returns the
used by this fixture.JTableDriver
- Returns:
- the
JTableDriver
used by this fixture.
-
fontAt
Returns a fixture that verifies the font of the given table cell.- Parameters:
cell
- the given table cell.- Returns:
- a fixture that verifies the font of the given table cell.
- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
backgroundAt
Returns a fixture that verifies the background color of the given table cell.- Parameters:
cell
- the given table cell.- Returns:
- a fixture that verifies the background color of the given table cell.
- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
foregroundAt
Returns a fixture that verifies the foreground color of the given table cell.- Parameters:
cell
- the given table cell.- Returns:
- a fixture that verifies the foreground color of the given table cell.
- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
cellProperty
-
cell
Returns a fixture that manages the table cell whose value matches the given one.- Parameters:
value
- the value of the cell to look for. It can be a regular expression.- Returns:
- a fixture that manages the table cell whose value matches the given one.
- Throws:
ActionFailedException
- if a cell with a matching value cannot be found.
-
cell
Returns a fixture that manages the table cell whose value matches the given regular expression pattern.- Parameters:
valuePattern
- the regular expression pattern to match.- Returns:
- a fixture that manages the table cell whose value matches the given one.
- Throws:
NullPointerException
- if the given regular expression pattern isnull
.ActionFailedException
- if a cell with a matching value cannot be found.- Since:
- 1.2
-
cell
Returns a fixture that manages the table cell found by the given
.TableCellFinder
- Parameters:
cellFinder
- knows how to find a cell.- Returns:
- a fixture that manages the found table cell.
- Throws:
NullPointerException
- if theTableCellFinder
isnull
.ActionFailedException
- if a matching cell could not be found.IndexOutOfBoundsException
- if the row or column indices in the found cell are out of bounds.
-
cell
Returns a fixture that manages the table cell specified by the given row and column.- Parameters:
cell
- the cell of interest.- Returns:
- a fixture that manages the table cell specified by the given row and column.
- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
tableHeader
- Returns:
- a
JTableHeaderFixture
wrapping theJTableHeader
in this fixture'sJTable
. - Throws:
AssertionError
- if theJTableHeader
in this fixture'sJTable
isnull
.
-
selectionValue
Returns theString
representation of the selected cell in this fixture's
, using this fixture'sJTable
. ReturnsJTableCellReader
null
if one can not be obtained or if the
does not have any selected cell.JTable
- Returns:
- the
String
representation of the selected cell. - See Also:
-
pointAt
Converts the given cell into a coordinate pair.- Parameters:
cell
- the given cell.- Returns:
- the coordinates of the given cell.
- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
contents
Returns theString
representation of the cells in the in this fixture's
, using this fixture'sJTable
.JTableCellReader
- Returns:
- the
String
representation of the cells in thi fixture'sJTable
. - See Also:
-
rowCount
public int rowCount()Returns the number of rows that can be shown in this fixture's
, given unlimited space.JTable
- Returns:
- the number of rows shown in this fixture's
JTable
. - See Also:
-
valueAt
Returns theString
representation of the value of a cell in this fixture's
, using this fixture'sJTable
.JTableCellReader
- Parameters:
cell
- the given cell.- Returns:
- the
String
representation of the value of a cell in this fixture'sJTable
. - Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.- See Also:
-
selectCell
Simulates a user selecting the given cell (row and column) of this fixture's
.JTable
- Parameters:
cell
- the cell to select.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
selectCells
Simulates a user selecting the given cells of this fixture's
.JTable
- Parameters:
cells
- the cells to select.- Returns:
- this fixture.
- Throws:
NullPointerException
- ifcells
isnull
or empty.IllegalArgumentException
- ifcells
isnull
or empty.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.NullPointerException
- if any element incells
isnull
.IndexOutOfBoundsException
- if any of the indices of any of thecells
are out of bounds.
-
selectRows
Simulates a user selecting the given rows in this fixture's
.JTable
- Parameters:
rows
- the indices of the row to select.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the given array of indices isnull
.IllegalArgumentException
- if the given array of indices is empty.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.IndexOutOfBoundsException
- if any of the given indices is out of bounds.- Since:
- 1.2
-
drag
Simulates a user dragging an item from this fixture's
.JTable
- Parameters:
cell
- the cell to drag.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
drop
Simulates a user dropping an item to this fixture's
.JTable
- Parameters:
cell
- the cell to drop the dragging item into.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
click
Simulates a user clicking this fixture's
.JTable
- Specified by:
click
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.
-
click
Simulates a user clicking this fixture's
.JTable
- Specified by:
click
in interfaceMouseInputSimulationFixture
- Parameters:
button
- the button to click.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenMouseButton
isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.
-
click
Simulates a user clicking this fixture's
.JTable
- Specified by:
click
in interfaceMouseInputSimulationFixture
- Parameters:
mouseClickInfo
- specifies the button to click and the times the button should be clicked.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenMouseClickInfo
isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.
-
click
Simulates a user clicking a cell in this fixture's
once, using the specified mouse button.JTable
- Parameters:
cell
- the cell to click.button
- the mouse button to use.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
click
Simulates a user clicking a cell in this fixture's
, using the specified mouse button the given number of times.JTable
- Parameters:
cell
- the cell to click.mouseClickInfo
- specifies the mouse button to use and how many times to click.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenMouseClickInfo
isnull
.NullPointerException
- if the cell isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
click
-
doubleClick
Simulates a user double-clicking this fixture's
.JTable
Note: This method will not be successful if the double-clicking occurs on an editable table cell. For this particular case, this method will start edition of the table cell located under the mouse pointer.
- Specified by:
doubleClick
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.
-
rightClick
Simulates a user right-clicking this fixture's
.JTable
- Specified by:
rightClick
in interfaceMouseInputSimulationFixture
- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.
-
pressAndReleaseKey
Simulates a user pressing given key with the given modifiers on this fixture's
. Modifiers is a mask from the availableJTable
masks.InputEvent
- Specified by:
pressAndReleaseKey
in interfaceKeyboardInputSimulationFixture
- Parameters:
keyPressInfo
- specifies the key and modifiers to press.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenKeyPressInfo
isnull
.IllegalArgumentException
- if the given code is not a valid key code.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.- See Also:
-
pressAndReleaseKeys
Simulates a user pressing and releasing the given keys on this fixture's
. This method does not affect the current focus.JTable
- Specified by:
pressAndReleaseKeys
in interfaceKeyboardInputSimulationFixture
- Parameters:
keyCodes
- one or more codes of the keys to press.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the given array of codes isnull
.IllegalArgumentException
- if any of the given code is not a valid key code.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.- See Also:
-
pressKey
Simulates a user pressing the given key on this fixture's
.JTable
- Specified by:
pressKey
in interfaceKeyboardInputSimulationFixture
- Parameters:
keyCode
- the code of the key to press.- Returns:
- this fixture.
- Throws:
IllegalArgumentException
- if any of the given code is not a valid key code.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.- See Also:
-
releaseKey
Simulates a user releasing the given key on this fixture's
.JTable
- Specified by:
releaseKey
in interfaceKeyboardInputSimulationFixture
- Parameters:
keyCode
- the code of the key to release.- Returns:
- this fixture.
- Throws:
IllegalArgumentException
- if any of the given code is not a valid key code.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.- See Also:
-
focus
Gives input focus to this fixture's
.JTable
- Specified by:
focus
in interfaceFocusableComponentFixture
- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.
-
enterValue
Enters the given value in the given cell of this fixture's
, using this fixture'sJTable
. If you need more flexibility for editing cell, please seeJTableCellWriter
.JTableCellFixture.editor()
- Parameters:
cell
- the given cell.value
- the given value.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.IllegalStateException
- if this fixture'sJTable
is not editable.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.ActionFailedException
- if this fixture'sJTableCellValueReader
is unable to enter the given value.- See Also:
-
cellReader
Updates the implementation of
to use when comparing internal values of this fixture'sJTableCellReader
and the values expected in a test. The default implementation to use isJTable
.BasicJTableCellReader
- Parameters:
cellReader
- the newJTableCellValueReader
to use.- Returns:
- this fixture.
- Throws:
NullPointerException
- ifcellReader
isnull
.
-
requireRowCount
Asserts that this fixture's
has the given number of rows.JTable
- Parameters:
expected
- the expected number of rows.- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJTable
does not have the given number of rows.
-
requireSelectedRows
Asserts that the set of selected rows in this fixture's
contains to the given row indices. The given row indices can be a subset of all the selected rows in aJTable
JTable
.- Parameters:
rows
- the indices of the rows expected to be selected.- Returns:
- this fixture.
- Throws:
AssertionError
- if the set of selected rows in this fixture'sJTable
(if any) do not contain the given indices.- Since:
- 1.2
-
requireColumnCount
Asserts that this fixture's
has the given number of columns.JTable
- Parameters:
expected
- the expected number of columns.- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJTable
does not have the given number of columns.
-
requireFocused
Asserts that this fixture's
has input focus.JTable
- Specified by:
requireFocused
in interfaceFocusableComponentFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJTable
does not have input focus.
-
requireEnabled
Asserts that this fixture's
is enabled.JTable
- Specified by:
requireEnabled
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- is the managedJTable
is disabled.
-
requireEnabled
Asserts that this fixture's
is enabled.JTable
- Specified by:
requireEnabled
in interfaceStateVerificationFixture
- Parameters:
timeout
- the time this fixture will wait for the component to be enabled.- Returns:
- this fixture.
- Throws:
WaitTimedOutError
- if the managedJTable
is never enabled.
-
requireDisabled
Asserts that this fixture's
is disabled.JTable
- Specified by:
requireDisabled
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- is the managedJTable
is enabled.
-
requireVisible
Asserts that this fixture's
is visible.JTable
- Specified by:
requireVisible
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if the managedJTable
is not visible.
-
requireNotVisible
Asserts that this fixture's
is not visible.JTable
- Specified by:
requireNotVisible
in interfaceStateVerificationFixture
- Returns:
- this fixture.
- Throws:
AssertionError
- if the managedJTable
is visible.
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given value.JTable
- Specified by:
requireToolTip
in interfaceToolTipDisplayFixture
- Parameters:
expected
- the given value. It can be a regular expression.- Returns:
- this fixture.
- Throws:
AssertionError
- if the toolTip in this fixture'sJTable
does not match the given value.- Since:
- 1.2
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JTable
- Specified by:
requireToolTip
in interfaceToolTipDisplayFixture
- Parameters:
pattern
- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the given regular expression pattern isnull
.AssertionError
- if the toolTip in this fixture'sJTable
does not match the given regular expression pattern.- Since:
- 1.2
-
requireEditable
Asserts that the given cell in this fixture's
is editable.JTable
- Parameters:
cell
- the given cell.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.AssertionError
- if the given cell is not editable.
-
requireNotEditable
Asserts that the given cell in this fixture's
is not editable.JTable
- Parameters:
cell
- the given cell.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.AssertionError
- if the given cell is editable.
-
requireNoSelection
Verifies that this fixture's
does not have any selection.JTable
- Returns:
- this fixture.
- Throws:
AssertionError
- if this fixture'sJTable
has a selection.
-
requireCellValue
Asserts that the value of the given cell matches the given value.- Parameters:
cell
- the given table cell.value
- the expected value. It can be a regular expression.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.AssertionError
- if the value of the given cell does not match the given value.
-
requireCellValue
Asserts that the value of the given cell matches the given regular expression pattern.- Parameters:
cell
- the given table cell.pattern
- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the cell isnull
.NullPointerException
- if the given regular expression pattern isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.AssertionError
- if the value of the given cell does not match the given regular expression pattern.- Since:
- 1.2
-
requireContents
Asserts that theString
representation of the cell values in this fixture's
is equal to the givenJTable
String
array. This method uses this fixture's
to read the values of the table cells asJTableCellReader
String
s.- Parameters:
contents
- the expectedString
representation of the cell values in this fixture'sJTable
.- Returns:
- this fixture.
- See Also:
-
cellWriter
Updates the implementation of
to use when comparing internal values of this fixture'sJTableCellWriter
and the values expected in a test. The default implementation to use isJTable
.BasicJTableCellWriter
- Parameters:
cellWriter
- the newJTableCellValueWriter
to use.- Returns:
- this fixture.
- Throws:
NullPointerException
- ifcellWriter
isnull
.
-
columnIndexFor
Returns the index of the column in this fixture's
whose name matches the given one.JTable
- Parameters:
columnName
- the name of the column to look for.- Returns:
- the index of the column whose name matches the given one.
- Throws:
ActionFailedException
- if a column with a matching name could not be found.
-
clientProperty
Returns the client property stored in this fixture's
, under the given key.JTable
- Specified by:
clientProperty
in interfaceClientPropertyStorageFixture
- Parameters:
key
- the key to use to retrieve the client property.- Returns:
- the value of the client property stored under the given key, or
null
if the property was not found. - Throws:
NullPointerException
- if the given key isnull
.- Since:
- 1.2
-
showPopupMenu
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JTable
- Specified by:
showPopupMenu
in interfaceJPopupMenuInvokerFixture
- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.
-
showPopupMenuAt
Shows a pop-up menu at the given point using this fixture's
as the invoker of the pop-up menu.JTable
- Specified by:
showPopupMenuAt
in interfaceJPopupMenuInvokerFixture
- Parameters:
p
- the given point where to show the pop-up menu.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.
-
showPopupMenuAt
Shows a pop-up menu at the given cell.- Parameters:
cell
- the table cell where to show the pop-up menu.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
NullPointerException
- if the cell isnull
.IllegalStateException
- if this fixture'sJTable
is disabled.IllegalStateException
- if this fixture'sJTable
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.
-