Package org.testfx.assertions.api
Class AbstractTableViewAssert<SELF extends AbstractTableViewAssert<SELF,T>,T>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,javafx.css.Styleable>
-
- org.testfx.assertions.api.AbstractStyleableAssert<SELF>
-
- org.testfx.assertions.api.AbstractNodeAssert<SELF>
-
- org.testfx.assertions.api.AbstractTableViewAssert<SELF,T>
-
- All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,javafx.css.Styleable>,org.assertj.core.api.Descriptable<SELF>,org.assertj.core.api.ExtensionPoints<SELF,javafx.css.Styleable>
- Direct Known Subclasses:
TableViewAssert
public class AbstractTableViewAssert<SELF extends AbstractTableViewAssert<SELF,T>,T> extends AbstractNodeAssert<SELF>
Base class for allTableViewassertions.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTableViewAssert(javafx.scene.control.TableView<T> actual, java.lang.Class<?> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SELFcontainsRow(java.lang.Object... cells)Verifies that the actualTableViewcontains the given tablecellsat any row index.SELFcontainsRowAtIndex(int rowIndex, java.lang.Object... cells)Verifies that the actualTableViewcontains the given tablecellsat the givenrowIndex.SELFdoesNotContainRow(java.lang.Object... cells)Verifies that the actualTableViewdoes not contain the given tablecellsat any row index.SELFdoesNotContainRowAtIndex(int rowIndex, java.lang.Object... cells)Verifies that the actualTableViewdoes not contain the given tablecellsat the givenrowIndex.SELFdoesNotHaveExactlyNumRows(int rows)Verifies that the actualTableViewdoes not have exactly the givenamountof rows.SELFdoesNotHaveTableCell(java.lang.Object expectedValue)Verifies that the actualTableViewdoes not contain the given table cellexpectedValue.SELFhasExactlyNumRows(int rows)Verifies that the actualTableViewhas exactly the givenamountof rows.SELFhasTableCell(java.lang.Object expectedValue)Verifies that the actualTableViewcontains the given table cellexpectedValue.-
Methods inherited from class org.testfx.assertions.api.AbstractNodeAssert
doesNotHaveChild, hasChild, hasExactlyChildren, isDisabled, isEnabled, isFocused, isInvisible, isNotFocused, isVisible
-
Methods inherited from class org.testfx.assertions.api.AbstractStyleableAssert
doesNotHaveId, doesNotHaveStyle, doesNotHaveStyleableParent, doesNotHaveTypeSelector, hasId, hasStyle, hasStyleableParent, hasTypeSelector
-
Methods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Constructor Detail
-
AbstractTableViewAssert
protected AbstractTableViewAssert(javafx.scene.control.TableView<T> actual, java.lang.Class<?> selfType)
-
-
Method Detail
-
hasTableCell
public SELF hasTableCell(java.lang.Object expectedValue)
Verifies that the actualTableViewcontains the given table cellexpectedValue.Test code must ensure that the cell is visible by scrolling it into the viewport before using the matcher:
int row = ... int col = ... tableView.scrollTo(row); tableView.scrollToColumn(col); verifyThat(tableView, hasTableCell(contentOfCell);- Parameters:
expectedValue- the given table cell value to ensure theTableViewcontains- Returns:
- this assertion object
-
doesNotHaveTableCell
public SELF doesNotHaveTableCell(java.lang.Object expectedValue)
Verifies that the actualTableViewdoes not contain the given table cellexpectedValue.- Parameters:
expectedValue- the given table cell value to ensure theTableViewdoes not contain- Returns:
- this assertion object
-
hasExactlyNumRows
public SELF hasExactlyNumRows(int rows)
Verifies that the actualTableViewhas exactly the givenamountof rows.- Parameters:
rows- the given amount of rows to compare the actual amount of rows to- Returns:
- this assertion object
-
doesNotHaveExactlyNumRows
public SELF doesNotHaveExactlyNumRows(int rows)
Verifies that the actualTableViewdoes not have exactly the givenamountof rows.- Parameters:
rows- the given amount of rows to compare the actual amount of rows to- Returns:
- this assertion object
-
containsRowAtIndex
public SELF containsRowAtIndex(int rowIndex, java.lang.Object... cells)
Verifies that the actualTableViewcontains the given tablecellsat the givenrowIndex.For example, given a
TableViewthat has three columns:
Then to verify that such aTableColumn<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);TableView, contains, at index 3, a row for aRegularPolygonthat has the name "Pentagon", the number of sides 5, and a unit area of 1.720477401 one would use:
Where the types of each argument, after the row index, correspond to the types of theassertThat(polygonsTable).containsRowAtIndex(3, "Pentagon", 5, 1.720477401);TableColumns which in our example is(String, Integer, Double).- Parameters:
rowIndex- the given row index that the actualTableViewshould contain the given cells oncells- the cells that should be contained at the given row index- Returns:
- this assertion object
-
doesNotContainRowAtIndex
public SELF doesNotContainRowAtIndex(int rowIndex, java.lang.Object... cells)
Verifies that the actualTableViewdoes not contain the given tablecellsat the givenrowIndex.- Parameters:
rowIndex- the given row index that the actualTableViewshould not contain the given cells oncells- the cells that should not be contained at the given row index- Returns:
- this assertion object
-
containsRow
public SELF containsRow(java.lang.Object... cells)
Verifies that the actualTableViewcontains the given tablecellsat any row index.For example, given a
TableViewthat has three columns:
Then to verify that such aTableColumn<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);TableView, contains at least one row with aPersonthat has the name "Dan Anderson", the body mass index 28.83, and a valid gym membership (true) one would use:
Where the types of each argument correspond to the types of theassertThat(fitnessTable).containsRow("Dan Anderson", 28.83, true);TableColumns which in our example is(String, Double, Boolean).- Parameters:
cells- the cells that should be contained at any (at least one) row index- Returns:
- this assertion object
-
doesNotContainRow
public SELF doesNotContainRow(java.lang.Object... cells)
Verifies that the actualTableViewdoes not contain the given tablecellsat any row index.- Parameters:
cells- the cells that should not be contained at any (at least one) row index- Returns:
- this assertion object
-
-