org.fest.swing.fixture
Class JSplitPaneFixture

java.lang.Object
  extended by org.fest.swing.fixture.ComponentFixture<JSplitPane>
      extended by org.fest.swing.fixture.JSplitPaneFixture
All Implemented Interfaces:
ClientPropertyStorageFixture, CommonComponentFixture, FocusableComponentFixture, JComponentFixture, JPopupMenuInvokerFixture, KeyboardInputSimulationFixture, MouseInputSimulationFixture, StateVerificationFixture, ToolTipDisplayFixture

public class JSplitPaneFixture
extends ComponentFixture<JSplitPane>
implements CommonComponentFixture, JComponentFixture, JPopupMenuInvokerFixture

Understands functional testing of JSplitPanes:

Author:
Yvonne Wang, Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.swing.fixture.ComponentFixture
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target
 
Constructor Summary
JSplitPaneFixture(Robot robot, JSplitPane target)
          Creates a new JSplitPaneFixture.
JSplitPaneFixture(Robot robot, String spinnerName)
          Creates a new JSplitPaneFixture.
 
Method Summary
 JSplitPaneFixture click()
          Simulates a user clicking this fixture's JSplitPane.
 JSplitPaneFixture click(MouseButton button)
          Simulates a user clicking this fixture's JSplitPane.
 JSplitPaneFixture click(MouseClickInfo mouseClickInfo)
          Simulates a user clicking this fixture's JSplitPane.
 Object clientProperty(Object key)
          Returns the client property stored in this fixture's JSplitPane, under the given key.
 JSplitPaneFixture doubleClick()
          Simulates a user double-clicking this fixture's JSplitPane.
protected  void driver(JSplitPaneDriver newDriver)
          Sets the JSplitPaneDriver to be used by this fixture.
 JSplitPaneFixture focus()
          Gives input focus to this fixture's JSplitPane.
 JSplitPaneFixture moveDividerTo(int location)
          Simulates a user moving the divider of this fixture's JSplitPane.
 JSplitPaneFixture pressAndReleaseKey(KeyPressInfo keyPressInfo)
          Simulates a user pressing given key with the given modifiers on this fixture's JSplitPane.
 JSplitPaneFixture pressAndReleaseKeys(int... keyCodes)
          Simulates a user pressing and releasing the given keys on this fixture's JSplitPane.
 JSplitPaneFixture pressKey(int keyCode)
          Simulates a user pressing the given key on this fixture's JSplitPane.
 JSplitPaneFixture releaseKey(int keyCode)
          Simulates a user releasing the given key on this fixture's JSplitPane.
 JSplitPaneFixture requireDisabled()
          Asserts that this fixture's JSplitPane is disabled.
 JSplitPaneFixture requireEnabled()
          Asserts that this fixture's JSplitPane is enabled.
 JSplitPaneFixture requireEnabled(Timeout timeout)
          Asserts that this fixture's JSplitPane is enabled.
 JSplitPaneFixture requireFocused()
          Asserts that this fixture's JSplitPane has input focus.
 JSplitPaneFixture requireNotVisible()
          Asserts that this fixture's JSplitPane is not visible.
 JSplitPaneFixture requireToolTip(Pattern pattern)
          Asserts that the toolTip in this fixture's JSplitPane matches the given regular expression pattern.
 JSplitPaneFixture requireToolTip(String expected)
          Asserts that the toolTip in this fixture's JSplitPane matches the given value.
 JSplitPaneFixture requireVisible()
          Asserts that this fixture's JSplitPane is visible.
 JSplitPaneFixture rightClick()
          Simulates a user right-clicking this fixture's JSplitPane.
 JPopupMenuFixture showPopupMenu()
          Shows a pop-up menu using this fixture's JSplitPane as the invoker of the pop-up menu.
 JPopupMenuFixture showPopupMenuAt(Point p)
          Shows a pop-up menu at the given point using this fixture's JSplitPane as the invoker of the pop-up menu.
 
Methods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSplitPaneFixture

public JSplitPaneFixture(Robot robot,
                         JSplitPane target)
Creates a new JSplitPaneFixture.

Parameters:
robot - performs simulation of user events on the given JSplitPane.
target - the JSplitPane to be managed by this fixture.
Throws:
NullPointerException - if robot is null.
NullPointerException - if target is null.

