public class AbstractTableViewAssert<SELF extends AbstractTableViewAssert<SELF,T>,T> extends AbstractNodeAssert<SELF>
TableView assertions.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTableViewAssert(javafx.scene.control.TableView<T> actual,
java.lang.Class<?> selfType) |
| Modifier and Type | Method and Description |
|---|---|
SELF |
containsRow(java.lang.Object... cells)
Verifies that the actual
TableView contains the given table cells
at any row index. |
SELF |
containsRowAtIndex(int rowIndex,
java.lang.Object... cells)
Verifies that the actual
TableView contains the given table cells
at the given rowIndex. |
SELF |
doesNotContainRow(java.lang.Object... cells)
Verifies that the actual
TableView does not contain the given
table cells at any row index. |
SELF |
doesNotContainRowAtIndex(int rowIndex,
java.lang.Object... cells)
Verifies that the actual
TableView does not contain the given
table cells at the given rowIndex. |
SELF |
doesNotHaveExactlyNumRows(int rows)
Verifies that the actual
TableView does not have exactly the given
amount of rows. |
SELF |
doesNotHaveTableCell(java.lang.Object expectedValue)
Verifies that the actual
TableView does not contain the given table
cell expectedValue. |
SELF |
hasExactlyNumRows(int rows)
Verifies that the actual
TableView has exactly the given amount
of rows. |
SELF |
hasTableCell(java.lang.Object expectedValue)
Verifies that the actual
TableView contains the given table cell
expectedValue. |
doesNotHaveChild, hasChild, hasExactlyChildren, isDisabled, isEnabled, isFocused, isInvisible, isNotFocused, isVisibleas, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnErrorprotected AbstractTableViewAssert(javafx.scene.control.TableView<T> actual, java.lang.Class<?> selfType)
public SELF hasTableCell(java.lang.Object expectedValue)
TableView contains the given table cell
expectedValue.expectedValue - the given table cell value to ensure the TableView containspublic SELF doesNotHaveTableCell(java.lang.Object expectedValue)
TableView does not contain the given table
cell expectedValue.expectedValue - the given table cell value to ensure the TableView does not containpublic SELF hasExactlyNumRows(int rows)
TableView has exactly the given amount
of rows.rows - the given amount of rows to compare the actual amount of rows topublic SELF doesNotHaveExactlyNumRows(int rows)
TableView does not have exactly the given
amount of rows.rows - the given amount of rows to compare the actual amount of rows topublic SELF containsRowAtIndex(int rowIndex, java.lang.Object... cells)
TableView contains the given table cells
at the given rowIndex.
For example, given a TableView that has three columns:
TableColumn<RegularPolygon, String> nameColumn = new TableColumn<>("Name");
TableColumn<RegularPolygon, Integer> numSidesColumn = new TableColumn<>("Number of Sides");
TableColumn<RegularPolygon, Double> unitAreaColumn = new TableColumn<>("Area when Side = 1");
polygonsTable.getColumns().setAll(nameColumn, numSidesColumn, unitAreaColumn);
Then to verify that such a TableView, contains, at index 3, a row for a RegularPolygon
that has the name "Pentagon", the number of sides 5, and a unit area of
1.720477401 one would use:
assertThat(polygonsTable).containsRowAtIndex(3, "Pentagon", 5, 1.720477401);
Where the types of each argument, after the row index, correspond to the types of the TableColumns
which in our example is (String, Integer, Double).rowIndex - the given row index that the actual TableView should contain the given cells oncells - the cells that should be contained at the given row indexpublic SELF doesNotContainRowAtIndex(int rowIndex, java.lang.Object... cells)
TableView does not contain the given
table cells at the given rowIndex.rowIndex - the given row index that the actual TableView should not contain
the given cells oncells - the cells that should not be contained at the given row indexpublic SELF containsRow(java.lang.Object... cells)
TableView contains the given table cells
at any row index.
For example, given a TableView that has three columns:
TableColumn<Person, String> nameColumn = new TableColumn<>("Name");
TableColumn<Person, Double> bmiColumn = new TableColumn<>("Body Mass Index");
TableColumn<Person, Boolean> membershipColumn = new TableColumn<>("Gym Membership Valid");
fitnessTable.getColumns().setAll(nameColumn, bmiColumn, membershipColumn);
Then to verify that such a TableView, contains at least one row with a Person
that has the name "Dan Anderson", the body mass index 28.83, and a valid
gym membership (true) one would use:
assertThat(fitnessTable).containsRow("Dan Anderson", 28.83, true);
Where the types of each argument correspond to the types of the TableColumns which
in our example is (String, Double, Boolean).cells - the cells that should be contained at any (at least one) row indexpublic SELF doesNotContainRow(java.lang.Object... cells)
TableView does not contain the given
table cells at any row index.cells - the cells that should not be contained at any (at least one) row index