IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.script
Interface IScriptDefinition

All Superinterfaces:
IScript

public interface IScriptDefinition
extends IScript

Persists the definition about the artifacts associated with the script as an object that implements this interface when the script is created or updated. Object-map information is maintained to improve the resilience of scripts relative to changes in shared object maps. Also, verification points and other assocatied artifacts are managed by the script definition interface.

This definition is used to generate the ScriptHelper class consistently across multiple recordings to the same script. Note that the ScriptHelper class is completely regenerated every time the script is modified by recording into it. This class represents the data necessary for generating the ScriptHelper class.

Since:
RFT1.0

Field Summary
static java.lang.String DEFAULT_ARGUMENTS
           
static java.lang.String RATIONAL_TEST_SCRIPT
           
 
Method Summary
 void addTestObjectName(java.lang.String testObjectName, java.lang.String mapId, java.lang.String role)
          Adds a new TestObject name to the map-ID association to the script definition.
 java.lang.String getAuxiliaryDataBaseFileName(java.lang.String vpName)
          Returns the base name that should be used to construct an auxiliary data file.
 java.util.Enumeration getAuxiliaryDataFileNames()
          Returns an enumerator for the auxiliary data-file names associated with a script.
 java.lang.String getDatapoolIteratorClassName()
          Returns the name of the datapool iterator associated with the script.
 java.lang.String getDatapoolName()
          Returns the name of the datapool associated with the script.
 java.lang.String getDatastore()
          This method returns the datastore of the script definition
 java.lang.String getHelperSuperClass()
          Returns the class that the helper class extends when generated.
 java.io.File getImageFile(java.lang.String vpName)
          Returns the Image file verification point (VP) file corrsponding to VP.
 java.lang.String getMapId(java.lang.String testObjectName)
          Returns the map ID for the specified value name.
 java.lang.String getMapName()
          Returns the name of the object map associated with the script.
 java.lang.String getRole(java.lang.String testObjectName)
          Returns the role associated with a TestObject.
 java.io.File getScriptDefinitionFile()
          This method processes the script name into an apporpriate datastore relative file name for a script definition file.
 java.lang.String getTestObjectName(com.rational.test.ft.object.map.IMappedTestObject mappedTestObject)
          Returns the script-relative unique name for the specified mapped TestObject.
 java.lang.String getTestObjectName(java.lang.String mapId)
          Returns the script-relative unique name for the specified object map ID.
 java.lang.String getTestObjectNameBase(com.rational.test.ft.object.map.IMappedTestObject mappedTestObject)
          Returns the base name used by getTestObjectName to generate a script-relative unique name.
 java.util.Enumeration getTestObjectNames()
          Returns an enumerator for the TestObject names associated with a script.
 java.lang.String getVpBaseFileName()
          Returns the base name that should be used to construct a verification point (VP) file.
 java.lang.String getVpFileName(java.lang.String vpName)
          Returns a file name for the named verification point.
 java.util.Enumeration getVpNames()
          Returns an enumerator for the verification point names associated with a script.
 boolean hasAuxiliaryDataName(java.lang.String vpName, java.lang.String auxDataName)
          Returns true if the supplied name is a known auxiliary data name.
 boolean hasTestObjectName(java.lang.String testObjectName)
          Returns true if the specified TestObject name is used by this script.
 boolean hasVpName(java.lang.String vpName)
          Returns true if the supplied name is a known verification point name.
 boolean isDeletedFromMap(java.lang.String testObjectName)
          Returns the deletion flag associated with a TestObject.
 boolean isPrivateMap()
          Returns true if the object map associated with the script is private.
 void removeAuxiliaryDataName(java.lang.String vpName, java.lang.String auxDataName)
          Removes the specified name from the list of auxiliary data names associated with this script.
 void removeTestObjectName(java.lang.String testObjectName)
          Removes a TestObject name from the script definition.
 void removeVpName(java.lang.String vpName)
          Removes the specified name from the list of verification point (VP) names associated with this script.
 void renameTestObject(java.lang.String currentTestObjectName, java.lang.String newTestObjectName)
          Replaces the script-relative TestObject name with a new supplied name.
 void setDatapoolIteratorClassName(java.lang.String datapoolIteratorClassName)
          Defines the datapool iterator class name for the script.
 void setDatapoolName(java.lang.String datapoolName)
          Defines the datapool name for the script.
 void setDeletedFromMap(java.lang.String testObjectName, boolean deleted)
          Sets the deletion flag associated with a TestObject.
 void setHelperSuperClass(java.lang.String helperSuperClass)
          Defines the class that the helper class extends when generated.
 void setMapName(java.lang.String mapName)
          Defines the datastore-relative object-map file name.
 
