T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1

com.tplan.robot.scripting
Interface ParametrizedTestScript

All Superinterfaces:
ExtendedParamsObject

public interface ParametrizedTestScript
extends ExtendedParamsObject

Methods to declare parameters of a Java test script. This interface extends the ExtendedParamsObject one and redeclares its methods with new descriptions in the context of Java test scripts.


T-Plan Robot Enterprise, (C) 2009-2019 T-Plan Limited. All rights reserved.


Method Summary
 java.lang.String getLongDescription()
          Get long description of the object - purpose, usage, parameter syntax etc.
 java.util.List<java.lang.String> getParameters()
          Get the list of parameter names accepted by the test script.
 java.util.List getParameterValues(java.lang.String parameterName)
          Get the list of acceptable values of a particular parameter (if known).
 java.lang.String getShortDescription()
          Get short description which describes in a few words purpose and role of the test script.
 java.util.List<Preference> getVisualParameters()
          Get the list of supported parameters encapsulated in Preference instances.
 void setParameters(java.util.Map<java.lang.String,java.lang.String> paramsAndValues)
           Set parameters and their values.
 

Method Detail

getParameters

java.util.List<java.lang.String> getParameters()
Get the list of parameter names accepted by the test script. Names are case sensitive.

Specified by:
getParameters in interface ExtendedParamsObject
Returns:
list of supported parameter names.

getParameterValues

java.util.List getParameterValues(java.lang.String parameterName)
Get the list of acceptable values of a particular parameter (if known). The method should return null for parameters which are not enumerated (the "one of" value type). For example, if the parameter is of the Preference.TYPE_BOOLEAN type the method should return a list containing "true" and "false".

Specified by:
getParameterValues in interface ExtendedParamsObject
Parameters:
parameterName - the parameter name.
Returns:
list of acceptable parameter values or null if the parameter value is not limited to a particular value set.

setParameters

void setParameters(java.util.Map<java.lang.String,java.lang.String> paramsAndValues)

Set parameters and their values. For versions 3.5.1 and lower the method is here to maintain compatibility with the ExtendedParamsObject interface. The implementing Java test script should leave the method empty.

Starting with version 3.5.2 the method gets called when the Properties window of the Java test script gets closed with OK. The window collects the parameter values from the GUI components (see getVisualParameters()) and passes them in form of a map to this method before sending them to the command builder. The Java test script class may take advantage of this method to tweak the parameters, for example to remove default values etc. The method may also throw an IllegalArgumentException to indicate that one or more parameter values are not acceptable. This will make the Properties window display the exception message in a pop up and prevent the window from closing.

Specified by:
setParameters in interface ExtendedParamsObject
Parameters:
paramsAndValues - the map of parameters and their values.

getVisualParameters

java.util.List<Preference> getVisualParameters()
Get the list of supported parameters encapsulated in Preference instances. It allows to specify a larger set of parameter properties such as parameter name, label (short description), description, expected value type and optional value limits and relationships with other parameters. This allows the GUI to build and display the parameters in form of GUI components in command property dialogs and validate the values entered by users..

Specified by:
getVisualParameters in interface ExtendedParamsObject
Returns:
list of supported parameters in form of Preference instances.

getShortDescription

java.lang.String getShortDescription()
Get short description which describes in a few words purpose and role of the test script. This is optional and the method may return null. The short description will be displayed in the Description field of the test script selector under the Run command property window.

Specified by:
getShortDescription in interface ExtendedParamsObject
Returns:
short test script description.

getLongDescription

java.lang.String getLongDescription()
Get long description of the object - purpose, usage, parameter syntax etc. The text may be multiline plain text or HTML with extended link syntax described in CustomHyperlinkListener. This is optional and the method may return null. The long description will be displayed at the top of the dynamically created test script parameter editor.

Specified by:
getLongDescription in interface ExtendedParamsObject
Returns:
long test script description.

T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1