Home Corporate Contacts

TETware Java Documentation


All Packages Class Hierarchy This Package Previous Next Index

Class TET.TestSession

java.lang.Object
   |
   +----TET.TestSession

public final class TestSession
extends Object
The TestSession class provides TETware API services to Java test cases.


Variable Index

 o TET_ER_2BIG
tet_errno value for argument list too long.
 o TET_ER_ABORT
tet_errno value for abort TCM on TP end.
 o TET_ER_CONTEXT
tet_errno value for request out of context.
 o TET_ER_DONE
tet_errno value for event finished or already happened.
 o TET_ER_DUPS
tet_errno value for request contained duplicate IDs.
 o TET_ER_ERR
tet_errno value for general error code.
 o TET_ER_FID
tet_errno value for a bad file id.
 o TET_ER_FORK
tet_errno value for can't fork.
 o TET_ER_INPROGRESS
tet_errno value for event in progress.
 o TET_ER_INTERN
tet_errno value for a server internal error.
 o TET_ER_INVAL
tet_errno value for invalid request parameter.
 o TET_ER_LOGON
tet_errno value for not logged on.
 o TET_ER_MAGIC
tet_errno value for a bad magic number.
 o TET_ER_NOENT
tet_errno value for no such file or directory.
 o TET_ER_OK
tet_errno value for ok, success.
 o TET_ER_PERM
tet_errno value for priv request/kill error.
 o TET_ER_PID
tet_errno value for no such process.
 o TET_ER_RCVERR
tet_errno value for a receive message error.
 o TET_ER_REQ
tet_errno value for an unknown request code.
 o TET_ER_SIGNUM
tet_errno value for a bad signal number.
 o TET_ER_SNID
tet_errno value for bad snid in syncd request.
 o TET_ER_SYNCERR
tet_errno value for sync completed unsuccessfully.
 o TET_ER_SYSID
tet_errno value for sysid not in system name list.
 o TET_ER_TIMEDOUT
tet_errno value for request timed out.
 o TET_ER_TRACE
tet_errno value for tracing not configured.
 o TET_ER_WAIT
tet_errno value for process not terminated.
 o TET_ER_XRID
tet_errno value for bad xrid in xresd request.
 o TET_FAIL
Result code for FAIL result.
 o TET_NORESULT
Result code for NORESULT result.
 o TET_NOTINUSE
Result code for NOTINUSE result.
 o TET_PASS
Result code for PASS result.
 o TET_SV_NO
Synchronisation "no" vote.
 o TET_SV_YES
Synchronisation "yes" vote.
 o TET_UNINITIATED
Result code for UNINITIATED result.
 o TET_UNRESOLVED
Result code for UNRESOLVED result.
 o TET_UNSUPPORTED
Result code for UNSUPPORTED result.
 o TET_UNTESTED
Result code for UNTESTED result.

Method Index

 o tet_delete(int, String)
Mark the test purpose specified by testno as cancelled.
 o tet_errlist()
Retrieves the list of error strings which describe each value of tet_errno.
 o tet_exit(int)
Exit function for child process.
 o tet_getblock()
Retrieves the current TET block number. Deprecated.
 o tet_getsysbyid(int)
Retrieves information about a system participating in the test.
 o tet_getvar(String)
Gets the value of a configuration variable.
 o tet_infoline(String)
Prints a line to the execution results file.
 o tet_jspawn(String, String[], String[])
Creates a new subprogram using a Java class.
 o tet_kill(long, int)
Sends a signal to a process.
 o tet_logoff()
Log off TETware.
 o tet_minfoline(String[])
Prints a group of lines to the execution results file.
 o tet_pname()
Retrieves the test case name.
 o tet_reason(int)
Retrieves the reason for test purpose cancellation.
 o tet_remgetlist()
Gets a list of the other systems participating in the test case.
 o tet_remgetsys()
Gets the system ID of the system on which the calling process is executing.
 o tet_remsync(long, int[], int, int, SyncMessage)
Synchronises with one or more of the other systems in a distributed test case.
 o tet_remtime(int)
Obtains the system time on another system.
 o tet_result(int)
Informs the API of the result of the current test purpose.
 o tet_setblock()
Increments the current block ID.
 o tet_setcontext()
Sets the current context to the value of the current process ID, and resets the block and sequence numbers to 1.
 o tet_spawn(String, String[], String[])
Creates a new subprogram.
 o tet_thistest()
Retrieves the absolute test number for the currently executing test purpose.
 o tet_wait(long)
Waits for a process to terminate.

Variables

 o TET_PASS
 public static final int TET_PASS
Result code for PASS result.

 o TET_FAIL
 public static final int TET_FAIL
Result code for FAIL result.

 o TET_UNRESOLVED
 public static final int TET_UNRESOLVED
Result code for UNRESOLVED result.

 o TET_NOTINUSE
 public static final int TET_NOTINUSE
Result code for NOTINUSE result.

 o TET_UNSUPPORTED
 public static final int TET_UNSUPPORTED
Result code for UNSUPPORTED result.

 o TET_UNTESTED
 public static final int TET_UNTESTED