Methods inherited from interface com.rational.test.ft.script.IScript
getComponentModel, getLanguage, getModelFile, getProperty, getScriptAssets, getScriptAssets, getScriptFile, getScriptHelperFile, getScriptName, removeScriptAssets, setDatastore, setLanguage, setProperty, setScriptName
 

Field Detail

RATIONAL_TEST_SCRIPT

static final java.lang.String RATIONAL_TEST_SCRIPT
See Also:
Constant Field Values

DEFAULT_ARGUMENTS

static final java.lang.String DEFAULT_ARGUMENTS
See Also:
Constant Field Values
Method Detail

getMapName

java.lang.String getMapName()
Returns the name of the object map associated with the script. This is the datastore-relative file name of the map, including the file suffix, so that the type of map can be determined from the file suffix. Maps can be private to the script (rftxmap file suffix) or shared by other scripts (rftmap file suffix).

Returns:
The datastore-relative file name of the object map associated with the script
Since:
RFT1.0
See Also:
setMapName(String), isPrivateMap()

setMapName

void setMapName(java.lang.String mapName)
Defines the datastore-relative object-map file name. This name includes the file suffix so that the type of object map can be determined from the map-file name. Maps can be private to the script (rftxmap file suffix) or shared by other scripts (rftmap file suffix).

Parameters:
mapName - the name of the object map associated with the script
Since:
RFT1.0
See Also:
getMapName(), isPrivateMap()

isPrivateMap

boolean isPrivateMap()
Returns true if the object map associated with the script is private.

Since:
RFT1.0
See Also:
setMapName(String), getMapName()

getDatapoolName

java.lang.String getDatapoolName()
Returns the name of the datapool associated with the script. This is the datastore-relative file name of the datapool, including the appropriate file suffix.

Returns:
The datastore-relative file name of the datapool associated with the script
Since:
RFT2.0
See Also:
setDatapoolName(String)

setDatapoolName

void setDatapoolName(java.lang.String datapoolName)
Defines the datapool name for the script. The datapool name is a datastore-relative file name of the datapool, including the appropriate file suffix.

Parameters:
datapoolName - The datastore-relative datapool file name to be associated with a script.
Since:
RFT2.0
See Also:
getDatapoolName()

getDatapoolIteratorClassName

java.lang.String getDatapoolIteratorClassName()
Returns the name of the datapool iterator associated with the script. This is the full class name of the datapool iterator, including the appropriate package prefix.

Returns:
The full class name of the datapool iterator associated with the script
Since:
RFT2.0
See Also:
setDatapoolIteratorClassName(String)

setDatapoolIteratorClassName

void setDatapoolIteratorClassName(java.lang.String datapoolIteratorClassName)
Defines the datapool iterator class name for the script.

Parameters:
datapoolIteratorClassName - The full class datapool iterator class name to be associated with a script.
Since:
RFT2.0
See Also:
getDatapoolIteratorClassName()

getHelperSuperClass

java.lang.String getHelperSuperClass()
Returns the class that the helper class extends when generated. By default this value is null, which implies that the helper class should directly extend the RationalTestScript class.

Returns:
the class that the helper class extends
See Also:
setHelperSuperClass(String)

setHelperSuperClass

void setHelperSuperClass(java.lang.String helperSuperClass)
Defines the class that the helper class extends when generated. By default this value is null, which implies that the helper class should directly extend the RationalTestScript class. The supplied class name should be a full class name that includes the complete package specification for the supplied class.

Parameters:
helperSuperClass - the class that the helper class extends
See Also:
getHelperSuperClass()

addTestObjectName

void addTestObjectName(java.lang.String testObjectName,                        java.lang.String mapId,                        java.lang.String role)
Adds a new TestObject name to the map-ID association to the script definition. If the TestObject name is already known, the existing value is overwritten.

Parameters:
testObjectName - the script-relative unique name associated with a node in the associated object map
mapId - the object map identifier for the desired TestObject name
role - the TestObject role (use for improved display in the IDE)
Since:
RFT1.0
See Also:
removeTestObjectName(String), getMapId(String), getTestObjectName(String)