JSplitPaneFixture

public JSplitPaneFixture(Robot robot,
                         String spinnerName)
Creates a new JSplitPaneFixture.

Parameters:
robot - performs simulation of user events on a JSplitPane.
spinnerName - the name of the JSplitPane to find using the given Robot.
Throws:
ComponentLookupException - if a matching JSplitPane could not be found.
ComponentLookupException - if more than one matching JSplitPane is found.
Method Detail

driver

protected final void driver(JSplitPaneDriver newDriver)
Sets the JSplitPaneDriver to be used by this fixture.

Parameters:
newDriver - the new JSplitPaneDriver.
Throws:
NullPointerException - if the given driver is null.

moveDividerTo

public JSplitPaneFixture moveDividerTo(int location)
Simulates a user moving the divider of this fixture's JSplitPane.

Since 1.2, this method respects the minimum and maximum values of the left and right components inside this fixture's JSplitPane.

Parameters:
location - the location to move the divider to.
Returns:
this fixture.
Throws:
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.

click

public JSplitPaneFixture click()
Simulates a user clicking this fixture's JSplitPane.

Specified by:
click in interface MouseInputSimulationFixture
Returns:
this fixture.
Throws:
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.

click

public JSplitPaneFixture click(MouseButton button)
Simulates a user clicking this fixture's JSplitPane.

Specified by:
click in interface MouseInputSimulationFixture
Parameters:
button - the button to click.
Returns:
this fixture.
Throws:
NullPointerException - if the given MouseButton is null.
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.

click

public JSplitPaneFixture click(MouseClickInfo mouseClickInfo)
Simulates a user clicking this fixture's JSplitPane.

Specified by:
click in interface MouseInputSimulationFixture
Parameters:
mouseClickInfo - specifies the button to click and the times the button should be clicked.
Returns:
this fixture.
Throws:
NullPointerException - if the given MouseClickInfo is null.
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.

doubleClick

public JSplitPaneFixture doubleClick()
Simulates a user double-clicking this fixture's JSplitPane.

Specified by:
doubleClick in interface MouseInputSimulationFixture
Returns:
this fixture.
Throws:
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.

rightClick

public JSplitPaneFixture rightClick()
Simulates a user right-clicking this fixture's JSplitPane.

Specified by:
rightClick in interface MouseInputSimulationFixture
Returns:
this fixture.
Throws:
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.

focus

public JSplitPaneFixture focus()
Gives input focus to this fixture's JSplitPane.

Specified by:
focus in interface FocusableComponentFixture
Returns:
this fixture.
Throws:
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.

pressAndReleaseKey

public JSplitPaneFixture pressAndReleaseKey(KeyPressInfo keyPressInfo)
Simulates a user pressing given key with the given modifiers on this fixture's JSplitPane. Modifiers is a mask from the available InputEvent masks.

Specified by:
pressAndReleaseKey in interface KeyboardInputSimulationFixture
Parameters:
keyPressInfo - specifies the key and modifiers to press.
Returns:
this fixture.
Throws:
NullPointerException - if the given KeyPressInfo is null.
IllegalArgumentException - if the given code is not a valid key code.
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.
See Also:
KeyPressInfo

pressAndReleaseKeys

public JSplitPaneFixture pressAndReleaseKeys(int... keyCodes)
Simulates a user pressing and releasing the given keys on this fixture's JSplitPane. This method does not affect the current focus.

Specified by:
pressAndReleaseKeys in interface KeyboardInputSimulationFixture
Parameters:
keyCodes - one or more codes of the keys to press.
Returns:
this fixture.
Throws:
NullPointerException - if the given array of codes is null.
IllegalArgumentException - if any of the given code is not a valid key code.
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.
See Also:
KeyEvent

pressKey

public JSplitPaneFixture pressKey(int keyCode)
Simulates a user pressing the given key on this fixture's JSplitPane.

Specified by:
pressKey in interface KeyboardInputSimulationFixture
Parameters:
keyCode - the code of the key to press.
Returns:
this fixture.
Throws:
IllegalArgumentException - if any of the given code is not a valid key code.
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.
See Also:
KeyEvent

releaseKey

public JSplitPaneFixture releaseKey(int keyCode)
Simulates a user releasing the given key on this fixture's JSplitPane.

