- java.lang.Object
-
- org.testfx.matcher.control.ComboBoxMatchers
-
public class ComboBoxMatchers extends Object
TestFX matchers forComboBoxcontrols.Example
The following code:
will verify thatComboBox<String> fruits = new ComboBox<>(); fruits.getItems().addAll("Apple", "Banana", "Cherry"); assertThat(fruits, ComboBoxMatchers.containsExactlyItemsInOrder("Apple", "Banana", "Cherry"));fruitscontains exactly (only) theString's "Apple", "Banana", and "Cherry" in order.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> org.hamcrest.Matcher<ComboBox>containsExactlyItems(T... items)Creates a matcher that matches allComboBoxes that only have all of the givenitems, regardless of the order of their appearance.static <T> org.hamcrest.Matcher<ComboBox>containsExactlyItemsInOrder(T... items)Creates a matcher that matches allComboBoxes that only have all of the givenitemsin the exact order they are given.static <T> org.hamcrest.Matcher<ComboBox>containsItems(T... items)Creates a matcher that matches allComboBoxes that have all of the givenitems, regardless of whether it also contains other items and regardless of their order of appearance.static <T> org.hamcrest.Matcher<ComboBox>containsItemsInOrder(T... items)Creates a matcher that matches allComboBoxes that have all of the givenitemsin the exact order they appear, regardless of whether it also contains other items before or after this exact sequence.static org.hamcrest.Matcher<ComboBox>hasItems(int amount)Creates a matcher that matches allComboBoxes that have exactlyamountitems.static <T> org.hamcrest.Matcher<ComboBox>hasSelectedItem(T selection)Creates a matcher that matches allComboBoxes that have givenselectionas its selected item.
-
-
-
Method Detail
-
hasItems
public static org.hamcrest.Matcher<ComboBox> hasItems(int amount)
Creates a matcher that matches allComboBoxes that have exactlyamountitems.- Parameters:
amount- the number of items the matched ComboBox's should have
-
hasSelectedItem
public static <T> org.hamcrest.Matcher<ComboBox> hasSelectedItem(T selection)
Creates a matcher that matches allComboBoxes that have givenselectionas its selected item.- Parameters:
selection- the selected item the matched ComboBox's should have
-
containsItems
public static <T> org.hamcrest.Matcher<ComboBox> containsItems(T... items)
Creates a matcher that matches allComboBoxes that have all of the givenitems, regardless of whether it also contains other items and regardless of their order of appearance.- Parameters:
items- the items the matched ComboBox's should have
-
containsExactlyItems
public static <T> org.hamcrest.Matcher<ComboBox> containsExactlyItems(T... items)
Creates a matcher that matches allComboBoxes that only have all of the givenitems, regardless of the order of their appearance.- Parameters:
items- the only items the matched ComboBox's should have
-
containsItemsInOrder
public static <T> org.hamcrest.Matcher<ComboBox> containsItemsInOrder(T... items)
Creates a matcher that matches allComboBoxes that have all of the givenitemsin the exact order they appear, regardless of whether it also contains other items before or after this exact sequence.- Parameters:
items- the items the matched ComboBox's should have in the same order
-
containsExactlyItemsInOrder
public static <T> org.hamcrest.Matcher<ComboBox> containsExactlyItemsInOrder(T... items)
Creates a matcher that matches allComboBoxes that only have all of the givenitemsin the exact order they are given.- Parameters:
items- the only items the matched ComboBox's should have in the same order
-
-