removeTestObjectName

void removeTestObjectName(java.lang.String testObjectName)
Removes a TestObject name from the script definition. If the TestObject name is not known, this method returns normally.

Parameters:
testObjectName - the script-relative unique name associated with a node in the associated object map
Since:
RFT1.0
See Also:
addTestObjectName(String,String,String), getMapId(String), getTestObjectName(String), renameTestObject(String,String)

renameTestObject

void renameTestObject(java.lang.String currentTestObjectName,                       java.lang.String newTestObjectName)
Replaces the script-relative TestObject name with a new supplied name. If the new name is already in the script-definition name list, a BadArgumentException is thrown. The script file itself is not updated by this action. Any verification-point files or other non-script file assets affected by this change are updated.

Parameters:
testObjectName - the script-relative unique name associated with a node in the associated object map
Since:
RFT1.0
See Also:
addTestObjectName(String,String,String), getMapId(String), getTestObjectName(String), removeTestObjectName(String)

hasTestObjectName

boolean hasTestObjectName(java.lang.String testObjectName)
Returns true if the specified TestObject name is used by this script. Calling this method is the same as calling getMapId() and checking for a returned negative value.

Parameters:
testObjectName - the script-relative unique name being located
Since:
RFT1.0
See Also:
getMapId(String)

getMapId

java.lang.String getMapId(java.lang.String testObjectName)
Returns the map ID for the specified value name. This method is commonly used during script playback to locate a TestObject in the persistent map. The map ID is relative to the local map until merged into a shared map; then the ID is relative to the shared map. A negative return value implies that the name is not used by this script.

Parameters:
testObjectName - the script-relative unique name associated with a node in the associated object map
Returns:
The object-map unique identifier, or -1 if the name is not located
Since:
RFT1.0
See Also:
getTestObjectName(String)

getRole

java.lang.String getRole(java.lang.String testObjectName)
Returns the role associated with a TestObject. This feature exists to improve the display of TestObjects in the IDE. Note that this value may be null if the role is unknown or not set.

Parameters:
testObjectName - the script-relative unique name associated with a node in the associated object map
Returns:
The role associated with a TestObject
Since:
RFT1.0
See Also:
getTestObjectName(String)

isDeletedFromMap

boolean isDeletedFromMap(java.lang.String testObjectName)
Returns the deletion flag associated with a TestObject. This feature exists to improve the display of deleted TestObjects in the IDE. Note that by default this flag is false and is only set when the TestObject is noticed to be deleted.

Parameters:
testObjectName - the script-relative unique name associated with a node in the associated object map
Returns:
A flag that indicates that the object has been deleted from the associated object map
Since:
RFT1.0
See Also:
getTestObjectName(String)

setDeletedFromMap

void setDeletedFromMap(java.lang.String testObjectName,                        boolean deleted)
Sets the deletion flag associated with a TestObject. This exists to improve the display of deleted TestObjects in the IDE. Note that by default this flag is false and is only set when the TestObject is noticed to be deleted.

Parameters:
testObjectName - the script-relative unique name associated with a node in the associated object map
deleted - a flag that indicates that the object has been deleted from the associated object map
Since:
RFT1.0
See Also:
isDeletedFromMap(String)

getTestObjectName

java.lang.String getTestObjectName(java.lang.String mapId)
Returns the script-relative unique name for the specified object map ID. The map ID is relative to the local map until merged into a shared map; then the ID is relative to the shared map. A null value is returned if the supplied map ID is not associated with this script.

Parameters:
mapId - the object-map identifier for the desired TestObject name
Since:
RFT1.0
See Also:
getMapId(String)

getTestObjectName

java.lang.String getTestObjectName(com.rational.test.ft.object.map.IMappedTestObject mappedTestObject)
Returns the script-relative unique name for the specified mapped TestObject. The mapped TestObject must already have a map ID that is relative to the local map until merged into a shared map; then the ID is relative to the shared map. An appropriate exception is thrown if the supplied TestObject does not have a corresponding map ID. If the supplied object is not known to this script definition, it is added and an appropriate name generated.

Parameters:
mappedTestObject - the mapped TestObject for which to retrieve the name
Since:
RFT1.0
See Also:
getMapId(String), getTestObjectName(String)

