Class JemmyProperties
java.lang.Object
org.netbeans.jemmy.JemmyProperties
Keeps default Jemmy properties.
- Author:
- Alexandre Iline (alexandre.iline@sun.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe event queue model mask.static intThe robot using model mask.static intEvent shorcutting model mask.static intThe robot using model mask. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JemmyPropertiesCreates an exact copy on this instance.booleanChecks if "name" propery currently has a value.voidcopyTo(JemmyProperties properties) Copy all properties from this instance into another.static StringgetBuild()Returns build (like 20011231 (yyyymmdd)).Returns bundle manager.Returns char binding map.static BundleManagerJust like getProperties().getBundleManager().static CharBindingMapJust like getProperties().getCharBindingMap().static intReturns the current dispatching model.static intReturns the current drag and drop step length value.static String[]Returns the current key values.static TestOutJust like getProperties().getOutput().static ObjectgetCurrentProperty(String propertyName) Just like getProperties().getProperty(propertyName).static StringgetCurrentResource(String key) Just like getProperties().getBundleManager().getResource(key).static StringgetCurrentResource(String bundleID, String key) Just like getProperties().getBundleManager().getResource(bundleID, key).static longgetCurrentTimeout(String name) Just like getProperties().getTimeouts().getTimeout(name).static TimeoutsJust like getProperties().getTimeouts().static intReturns default event dispatching model.intReturns the dispatching model.intReturns the drag and drop step length value.static StringReturns full version string (like 1.0.1-20011231).String[]getKeys()Returns the key values.static StringReturns major version (like 1.0).static StringReturns minor version (like 1).Returns output.static JemmyPropertiesPeeks upper JemmyProperties instance from stack.getProperty(String name) Returns the property value.getResource(String key) Returns resource value.getResource(String bundleID, String key) Returns resource value from the specified bundle.longgetTimeout(String name) Returns a timeouts value.Returns timeouts.static StringReturns version string (like 1.0.1).voidinit()Inits properties and dispatching model from system environment variables.static longinitCurrentTimeout(String name, long newValue) Just like getProperties().getTimeouts().initTimeout(name, newValue).voidInitializes dispatching model.voidinitDispatchingModel(boolean queue, boolean robot) Initializes dispatching model.voidinitDispatchingModel(boolean queue, boolean robot, boolean shortcut) Initializes dispatching model.voidinitDispatchingModel(boolean queue, boolean robot, boolean shortcut, boolean smooth) Initializes dispatching model.voidMethod to initialize timeouts and resources.voidinitProperties(String prop_file) Method to initialize timeouts and resources.longinitTimeout(String name, long newValue) Inits a timeouts value.static voidPrints full version into satndart output.static JemmyPropertiespop()Pops last pushed properties from the properties stack.static JemmyPropertiespush()Creates a copy of the current JemmyProperties object and pushes it into the properties stack.protected static JemmyPropertiespush(JemmyProperties props) Pushes properties stack.static ObjectremoveCurrentProperty(String propertyName) Removes a property from current properties list.removeProperty(String name) Removes the property.setBundleManager(BundleManager resources) Changes bundle manager.Changes char binding map.static BundleManagersetCurrentBundleManager(BundleManager resources) Just like getProperties().setBundleManager(resources).static CharBindingMapJust like getProperties().setCharBindingMap(map).static intsetCurrentDispatchingModel(int model) Defines event dispatching model.static intsetCurrentDragAndDropStepLength(int model) Specifies the current drag and drop step length value.static TestOutsetCurrentOutput(TestOut out) Just like getProperties().setOutput(out).static ObjectsetCurrentProperty(String propertyName, Object propertyValue) Just like getProperties().setProperty(propertyName, propertyValue).static longsetCurrentTimeout(String name, long newValue) Just like getProperties().getTimeouts().setTimeout(name, newValue).static TimeoutsJust like getProperties().setTimeouts(to).intsetDispatchingModel(int model) Specifies the dispatching model value.intsetDragAndDropStepLength(int length) Specifies the drag and drop step length value.Changes output.setProperty(String name, Object newValue) Saves object as a static link to be used by other objects.longsetTimeout(String name, long newValue) Changes a timeouts value.setTimeouts(Timeouts to) Changes timeouts.
-
Field Details
-
QUEUE_MODEL_MASK
public static int QUEUE_MODEL_MASKThe event queue model mask.- See Also:
-
ROBOT_MODEL_MASK
public static int ROBOT_MODEL_MASKThe robot using model mask.- See Also:
-
SHORTCUT_MODEL_MASK
public static int SHORTCUT_MODEL_MASKEvent shorcutting model mask. Should not be used together with robot mask.- See Also:
-
SMOOTH_ROBOT_MODEL_MASK
public static int SMOOTH_ROBOT_MODEL_MASKThe robot using model mask.- See Also:
-
-
Constructor Details
-
JemmyProperties
protected JemmyProperties()
-
-
Method Details
-
getMajorVersion
Returns major version (like 1.0).- Returns:
- a String representing the major version value.
-
getMinorVersion
Returns minor version (like 1).- Returns:
- a String representing the minor version value.
-
getBuild
Returns build (like 20011231 (yyyymmdd)).- Returns:
- a String representing the build value.
-
getFullVersion
Returns full version string (like 1.0.1-20011231).- Returns:
- a String representing the full version value.
-
getVersion
Returns version string (like 1.0.1).- Returns:
- a String representing the short version value.
-
push
Creates a copy of the current JemmyProperties object and pushes it into the properties stack.- Returns:
- New current properties.
-
pop
Pops last pushed properties from the properties stack. If stack has just one element, does nothing.- Returns:
- Poped properties.
-
getCurrentProperty
-
setCurrentProperty
-
removeCurrentProperty
-
getCurrentKeys
Returns the current key values.- Returns:
- an array of Strings representing the current key values
-
getCurrentTimeouts
Just like getProperties().getTimeouts().- Returns:
- a Timeouts object representing the current timeouts.
- See Also:
-
setCurrentTimeouts
-
setCurrentTimeout
Just like getProperties().getTimeouts().setTimeout(name, newValue).- Parameters:
name- a timeout namenewValue- a timeout value- Returns:
- previous timeout value
- See Also:
-
getCurrentTimeout
Just like getProperties().getTimeouts().getTimeout(name).- Parameters:
name- a timeout name- Returns:
- a timeout value
- See Also:
-
initCurrentTimeout
Just like getProperties().getTimeouts().initTimeout(name, newValue).- Parameters:
name- a timeout namenewValue- a timeout value- Returns:
- a timeout value
- See Also:
-
getCurrentOutput
Just like getProperties().getOutput().- Returns:
- a TestOut object representing the current output.
- See Also:
-
setCurrentOutput
-
getCurrentBundleManager
Just like getProperties().getBundleManager().- Returns:
- a BundleManager object representing the current bundle manager.
- See Also:
-
setCurrentBundleManager
Just like getProperties().setBundleManager(resources).- Parameters:
resources- new BundleManager- Returns:
- a BundleManager object representing the current bundle manager.
- See Also:
-
getCurrentResource
-
getCurrentResource
-
getCurrentCharBindingMap
Just like getProperties().getCharBindingMap().- Returns:
- a CharBindingMap object representing the current char binding map.
- See Also:
-
setCurrentCharBindingMap
Just like getProperties().setCharBindingMap(map).- Parameters:
map- new CharBindingMap.- Returns:
- old CharBindingMap object.
- See Also:
-
getCurrentDispatchingModel
public static int getCurrentDispatchingModel()Returns the current dispatching model.- Returns:
- Event dispatching model.
- See Also:
-
setCurrentDispatchingModel
public static int setCurrentDispatchingModel(int model) Defines event dispatching model. If (model invalid input: '&' ROBOT_MODEL_MASK) != 0 java.awt.Robot class is used to reproduce user actions, otherwise actions are reproduced by event posting. If (model invalid input: '&' QUEUE_MODEL_MASK) != 0 actions are reproduced through event queue.- Parameters:
model- New dispatching model value.- Returns:
- Previous dispatching model value.
- See Also:
-
getDefaultDispatchingModel
public static int getDefaultDispatchingModel()Returns default event dispatching model.- Returns:
- QUEUE_MODEL_MASK
- See Also:
-
getCurrentDragAndDropStepLength
public static int getCurrentDragAndDropStepLength()Returns the current drag and drop step length value.- Returns:
- Pixel count to move mouse during one drag'n'drop step.
- See Also:
-
setCurrentDragAndDropStepLength
public static int setCurrentDragAndDropStepLength(int model) Specifies the current drag and drop step length value.- Parameters:
model- Pixel count to move mouse during one drag'n'drop step.- Returns:
- Previous value.
- See Also:
-
getProperties
Peeks upper JemmyProperties instance from stack.- Returns:
- a JemmyProperties object representing the properties value.
-
main
Prints full version into satndart output.- Parameters:
argv- Application args.
-
push
Pushes properties stack.- Parameters:
props- a JemmyProperties instance to put into the stack head.- Returns:
- a JemmyProperties object.
-
initProperties
Method to initialize timeouts and resources.- Parameters:
prop_file- File to get filenames from.
Can contain definition of variables TIMEOUTS_FILE - full path to timeouts file,
RESOURCE_FILE - full path to resource file.- See Also:
-
initProperties
public void initProperties()Method to initialize timeouts and resources.
Uses jemmy.properties system property to find file.- See Also:
-
initDispatchingModel
public void initDispatchingModel(boolean queue, boolean robot, boolean shortcut) Initializes dispatching model.- Parameters:
queue- Notifies that event queue dispatching should be used.robot- Notifies that robot dispatching should be used.shortcut- Notifies that event shorcutting should be used.
-
initDispatchingModel
public void initDispatchingModel(boolean queue, boolean robot, boolean shortcut, boolean smooth) Initializes dispatching model.- Parameters:
queue- Notifies that event queue dispatching should be used.robot- Notifies that robot dispatching should be used.shortcut- Notifies that event shorcutting should be used.
-
initDispatchingModel
public void initDispatchingModel(boolean queue, boolean robot) Initializes dispatching model.- Parameters:
queue- Notifies that event queue dispatching should be used.robot- Notifies that robot dispatching should be used.
-
initDispatchingModel
public void initDispatchingModel()Initializes dispatching model. Uses "jemmy.queue_dispatching" and "jemmy.robot_dispatching" system properties to determine what model should be used. Possible values for the both properties:
"off" - switch mode off.
"on" - switch mode on.
"" - use default value.- See Also:
-
init
public void init()Inits properties and dispatching model from system environment variables.- See Also:
-
getTimeouts
-
setTimeouts
-
setTimeout
Changes a timeouts value.- Parameters:
name- Timeout namenewValue- New timeout value- Returns:
- previous timeout value
- See Also:
-
getTimeout
Returns a timeouts value.- Parameters:
name- Timeout name- Returns:
- a timeout value
- See Also:
-
initTimeout
Inits a timeouts value.- Parameters:
name- Timeout namenewValue- New timeout value- Returns:
- a timeout value
-
getOutput
Returns output.- Returns:
- a TestOut object representing the output value
- See Also:
-
setOutput
-
getBundleManager
Returns bundle manager.- Returns:
- a BundleManager object representing the bundle manager value.
- See Also:
-
setBundleManager
Changes bundle manager.- Parameters:
resources- new bundle manager.- Returns:
- old bundle manager
- See Also:
-
getResource
-
getResource
-
getCharBindingMap
Returns char binding map.- Returns:
- the char binding map.
- See Also:
-
setCharBindingMap
Changes char binding map.- Parameters:
map- new char binding map.- Returns:
- old char binding map.
- See Also:
-
getDispatchingModel
public int getDispatchingModel()Returns the dispatching model.- Returns:
- Event dispatching model.
- See Also:
-
setDispatchingModel
public int setDispatchingModel(int model) Specifies the dispatching model value.- Parameters:
model- New dispatching model value.- Returns:
- Previous dispatching model value.
- See Also:
-
getDragAndDropStepLength
public int getDragAndDropStepLength()Returns the drag and drop step length value.- Returns:
- Pixel count to move mouse during one drag'n'drop step.
- See Also:
-
setDragAndDropStepLength
public int setDragAndDropStepLength(int length) Specifies the drag and drop step length value.- Parameters:
length- Pixel count to move mouse during one drag'n'drop step.- Returns:
- Previous value.
- See Also:
-
contains
Checks if "name" propery currently has a value.- Parameters:
name- Property name. Should by unique.- Returns:
- true if property was defined.
- See Also:
-
setProperty
-
getProperty
-
removeProperty
-
getKeys
Returns the key values.- Returns:
- an array of Strings representing the key values.
-
copyTo
Copy all properties from this instance into another.- Parameters:
properties- a JemmyProperties instance to copy properties into.
-
cloneThis
Creates an exact copy on this instance.- Returns:
- new JemmyProperties object.
-