Package org.fest.swing.fixture
Class JTreePathFixture
java.lang.Object
org.fest.swing.fixture.JTreePathFixture
- All Implemented Interfaces:
ItemFixture,JTreeNodeFixture,MouseInputSimulationFixture
Understands functional testing of single nodes, referenced by their paths, in
JTrees:
- user input simulation
- state verification
- property value query
- Since:
- 1.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJTreePathFixture(JTreeFixture tree, String path) Creates a newJTreePathFixture. -
Method Summary
Modifier and TypeMethodDescriptionclick()Simulates a user clicking this fixture's tree node.click(MouseButton button) Simulates a user clicking this fixture's tree node.click(MouseClickInfo mouseClickInfo) Simulates a user clicking this fixture's tree node.collapse()Simulates a user collapsing this fixture's tree node.Simulates a user double-clicking this fixture's tree node.drag()Simulates a user dragging this fixture's tree node.drop()Simulates a user dropping relative to this fixture's tree node.expand()Simulates a user expanding this fixture's tree node.path()Returns the path of this fixture's node.Simulates a user right-clicking this fixture's tree node.select()Selects the this fixture's tree node, expanding parent nodes if necessary.Shows a pop-up menu using this fixture's tree node as the invoker of the pop-up menu.value()Returns theStringrepresentation of this fixture's tree node.
-
Field Details
-
path
-
tree
-
-
Constructor Details
-
JTreePathFixture
Creates a newJTreePathFixture.- Parameters:
tree- handles theJTreecontaining the node with the given path.path- the given path.
-
-
Method Details
-
expand
Simulates a user expanding this fixture's tree node.- Specified by:
expandin interfaceJTreeNodeFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.ActionFailedException- if this method fails to expand the path.- Since:
- 1.2
-
collapse
Simulates a user collapsing this fixture's tree node.- Specified by:
collapsein interfaceJTreeNodeFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.ActionFailedException- if this method fails to collapse the path.- Since:
- 1.2
-
select
Selects the this fixture's tree node, expanding parent nodes if necessary. This method will not click the node if it is already selected.- Specified by:
selectin interfaceItemFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.
-
click
Simulates a user clicking this fixture's tree node.- Specified by:
clickin interfaceMouseInputSimulationFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.
-
click
Simulates a user clicking this fixture's tree node.- Specified by:
clickin interfaceMouseInputSimulationFixture- Parameters:
button- the button to click.- Returns:
- this fixture.
- Throws:
NullPointerException- if the given button isnull.IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.
-
click
Simulates a user clicking this fixture's tree node.- Specified by:
clickin interfaceMouseInputSimulationFixture- Parameters:
mouseClickInfo- specifies the button to click and the times the button should be clicked.- Returns:
- this fixture.
- Throws:
NullPointerException- if the givenMouseClickInfoisnull.IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.
-
doubleClick
Simulates a user double-clicking this fixture's tree node.- Specified by:
doubleClickin interfaceMouseInputSimulationFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.
-
rightClick
Simulates a user right-clicking this fixture's tree node.- Specified by:
rightClickin interfaceMouseInputSimulationFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.
-
drag
Simulates a user dragging this fixture's tree node.- Specified by:
dragin interfaceItemFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.
-
drop
Simulates a user dropping relative to this fixture's tree node.- Specified by:
dropin interfaceItemFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.ActionFailedException- if there is no drag action in effect.
-
showPopupMenu
Shows a pop-up menu using this fixture's tree node as the invoker of the pop-up menu.- Specified by:
showPopupMenuin interfaceItemFixture- Returns:
- a fixture that handles functional testing of the displayed pop-up menu.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.ComponentLookupException- if a pop-up menu cannot be found.
-
value
Returns theStringrepresentation of this fixture's tree node.- Specified by:
valuein interfaceItemFixture- Returns:
- the
Stringrepresentation of this fixture's tree node.
-
path
Returns the path of this fixture's node.- Returns:
- the path of this fixture's node.
-