getTestObjectNameBase

java.lang.String getTestObjectNameBase(com.rational.test.ft.object.map.IMappedTestObject mappedTestObject)
Returns the base name used by getTestObjectName to generate a script-relative unique name. This base name is also used during recording to display a monitor image of the actions being performed before the TestObject is merged into the object map.

Parameters:
mappedTestObject - the mapped TestObject for which to retrieve the name
Returns:
The base name used to generate a script-relative unique name
Since:
RFT1.0
See Also:
getTestObjectName(IMappedTestObject)

getTestObjectNames

java.util.Enumeration getTestObjectNames()
Returns an enumerator for the TestObject names associated with a script. Each object returned by the enumerator is a java.lang.String value known to be unique relative to a script.

Since:
RFT1.0
See Also:
addTestObjectName(String,String,String), getMapId(String), hasTestObjectName(String)

getVpBaseFileName

java.lang.String getVpBaseFileName()
Returns the base name that should be used to construct a verification point (VP) file. This name includes any path specification as well as the simple base name for the verification point.

Since:
RFT1.0

getImageFile

java.io.File getImageFile(java.lang.String vpName)
Returns the Image file verification point (VP) file corrsponding to VP.

Parameters:
vpName - the script-relative unique name of a verification point
Since:
RFT1.0

removeVpName

void removeVpName(java.lang.String vpName)
Removes the specified name from the list of verification point (VP) names associated with this script. If the name is not in the known list, no action is performed and this method returns normally.

Parameters:
vpName - the script-relative unique name of a verification point
Since:
RFT1.0

hasVpName

boolean hasVpName(java.lang.String vpName)
Returns true if the supplied name is a known verification point name.

Parameters:
vpName - the script-relative unique name of a verification point
Since:
RFT1.0

getVpNames

java.util.Enumeration getVpNames()
Returns an enumerator for the verification point names associated with a script. Each object returned by the enumerator is a java.lang.String value known to be unique relative to a script.

Since:
RFT1.0

getVpFileName

java.lang.String getVpFileName(java.lang.String vpName)
Returns a file name for the named verification point.

Parameters:
vpName - the script-relative unique name of a verification point
Since:
RFT1.0

getAuxiliaryDataBaseFileName

java.lang.String getAuxiliaryDataBaseFileName(java.lang.String vpName)
Returns the base name that should be used to construct an auxiliary data file. This name includes any path specification as well as the simple base name for the auxiliary data file.

Verification data may be fully encapsulated in a single VP file. If not, verification point data may have additional data files. The data format used in external data files is determined by the ITestData implementation and is not directly managed by the verification point or script infrastructure. However, the file itself needs to be managed by the script information infrastructure if it is to be properly copied, CM controlled, and eventually deleted.

Parameters:
vpName - the script-relative unique name of a verification point
Since:
RFT1.0

removeAuxiliaryDataName

void removeAuxiliaryDataName(java.lang.String vpName,                              java.lang.String auxDataName)
Removes the specified name from the list of auxiliary data names associated with this script. If the name is not in the known list, no action is performed and the method returns normally.

Parameters:
vpName - the verification-point name that the auxiliary data is associated with
auxDataName - the script-relative unique auxiliary data name.
Since:
RFT1.0
See Also:
getAuxiliaryDataBaseFileName(String vpName)

hasAuxiliaryDataName

boolean hasAuxiliaryDataName(java.lang.String vpName,                              java.lang.String auxDataName)
Returns true if the supplied name is a known auxiliary data name.

Parameters:
vpName - the verification point name that the auxiliary data is associated with
auxDataName - the script-relative unique auxiliary data name
Since:
RFT1.0
See Also:
getAuxiliaryDataBaseFileName(String vpName)

getAuxiliaryDataFileNames

java.util.Enumeration getAuxiliaryDataFileNames()
Returns an enumerator for the auxiliary data-file names associated with a script.

Since:
RFT1.0
See Also:
hasAuxiliaryDataName(String,String), getAuxiliaryDataBaseFileName(String vpName)

getScriptDefinitionFile

java.io.File getScriptDefinitionFile()
This method processes the script name into an apporpriate datastore relative file name for a script definition file.

Returns:
The File for the Script definition filed

getDatastore

java.lang.String getDatastore()
This method returns the datastore of the script definition

Returns:
String The datastore path