|
T-Plan Robot Enterprise 3.4 Build No. 3.4-20130322.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.tplan.robot.scripting.commands.AbstractCommandHandler
public abstract class AbstractCommandHandler
Base class for command handlers which implement functionality of individual commands of the T-Plan Robot Enterprise proprietary scripting language.
T-Plan Robot Enterprise, (C) 2009-2013 T-Plan Limited. All rights reserved.
| Field Summary | |
|---|---|
protected static String |
ALT
|
static String |
CONTEXT_COMMAND_CALL_PARAMETER_MAP
|
protected static String |
CONTEXT_COMPILE_SINGLE_COMMAND_MODE
|
protected static String |
CONTEXT_LAST_WAIT_FACTOR
|
protected static String |
CONTEXT_WAIT_FACTOR_ERR_MSG_SHOWN
|
protected static String |
CTRL
|
static String |
PARAM_COUNT
|
static String |
PARAM_ONFAIL
|
static String |
PARAM_ONPASS
|
static String |
PARAM_WAIT
|
protected static String |
SHIFT
|
protected static String |
WINDOWS
|
| Constructor Summary | |
|---|---|
AbstractCommandHandler()
|
|
| Method Summary | |
|---|---|
void |
addCommandListener(CommandListener listener)
Add a CommandListener to the listener list. |
boolean |
canRunWithoutConnection()
This method should return true if it can be executed even when the tool is not connected to a desktop. |
void |
checkDependencies(PluginManager manager)
Check whether the current product installation contains all dependencies (other plugins) required to install this plugin. |
protected static boolean |
checkPauseAndStop(ScriptingContext ctx)
Test whether the script is paused or stopped. |
Map |
compileParameters(Map paramsAndValues,
TestScriptInterpret interpret)
|
protected ConfigureAction |
createConfigureAction()
|
void |
executeFallBackCodeOrProcedure(String code,
String procedure,
String[] procedureArgs,
ScriptingContext ctx)
|
void |
fireCommandEvent(Object source,
ScriptingContext context,
String actionCode,
Object customObject)
|
protected static boolean |
getBooleanSafely(UserConfiguration cfg,
String parameter,
boolean defaultValue)
Retrieve a boolean parameter from user configuration in a safe, exception-free way. |
String |
getCode()
Get plugin code. |
String |
getContextArgument()
Get the dummy command argument. |
Map |
getContextAttributes()
Get a map with context attributes. |
KeyStroke |
getContextShortcut()
Get preferred hot key for the GUI command wizard. |
Date |
getDate()
Get plugin release date. |
String |
getDescription()
Get plugin description to be displayed in the GUI. |
String |
getDisplayName()
Get a generic display name. |
Class |
getImplementedInterface()
Get Class of the exposed functional interface that this plugin implements. |
protected static int |
getIntegerSafely(UserConfiguration cfg,
String parameter,
int defaultValue)
Retrieve an integer parameter from user configuration in a safe, exception-free way. |
int[] |
getLowestSupportedVersion()
Get the lowest required version of T-Plan Robot Enterprise. |
String |
getMessageAfterInstall()
Get text of a message to be displayed after installation of this plugin. |
String |
getMessageBeforeInstall()
Get text of a message to be displayed before installation of this plugin. |
List<Preference> |
getPreferences()
Get metadata of displayable/editable configurable parameters. |
List |
getStablePopupMenuItems()
Get a list of stable actions. |
String |
getSupportContact()
Get support contact. |
String |
getUniqueId()
Get unique ID associated with the plugin. |
String |
getVendorHomePage()
Get the vendor home page. |
String |
getVendorName()
Get vendor (provider) name to be displayed in the GUI. |
int[] |
getVersion()
Get plugin version in form of an integer array. |
boolean |
isGlobalPrerequisity(String command)
This method should return true if the command needs to be executed prior to running part of a test script. |
protected long |
multiplyWaitTime(ScriptingContext context,
long timeMs)
|
void |
removeCommandListener(CommandListener listener)
Removes a CommandListener from the listener list. |
boolean |
requiresRestart()
Indicate whether installation of this plugin requires application restart. |
void |
setConfiguration(UserConfiguration cfg)
If an object implementing this interface is a plugin (i.e. |
void |
validateOnPassAndOnFail(ScriptingContext repository,
Map params)
|
protected void |
wait(ScriptingContext context,
int delay)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.tplan.robot.scripting.commands.CommandHandler |
|---|
execute, getCommandNames, validate |
| Field Detail |
|---|
public static final String PARAM_WAIT
public static final String PARAM_COUNT
public static final String PARAM_ONFAIL
public static final String PARAM_ONPASS
protected static final String SHIFT
protected static final String CTRL
protected static final String ALT
protected static final String WINDOWS
protected static final String CONTEXT_COMPILE_SINGLE_COMMAND_MODE
public static final String CONTEXT_COMMAND_CALL_PARAMETER_MAP
protected static final String CONTEXT_WAIT_FACTOR_ERR_MSG_SHOWN
protected static final String CONTEXT_LAST_WAIT_FACTOR
| Constructor Detail |
|---|
public AbstractCommandHandler()
| Method Detail |
|---|
public void validateOnPassAndOnFail(ScriptingContext repository,
Map params)
throws SyntaxErrorException
SyntaxErrorException
public void executeFallBackCodeOrProcedure(String code,
String procedure,
String[] procedureArgs,
ScriptingContext ctx)
public boolean isGlobalPrerequisity(String command)
CommandHandlerThis method should return true if the command needs to be executed prior to running part of a test script.
Imagine a following situation. User creates a script:
Var PATH=/usr/java
Type {PATH}/bin/java
Press Enter
User then selects just the last two commands to be executed. It would of course fail because the PATH variable is not defined. If this method returns true, the command will be executed before running selected commands are executed.
isGlobalPrerequisity in interface CommandHandlercommand - a command with parameters to be processed.
public void addCommandListener(CommandListener listener)
CommandHandlerCommandListener to the listener list.
addCommandListener in interface CommandHandlerlistener - a CommandListener to be added.public void removeCommandListener(CommandListener listener)
CommandHandlerCommandListener from the listener list.
removeCommandListener in interface CommandHandlerlistener - the CommandListener to be removed
public void fireCommandEvent(Object source,
ScriptingContext context,
String actionCode,
Object customObject)
public List<Preference> getPreferences()
Configurable
getPreferences in interface Configurablepublic void setConfiguration(UserConfiguration cfg)
ConfigurableIf an object implementing this interface is a plugin (i.e. implements also the Plugin interface) and is instantiated through a supported plugin factory, the Plugin Manager calls this method right after an instance of this object is created.
Custom objects which do not already have their configuration parameters in
the default configuration file should take advantage of this method
to store their configuration into the shared User Configuration instance.
It is recommended to call the UserConfiguration.saveConfiguration()
method in the end to save the configuration to the hard drive.
Objects wishing to be notified of changes of configuration parameters
should implement the ConfigurationChangeListener interface and register
with the UserConfiguration instance through the
addConfigurationChangeListener() method.
setConfiguration in interface Configurablecfg - global shared instance of user configuration preloaded with
parameters from the default and user configuration files.
protected long multiplyWaitTime(ScriptingContext context,
long timeMs)
protected void wait(ScriptingContext context,
int delay)
public List getStablePopupMenuItems()
CommandHandler
getStablePopupMenuItems in interface CommandHandlerpublic String getContextArgument()
CommandHandler
getContextArgument in interface CommandHandlerpublic Map getContextAttributes()
getContextAttributes in interface CommandHandlerpublic KeyStroke getContextShortcut()
CommandHandler
getContextShortcut in interface CommandHandlerpublic boolean canRunWithoutConnection()
canRunWithoutConnection in interface CommandHandlerpublic String getCode()
PluginGet plugin code. This string serves as an identifier of the functionality delivered by the plugin. For example, desktop client plugins return protocol name like "RFB" or "RDP" as their code.
Plugin code is used by pluggable instance factories to identify
a particular plugin. It may be used to replace internal plugins with
third party code. For
example if you develop a class which implements this and the
com.tplan.robot.remoteclient.RemoteDesktop interfaces and the
getCode() method returns "RFB", it will replace the internal
implementation of the RFB (VNC) client.
getCode in interface Pluginpublic String getVendorName()
Plugin
getVendorName in interface Pluginpublic String getSupportContact()
Plugin
getSupportContact in interface Pluginpublic int[] getVersion()
Pluginnew int[] { 1, 2, 3 }.
getVersion in interface Pluginpublic Class getImplementedInterface()
Plugincom.tplan.robot.remoteclient.RemoteDesktopClient.class.
getImplementedInterface in interface Pluginpublic boolean requiresRestart()
Plugin
requiresRestart in interface Pluginpublic String getVendorHomePage()
Plugin
getVendorHomePage in interface Pluginpublic Date getDate()
Plugin
getDate in interface Pluginpublic int[] getLowestSupportedVersion()
Plugin
getLowestSupportedVersion in interface Pluginpublic String getMessageBeforeInstall()
Plugin
getMessageBeforeInstall in interface Pluginpublic String getMessageAfterInstall()
Plugin
getMessageAfterInstall in interface Pluginpublic String getDisplayName()
getDisplayName in interface PlugingetCmdDisplayName() method.public String getDescription()
Plugin
getDescription in interface Pluginpublic String getUniqueId()
PluginGet unique ID associated with the plugin. The plugin manager uses the ID together with the version string to identify whether a plugin is already installed and whether a newer version of the same plugin is available.
The unique ID in fact identifies a particular plugin delivered by a particular vendor. Plugin developers are recommended to choose an ID and keep it constant for all versions of one particular plugin. The ID is never displayed in the GUI so it doesn't have to be a readable text. To avoid conflicts with other vendors it is recommended to elaborate vendor or author name and feature description into the ID, for example "custom RFB client implemented by John Doe".
getUniqueId in interface Plugin
public void checkDependencies(PluginManager manager)
throws DependencyMissingException
PluginDependencyMissingException
if one or more dependencies are missing.
checkDependencies in interface Pluginmanager - shared instance of the plugin manager.
DependencyMissingException - when one or more dependencies requested by this plugin is missing.
protected static int getIntegerSafely(UserConfiguration cfg,
String parameter,
int defaultValue)
cfg - user configuration (may not be null).parameter - parameter name.defaultValue - default value to be returned in case of any failure.
protected static boolean getBooleanSafely(UserConfiguration cfg,
String parameter,
boolean defaultValue)
cfg - user configuration (may not be null).parameter - parameter name.defaultValue - default value to be returned in case of any failure.
public Map compileParameters(Map paramsAndValues,
TestScriptInterpret interpret)
protected ConfigureAction createConfigureAction()
protected static boolean checkPauseAndStop(ScriptingContext ctx)
ctx - a context. It must be an execution context or the method will
not do anything.
|
T-Plan Robot Enterprise 3.4 Build No. 3.4-20130322.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||