Result code for UNTESTED result.

 o TET_UNINITIATED
 public static final int TET_UNINITIATED
Result code for UNINITIATED result.

 o TET_NORESULT
 public static final int TET_NORESULT
Result code for NORESULT result.

 o TET_SV_YES
 public static final int TET_SV_YES
Synchronisation "yes" vote.

 o TET_SV_NO
 public static final int TET_SV_NO
Synchronisation "no" vote.

 o TET_ER_OK
 public static final int TET_ER_OK
tet_errno value for ok, success.

 o TET_ER_ERR
 public static final int TET_ER_ERR
tet_errno value for general error code.

 o TET_ER_MAGIC
 public static final int TET_ER_MAGIC
tet_errno value for a bad magic number.

 o TET_ER_LOGON
 public static final int TET_ER_LOGON
tet_errno value for not logged on.

 o TET_ER_RCVERR
 public static final int TET_ER_RCVERR
tet_errno value for a receive message error.

 o TET_ER_REQ
 public static final int TET_ER_REQ
tet_errno value for an unknown request code.

 o TET_ER_TIMEDOUT
 public static final int TET_ER_TIMEDOUT
tet_errno value for request timed out.

 o TET_ER_DUPS
 public static final int TET_ER_DUPS
tet_errno value for request contained duplicate IDs.

 o TET_ER_SYNCERR
 public static final int TET_ER_SYNCERR
tet_errno value for sync completed unsuccessfully.

 o TET_ER_INVAL
 public static final int TET_ER_INVAL
tet_errno value for invalid request parameter.

 o TET_ER_TRACE
 public static final int TET_ER_TRACE
tet_errno value for tracing not configured.

 o TET_ER_WAIT
 public static final int TET_ER_WAIT
tet_errno value for process not terminated.

 o TET_ER_XRID
 public static final int TET_ER_XRID
tet_errno value for bad xrid in xresd request.

 o TET_ER_SNID
 public static final int TET_ER_SNID
tet_errno value for bad snid in syncd request.

 o TET_ER_SYSID
 public static final int TET_ER_SYSID
tet_errno value for sysid not in system name list.

 o TET_ER_INPROGRESS
 public static final int TET_ER_INPROGRESS
tet_errno value for event in progress.

 o TET_ER_DONE
 public static final int TET_ER_DONE
tet_errno value for event finished or already happened.

 o TET_ER_CONTEXT
 public static final int TET_ER_CONTEXT
tet_errno value for request out of context.

 o TET_ER_PERM
 public static final int TET_ER_PERM
tet_errno value for priv request/kill error.

 o TET_ER_FORK
 public static final int TET_ER_FORK
tet_errno value for can't fork.

 o TET_ER_NOENT
 public static final int TET_ER_NOENT
tet_errno value for no such file or directory.

 o TET_ER_PID
 public static final int TET_ER_PID
tet_errno value for no such process.

 o TET_ER_SIGNUM
 public static final int TET_ER_SIGNUM
tet_errno value for a bad signal number.

 o TET_ER_FID
 public static final int TET_ER_FID
tet_errno value for a bad file id.

 o TET_ER_INTERN
 public static final int TET_ER_INTERN
tet_errno value for a server internal error.

 o TET_ER_ABORT
 public static final int TET_ER_ABORT
tet_errno value for abort TCM on TP end.

 o TET_ER_2BIG
 public static final int TET_ER_2BIG
tet_errno value for argument list too long.

Methods

 o tet_thistest
 public native int tet_thistest()
Retrieves the absolute test number for the currently executing test purpose. This is 0 when in the startup and cleanup routines.

Returns:
the current test number.
 o tet_pname
 public String tet_pname()
Retrieves the test case name.

Returns:
the test case name.
 o tet_errlist
 public String[] tet_errlist()
Retrieves the list of error strings which describe each value of tet_errno.

Returns:
the list of error strings.
 o tet_setcontext
 public native synchronized void tet_setcontext()
Sets the current context to the value of the current process ID, and resets the block and sequence numbers to 1.

 o tet_setblock
 public void tet_setblock()
Increments the current block ID.

 o tet_getblock
 public int tet_getblock()
Note: tet_getblock() is deprecated. Not part of the published API.

Retrieves the current TET block number.

Returns:
the current TET block number.
 o tet_infoline
 public native synchronized void tet_infoline(String line)
Prints a line to the execution results file.

Parameters:
line - line to print to the results file.
 o tet_minfoline
 public native synchronized void tet_minfoline(String lines[]) throws TetException
Prints a group of lines to the execution results file. In Distributed TETware these lines are printed using a single operation which guarantees that lines from other test case parts do not appear in between lines printed by one call to this function.

Parameters:
lines - group of lines to print to the results file.
Throws: TetException
if there was an error printing the lines.
 o tet_result
 public native synchronized void tet_result(int result)
Informs the API of the result of the current test purpose.

Parameters:
result - the result code.
 o tet_delete
 public native synchronized void tet_delete(int testno,
                                            String reason)
Mark the test purpose specified by testno as cancelled.

