Package org.fest.swing.fixture
Interface ItemGroupFixture
- All Known Implementing Classes:
JComboBoxFixture,JListFixture
public interface ItemGroupFixture
-
Method Summary
Modifier and TypeMethodDescriptionClears the selection in this fixture's.ComponentString[]contents()Returns theStringrepresentation of the elements in this fixture's.ComponentrequireItemCount(int expected) Verifies that this fixture'shas the expected number of itemsComponentVerifies that this fixture'sdoes not have a selection.ComponentrequireSelection(int index) Verifies that the index of the selected item in this fixture'sis equal to the given value.ComponentrequireSelection(String value) Verifies that the value of the selected item in this fixture'smatches the given value.ComponentrequireSelection(Pattern pattern) Verifies that the value of the selected item in this fixture'smatches the given regular expression pattern.ComponentselectItem(int index) Simulates a user selecting an item in this fixture's.ComponentselectItem(String value) Simulates a user selecting an item in this fixture's.ComponentselectItem(Pattern pattern) Simulates a user selecting an item in this fixture's.ComponentvalueAt(int index) Returns the value of an item in themanaged by this fixture.Component
-
Method Details
-
contents
String[] contents()Returns theStringrepresentation of the elements in this fixture's.Component- Returns:
- the
Stringrepresentation of the elements in this fixture'sComponent.
-
clearSelection
ItemGroupFixture clearSelection()Clears the selection in this fixture's.Component- Returns:
- this fixture.
- Since:
- 1.2
-
selectItem
Simulates a user selecting an item in this fixture's.Component- Parameters:
index- the index of the item to select.- Returns:
- this fixture.
-
selectItem
Simulates a user selecting an item in this fixture's.Component- Parameters:
value- the value of the item to select. It can be a regular expression.- Returns:
- this fixture.
-
selectItem
Simulates a user selecting an item in this fixture's. The text of the item to select must match the given regular expression pattern.Component- Parameters:
pattern- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
NullPointerException- if the given regular expression pattern isnull.- Since:
- 1.2
-
valueAt
Returns the value of an item in themanaged by this fixture. If the value is not meaningful, this method will returnComponentnull.- Parameters:
index- the index of the item to return.- Returns:
- the value of the item under the given index, or
nullif nothing meaningful.
-
requireSelection
Verifies that the value of the selected item in this fixture'smatches the given value.Component- Parameters:
value- the value to match. It can be a regular expression.- Returns:
- this fixture.
- Throws:
AssertionError- if the selected item does not match the given value.
-
requireSelection
Verifies that the value of the selected item in this fixture'smatches the given regular expression pattern.Component- Parameters:
pattern- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
NullPointerException- if the given regular expression pattern isnull.AssertionError- if the selected item does not match the given regular expression pattern.- Since:
- 1.2
-
requireSelection
Verifies that the index of the selected item in this fixture'sis equal to the given value.Component- Parameters:
index- the expected selection index.- Returns:
- this fixture.
- Throws:
AssertionError- if the selection index is not equal to the given value.- Since:
- 1.2
-
requireNoSelection
ItemGroupFixture requireNoSelection()Verifies that this fixture'sdoes not have a selection.Component- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sComponenthas a selection.
-
requireItemCount
Verifies that this fixture'shas the expected number of itemsComponent- Parameters:
expected- the expected number of items.- Returns:
- this fixture.
- Throws:
AssertionError- if the number of items in this fixture'sComponentis not equal to the expected one.- Since:
- 1.2
-