Specified by:
releaseKey in interface KeyboardInputSimulationFixture
Parameters:
keyCode - the code of the key to release.
Returns:
this fixture.
Throws:
IllegalArgumentException - if any of the given code is not a valid key code.
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.
See Also:
KeyEvent

requireFocused

public JSplitPaneFixture requireFocused()
Asserts that this fixture's JSplitPane has input focus.

Specified by:
requireFocused in interface FocusableComponentFixture
Returns:
this fixture.
Throws:
AssertionError - if this fixture's JSplitPane does not have input focus.

requireEnabled

public JSplitPaneFixture requireEnabled()
Asserts that this fixture's JSplitPane is enabled.

Specified by:
requireEnabled in interface StateVerificationFixture
Returns:
this fixture.
Throws:
AssertionError - if this fixture's JSplitPane is disabled.

requireEnabled

public JSplitPaneFixture requireEnabled(Timeout timeout)
Asserts that this fixture's JSplitPane is enabled.

Specified by:
requireEnabled in interface StateVerificationFixture
Parameters:
timeout - the time this fixture will wait for the component to be enabled.
Returns:
this fixture.
Throws:
WaitTimedOutError - if this fixture's JSplitPane is never enabled.

requireDisabled

public JSplitPaneFixture requireDisabled()
Asserts that this fixture's JSplitPane is disabled.

Specified by:
requireDisabled in interface StateVerificationFixture
Returns:
this fixture.
Throws:
AssertionError - if this fixture's JSplitPane is enabled.

requireVisible

public JSplitPaneFixture requireVisible()
Asserts that this fixture's JSplitPane is visible.

Specified by:
requireVisible in interface StateVerificationFixture
Returns:
this fixture.
Throws:
AssertionError - if this fixture's JSplitPane is not visible.

requireNotVisible

public JSplitPaneFixture requireNotVisible()
Asserts that this fixture's JSplitPane is not visible.

Specified by:
requireNotVisible in interface StateVerificationFixture
Returns:
this fixture.
Throws:
AssertionError - if this fixture's JSplitPane is visible.

requireToolTip

public JSplitPaneFixture requireToolTip(String expected)
Asserts that the toolTip in this fixture's JSplitPane matches the given value.

Specified by:
requireToolTip in interface ToolTipDisplayFixture
Parameters:
expected - the given value. It can be a regular expression.
Returns:
this fixture.
Throws:
AssertionError - if the toolTip in this fixture's JSplitPane does not match the given value.
Since:
1.2

requireToolTip

public JSplitPaneFixture requireToolTip(Pattern pattern)
Asserts that the toolTip in this fixture's JSplitPane matches the given regular expression pattern.

Specified by:
requireToolTip in interface ToolTipDisplayFixture
Parameters:
pattern - the regular expression pattern to match.
Returns:
this fixture.
Throws:
NullPointerException - if the given regular expression pattern is null.
AssertionError - if the toolTip in this fixture's JSplitPane does not match the given regular expression.
Since:
1.2

clientProperty

public Object clientProperty(Object key)
Returns the client property stored in this fixture's JSplitPane, under the given key.

Specified by:
clientProperty in interface ClientPropertyStorageFixture
Parameters:
key - the key to use to retrieve the client property.
Returns:
the value of the client property stored under the given key, or null if the property was not found.
Throws:
NullPointerException - if the given key is null.
Since:
1.2

showPopupMenu

public JPopupMenuFixture showPopupMenu()
Shows a pop-up menu using this fixture's JSplitPane as the invoker of the pop-up menu.

Specified by:
showPopupMenu in interface JPopupMenuInvokerFixture
Returns:
a fixture that manages the displayed pop-up menu.
Throws:
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.
ComponentLookupException - if a pop-up menu cannot be found.

showPopupMenuAt

public JPopupMenuFixture showPopupMenuAt(Point p)
Shows a pop-up menu at the given point using this fixture's JSplitPane as the invoker of the pop-up menu.

Specified by:
showPopupMenuAt in interface JPopupMenuInvokerFixture
Parameters:
p - the given point where to show the pop-up menu.
Returns:
a fixture that manages the displayed pop-up menu.
Throws:
IllegalStateException - if this fixture's JSplitPane is disabled.
IllegalStateException - if this fixture's JSplitPane is not showing on the screen.
ComponentLookupException - if a pop-up menu cannot be found.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.