Parameters:
testno - absolute test number of the test purpose to be cancelled.
reason - text describing the reason why the test purpose is to be marked as cancelled. May be NULL, in which case the specified test purpose is reactivated if it has previously been marked as cancelled.
 o tet_reason
 public native synchronized String tet_reason(int testno)
Retrieves the reason for test purpose cancellation.

Parameters:
testno - absolute test number of the test purpose.
Returns:
a string describing the reason for test purpose cancellation, or null if this test purpose is not marked as cancelled.
 o tet_getvar
 public native synchronized String tet_getvar(String name)
Gets the value of a configuration variable.

Parameters:
name - name of the configuration variable.
Returns:
the value of the specified configuration variable. If the variable specified is defined but has no setting, a String object of zero length is returned. If the variable is undefined, null is returned.
 o tet_spawn
 public long tet_spawn(String file,
                       String argv[],
                       String envp[]) throws TetException
Creates a new subprogram. The subprogram launched must be built with the child process controller.

Parameters:
file - path of the subprogram to execute.
argv - argument array to pass to new process.
envp - environment data to pass to new process. If this is null or has length 0, the current environment is used.
Returns:
the process ID of the newly created process.
Throws: TetException
if there is an error launching the child process.
 o tet_jspawn
 public long tet_jspawn(String classname,
                        String args[],
                        String envp[]) throws TetException
Creates a new subprogram using a Java class. The class must be a subclass of ChildTestCase.

Parameters:
classname - name of the Java class to execute in a new process.
args - argument array to pass to main() method of the class N.B. args[0] is the first actual argument, not the name of the interpreter or the name of the class.
envp - environment data to pass to new process. If this is null or has length 0, the current environment is used.
Returns:
the process ID of the newly created process.
Throws: TetException
if there is an error launching the child process.
 o tet_wait
 public native synchronized int tet_wait(long pid) throws TetException
Waits for a process to terminate.

Parameters:
pid - process ID of the process to wait for.
Returns:
the exit status of the process.
Throws: TetException
if the wait is unsuccessful.
 o tet_kill
 public native synchronized void tet_kill(long pid,
                                          int sig) throws TetException
Sends a signal to a process.

Parameters:
pid - process ID of the victim process.
sig - number of the signal to send. Note that this is ignored on a Windows NT system.
Throws: TetException
the kill was unsuccessful.
 o tet_remsync
 public native synchronized void tet_remsync(long syncptno,
                                             int sysnames[],
                                             int waittime,
                                             int vote,
                                             SyncMessage msg) throws TetException
Synchronises with one or more of the other systems in a distributed test case.

Parameters:
syncptno - the sync point number to which the calling system wishes to synchronise. If syncptno is zero, a successful call to tet_remsync() returns as soon as all participating systems have synchronised to the next sync point.
sysnames - a list of IDs of the other systems with which to synchronise. The system ID of the calling system is ignored if it appears in the list.
waittime - the number of seconds that may elapse between synchronisation requests from other participating systems before the calling system times out.
vote - how the calling system wishes to vote in the synchronisation event. This should be TET_SV_YES or TET_SV_NO.
msg - used to exchange sync message data with other participating systems.
Throws: TetException
if this is TETware-Lite, or if an error occurs during the sync.
See Also:
SyncMessage
 o tet_remgetlist
 public native synchronized int[] tet_remgetlist()
Gets a list of the other systems participating in the test case.

Returns:
list of IDs of the other systems participating in the test case. Returns null in TETware-Lite or for a test case in which no other systems are participating.
 o tet_remgetsys
 public native synchronized int tet_remgetsys()
Gets the system ID of the system on which the calling process is executing.

Returns:
the system ID of the current system.
 o tet_getsysbyid
 public SystemEntry tet_getsysbyid(int sysid) throws TetException
Retrieves information about a system participating in the test.

Parameters:
sysid - ID of the system of interest.
Returns:
the entry for the requested system.
Throws: TetException
if this is TETware-Lite, or if an error occurs retrieving the entry for the specified system.
See Also:
SystemEntry
 o tet_remtime
 public Date tet_remtime(int sysid) throws TetException
Obtains the system time on another system.

Parameters:
sysid - ID of the system of interest.
Returns:
the system time on the system of interest.
Throws: TetException
if this is TETware-Lite, or if an error occurs retrieving the system time of the specified system.
 o tet_exit
 public native synchronized void tet_exit(int status)
Exit function for child process. This should be used instead of java.lang.System.exit() by child processes created by tet_spawn(). In Distribute TETware this method logs off all TETware servers, then exits with the specified status.

Parameters:
status - exit status.
 o tet_logoff
 public native synchronized void tet_logoff()
Log off TETware. This may be called by a child process that is started by a call to tet_spawn() which does not need to make any further TETware API calls and is not able to call tet_exit() at process termination. This should only be called once from the child process. In Distributed TETware, the results are undefined if a process or any of its descendents makes any TETware API calls after tet_logoff() is called.


All Packages Class Hierarchy This Package Previous Next Index

Home Contacts Legal Copyright Corporate News

Copyright © The Open Group 1995-2012, All Rights Reserved