Test Script Execution Adapter API

prevnext

Summary


The TSEA API includes the following calls.

Function Description
SessionClose() Closes a TSEA session.
SessionGetOption() Gets TSEA session options.
SessionOpen() Opens a TSEA session.
SessionSetOption() Sets TSEA session options.
TaskAbort() Aborts a task.
TaskClose() Closes a TSEA task.
TaskCreate() Opens a TSEA task.
TaskExecute() Executes a task.
TaskGetOption() Gets TSEA task options.
TaskSetOption() Sets TSEA task options.
TSEAError() Gets TSEA error information.


SessionClose()

Closes a TSEA session.


Syntax

s32 SessionClose (SessionHandle session)

Element Description
session The handle of the TSEA session to close.


Comments

TSEE makes this call when the last script of a playback request has completed. Your TSEA should perform any cleanup necessitated by the run.


See Also

SessionOpen()


SessionGetOption()

Gets the value of a session option.


Syntax

s32 SessionGetOption (SessionHandle session, char *optname, 
void *optval, s32 len)

Element Description
session The session handle, returned by SessionOpen().
optname The session option whose value is to be returned.
optval The value of optname that is returned to the TSEE.
len Storage buffer size. When TSEE makes the call, optval is an empty buffer of this size; on return, len is the size of the value pointed to by optval.


See Also

SessionSetOption()


SessionOpen()

Opens a session with a TSEA.


Syntax

SessionHandle SessionOpen (char *hostname, u16 port, s32 
strandID, char **message)

Element Description
hostname The name (or IP address in dot notation) of the TSEA host.
port The listening port used by the TSEE for communication with proxy TSS processes. Not used by scripts that are directly executed by TSEE. Where a TSEA uses TSSConnect() to start a proxy script execution process, this port must be passed to the process.
strandID Strand (thread) ID for TSS calls in this session.
message A statement that, if the open fails, is included with the log.


Comments

On success, return to the TSEE a unique session identifier of type SessionHandle. On failure, return NULL. If NULL is returned, the failure is logged.


See Also

SessionClose()


SessionSetOption()

Sets the value of a session option.


Syntax

s32 SessionSetOption (SessionHandle session, char *optname, 
void *optval, s32 len)

Element Description
session The session handle, returned by SessionOpen().
optname The session option whose value is to be set.
optval The new value of optname.
len The size of buffer optval.


See Also

SessionGetOption()


TaskAbort()

Aborts a TSEA task.


Syntax

s32 TaskAbort (TaskHandle task)

Element Description
task The handle of the TSEA task to abort.


Comments

The TSEE makes this call (from another thread) to abort a task. Your TSEA should stop the task run as soon as possible and return a value greater than 0 indicating that the task has been aborted.


See Also

TaskClose(), TaskCreate(), TaskExecute()


TaskClose()

Closes a TSEA task.


Syntax

s32 TaskClose (TaskHandle task)

Element Description
task The handle of the TSEA task to close.


Comments

The TSEE makes this call when a task completes. Your TSEA should perform any cleanup necessitated by the task execution.


See Also

TaskAbort(), TaskCreate(), TaskExecute()


TaskCreate()

Creates a task.


Syntax

TaskHandle TaskCreate (SessionHandle session, TaskType type, 
char *sourcelocation, char *testScriptId)

Element Description
session The session handle, returned by SessionOpen().
type The test script type for scripts that this TSEA plays back.
sourcelocation The location where source scripts of type are located.
testScriptId The name of the file containing the test script.


Comments

On success, return to the TSEE a unique task identifier of type TaskHandle. On failure, return NULL.


See Also

TaskAbort(), TaskClose(), TaskExecute()


TaskExecute()

Executes a TSEA task.


Syntax

s32 TaskExecute (TaskHandle task)

Element Description
task The handle of the TSEA task to execute.


Comments

The TSEE makes this call to execute a task. Your TSEA should return 0 if the task completes successfully or a number greater than 0 if the task fails.


See Also

TaskAbort(), TaskClose(), TaskCreate()


TaskGetOption()

Gets the value of a task option.


Syntax

s32 TaskGetOption (TaskHandle task, char *optname, void 
*optval, s32 len)

Element Description
task The task handle, returned by TaskCreate().
optname The task option whose value is to be returned.
optval The value of optname that is returned to the TSEE.
len Storage buffer size. When TSEE makes the call, optval is an empty buffer of this size; on return, len is the size of the value pointed to by optval.


See Also

TaskSetOption()


TaskSetOption()

Sets the value of a task option.


Syntax

s32 TaskSetOption (TaskHandle task, char *optname, void 
*optval, s32 len)

Element Description
task The task handle, returned by SessionOpen().
optname The task option whose value is to be set.
optval The new value of optname.
len The size of buffer optval.


See Also

TaskGetOption()


TSEAError()

Gets a message following an error.


Syntax

s32 TSEAError (SessionHandle session, char **message)

Element Description
session The session handle, returned by SessionOpen().
message String explaining the cause of a TSEA call failure.


Comments

The TSEE makes this call whenever a TSEA call returns a value greater than 0. Your TSEA should allocate a message buffer for each open session and supply a message indicating the cause of a failure.

prevnext


Rational TestManager Extensibility Reference Rational Software Corporation
Copyright (c) 2003, Rational Software Corporation http://www.rational.com
support@rational.com
info@rational.com