org.fest.swing.core
Class Settings

java.lang.Object
  extended by org.fest.swing.core.Settings

public class Settings
extends Object

Understands configuration settings.

Author:
Alex Ruiz

Constructor Summary
Settings()
           
 
Method Summary
 ComponentLookupScope componentLookupScope()
          Returns the scope of component lookups.
 void componentLookupScope(ComponentLookupScope scope)
          Updates the scope of component lookups.
 int delayBetweenEvents()
          Returns a value representing the millisecond count in between generated events.
 void delayBetweenEvents(int ms)
          Updates the value representing the millisecond count in between generated events.
 int dragDelay()
          Returns the number of milliseconds to wait between a pressing a mouse button and moving the mouse.
 void dragDelay(int ms)
          Updates the number of milliseconds to wait between a pressing a mouse button and moving the mouse.
 int dropDelay()
          Returns the number of milliseconds between the final mouse movement and mouse release to ensure drop ends.
 void dropDelay(int ms)
          Updates the number of milliseconds between the final mouse movement and mouse release to ensure drop ends.
 int eventPostingDelay()
          Returns the number of milliseconds before checking for idle.
 void eventPostingDelay(int ms)
          Updates the number of milliseconds before checking for idle.
 int idleTimeout()
          Returns the time (in milliseconds) to wait for an idle AWT event queue.
 void idleTimeout(int ms)
          Updates the time (in milliseconds) to wait for an idle AWT event queue.
 int timeoutToBeVisible()
          Returns the number of milliseconds to wait for a component to be visible.
 void timeoutToBeVisible(int ms)
          Updates the number of milliseconds to wait for a component to be visible.
 int timeoutToFindPopup()
          Returns the number of milliseconds to wait before failing to find a pop-up menu that should appear.
 void timeoutToFindPopup(int ms)
          Updates the number of milliseconds to wait before failing to find a pop-up menu that should appear.
 int timeoutToFindSubMenu()
          Returns the number of milliseconds to wait for a sub-menu to appear.
 void timeoutToFindSubMenu(int ms)
          Updates the number of milliseconds to wait for a sub-menu to appear.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Settings

public Settings()
Method Detail

delayBetweenEvents

public int delayBetweenEvents()
Returns a value representing the millisecond count in between generated events. The default is 60 milliseconds.

Returns:
a value representing the millisecond count in between generated events.

delayBetweenEvents

public void delayBetweenEvents(int ms)
Updates the value representing the millisecond count in between generated events. Usually just set to 100-200 if you want to slow down the playback to simulate actual user input. The default is 60 milliseconds.

To change the speed of a GUI test, you need to change the values of both delayBetweenEvents and eventPostingDelay.

Parameters:
ms - the millisecond count in between generated events. It should be between -1 and 60000.
See Also:
eventPostingDelay(int)

timeoutToBeVisible

public int timeoutToBeVisible()
Returns the number of milliseconds to wait for a component to be visible. The default value is 30000 milliseconds.

Returns:
the number of milliseconds to wait for a component to be visible.

timeoutToBeVisible

public void timeoutToBeVisible(int ms)
Updates the number of milliseconds to wait for a component to be visible. The default value is 30000 milliseconds.

Parameters:
ms - the time in milliseconds. It should be between 0 and 60000.

timeoutToFindPopup

public int timeoutToFindPopup()
Returns the number of milliseconds to wait before failing to find a pop-up menu that should appear. The default value is 30000 milliseconds.

Returns:
the number of milliseconds to wait before failing to find a pop-up menu that should appear.

timeoutToFindPopup

public void timeoutToFindPopup(int ms)
Updates the number of milliseconds to wait before failing to find a pop-up menu that should appear. The default value is 30000 milliseconds.

Parameters:
ms - the time in milliseconds. It should be between 0 and 60000.

timeoutToFindSubMenu

public int timeoutToFindSubMenu()
Returns the number of milliseconds to wait for a sub-menu to appear. The default value is 100 milliseconds.

Returns:
the number of milliseconds to wait for a sub-menu to appear.
Since:
1.2

timeoutToFindSubMenu

public void timeoutToFindSubMenu(int ms)
Updates the number of milliseconds to wait for a sub-menu to appear. The default value is 100 milliseconds.

Parameters:
ms - the time in milliseconds. It should be between 0 and 10000.
Since:
1.2

dragDelay

public int dragDelay()
Returns the number of milliseconds to wait between a pressing a mouse button and moving the mouse. The default value for Mac OS X or the X11 Windowing system is 100 milliseconds. For other platforms, the default value is 0.

Returns:
the number of milliseconds to wait between a pressing a mouse button and moving the mouse.

dragDelay

public void dragDelay(int ms)
Updates the number of milliseconds to wait between a pressing a mouse button and moving the mouse. The default value for Mac OS X or the X11 Windowing system is 100 milliseconds. For other platforms, the default value is 0.

Parameters:
ms - the time in milliseconds. For Mac OS X or the X11 Windowing system, the minimum value is 100. For other platforms the minimum value is 0. The maximum value for all platforms is 60000.

eventPostingDelay

public int eventPostingDelay()
Returns the number of milliseconds before checking for idle. The default value is 100 milliseconds.

Returns:
the number of milliseconds before checking for idle.

eventPostingDelay

public void eventPostingDelay(int ms)
Updates the number of milliseconds before checking for idle. This allows the system a little time to put a native event onto the AWT event queue. The default value is 100 milliseconds.

To change the speed of a GUI test, you need to change the values of both delayBetweenEvents and eventPostingDelay.

Parameters:
ms - the time in milliseconds. It should be between 0 and 1000.
See Also:
delayBetweenEvents(int)

dropDelay

public int dropDelay()
Returns the number of milliseconds between the final mouse movement and mouse release to ensure drop ends. The default value for Windows is 200. For other platforms, the default value is 0.

Returns:
the number of milliseconds between the final mouse movement and mouse release to ensure drop ends.

dropDelay

public void dropDelay(int ms)
Updates the number of milliseconds between the final mouse movement and mouse release to ensure drop ends. The default value for Windows is 200. For other platforms, the default value is 0.

Parameters:
ms - the time in milliseconds. For Windows, the minimum value is 200. For other platforms, the minimum value is 0. The maximum value for all platforms is 60000.

componentLookupScope

public ComponentLookupScope componentLookupScope()
Returns the scope of component lookups. This setting only affects the component fixtures in the package org.fest.swing.fixture. The default value is ComponentLookupScope.DEFAULT.

Returns:
the scope of component lookups.

componentLookupScope

public void componentLookupScope(ComponentLookupScope scope)
Updates the scope of component lookups. This setting only affects the component fixtures in the package org.fest.swing.fixture. The default value is ComponentLookupScope.DEFAULT.

Parameters:
scope - the new value for the scope.

idleTimeout

public int idleTimeout()
Returns the time (in milliseconds) to wait for an idle AWT event queue. The default value is 10000 milliseconds.

Returns:
the time (in milliseconds) to wait for an idle AWT event queue.

idleTimeout

public void idleTimeout(int ms)
Updates the time (in milliseconds) to wait for an idle AWT event queue.

Parameters:
ms - the new time. The value should be equal to or greater than zero.


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