|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTET.TestSession
public final class TestSession
The TestSession
class provides TETware API services to Java
test cases.
Field Summary | |
---|---|
static int |
TET_ER_2BIG
tet_errno value for argument list too long. |
static int |
TET_ER_ABORT
tet_errno value for abort TCM on TP end. |
static int |
TET_ER_CONTEXT
tet_errno value for request out of context. |
static int |
TET_ER_DONE
tet_errno value for event finished or already happened. |
static int |
TET_ER_DUPS
tet_errno value for request contained duplicate IDs. |
static int |
TET_ER_ERR
tet_errno value for general error code. |
static int |
TET_ER_FID
tet_errno value for a bad file id. |
static int |
TET_ER_FORK
tet_errno value for can't fork. |
static int |
TET_ER_INPROGRESS
tet_errno value for event in progress. |
static int |
TET_ER_INTERN
tet_errno value for a server internal error. |
static int |
TET_ER_INVAL
tet_errno value for invalid request parameter. |
static int |
TET_ER_LOGON
tet_errno value for not logged on. |
static int |
TET_ER_MAGIC
tet_errno value for a bad magic number. |
static int |
TET_ER_NOENT
tet_errno value for no such file or directory. |
static int |
TET_ER_OK
tet_errno value for ok, success. |
static int |
TET_ER_PERM
tet_errno value for priv request/kill error. |
static int |
TET_ER_PID
tet_errno value for no such process. |
static int |
TET_ER_RCVERR
tet_errno value for a receive message error. |
static int |
TET_ER_REQ
tet_errno value for an unknown request code. |
static int |
TET_ER_SIGNUM
tet_errno value for a bad signal number. |
static int |
TET_ER_SNID
tet_errno value for bad snid in syncd request. |
static int |
TET_ER_SYNCERR
tet_errno value for sync completed unsuccessfully. |
static int |
TET_ER_SYSID
tet_errno value for sysid not in system name list. |
static int |
TET_ER_TIMEDOUT
tet_errno value for request timed out. |
static int |
TET_ER_TRACE
tet_errno value for tracing not configured. |
static int |
TET_ER_WAIT
tet_errno value for process not terminated. |
static int |
TET_ER_XRID
tet_errno value for bad xrid in xresd request. |
static int |
TET_FAIL
Result code for FAIL result. |
static int |
TET_NORESULT
Result code for NORESULT result. |
static int |
TET_NOTINUSE
Result code for NOTINUSE result. |
static int |
TET_PASS
Result code for PASS result. |
static int |
TET_SV_NO
Synchronisation "no" vote. |
static int |
TET_SV_YES
Synchronisation "yes" vote. |
static int |
TET_UNINITIATED
Result code for UNINITIATED result. |
static int |
TET_UNRESOLVED
Result code for UNRESOLVED result. |
static int |
TET_UNSUPPORTED
Result code for UNSUPPORTED result. |
static int |
TET_UNTESTED
Result code for UNTESTED result. |
Method Summary | |
---|---|
void |
tet_delete(int testno,
java.lang.String reason)
Mark the test purpose specified by testno as cancelled. |
java.lang.String[] |
tet_errlist()
Retrieves the list of error strings which describe each value of tet_errno . |
void |
tet_exit(int status)
Exit function for child process. |
int |
tet_getblock()
Deprecated. Not part of the published API. |
SystemEntry |
tet_getsysbyid(int sysid)
Retrieves information about a system participating in the test. |
java.lang.String |
tet_getvar(java.lang.String name)
Gets the value of a configuration variable. |
void |
tet_infoline(java.lang.String line)
Prints a line to the execution results file. |
long |
tet_jspawn(java.lang.String classname,
java.lang.String[] args,
java.lang.String[] envp)
Creates a new subprogram using a Java class. |
void |
tet_kill(long pid,
int sig)
Sends a signal to a process. |
void |
tet_logoff()
Log off TETware. |
void |
tet_minfoline(java.lang.String[] lines)
Prints a group of lines to the execution results file. |
java.lang.String |
tet_pname()
Retrieves the test case name. |
java.lang.String |
tet_reason(int testno)
Retrieves the reason for test purpose cancellation. |
int[] |
tet_remgetlist()
Gets a list of the other systems participating in the test case. |
int |
tet_remgetsys()
Gets the system ID of the system on which the calling process is executing. |
void |
tet_remsync(long syncptno,
int[] sysnames,
int waittime,
int vote,
SyncMessage msg)
Synchronises with one or more of the other systems in a distributed test case. |
java.util.Date |
tet_remtime(int sysid)
Obtains the system time on another system. |
void |
tet_result(int result)
Informs the API of the result of the current test purpose. |
void |
tet_setblock()
Increments the current block ID. |
void |
tet_setcontext()
Sets the current context to the value of the current process ID, and resets the block and sequence numbers to 1. |
long |
tet_spawn(java.lang.String file,
java.lang.String[] argv,
java.lang.String[] envp)
Creates a new subprogram. |
int |
tet_thistest()
Retrieves the absolute test number for the currently executing test purpose. |
int |
tet_wait(long pid)
Waits for a process to terminate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TET_PASS
public static final int TET_FAIL
public static final int TET_UNRESOLVED
public static final int TET_NOTINUSE
public static final int TET_UNSUPPORTED
public static final int TET_UNTESTED
public static final int TET_UNINITIATED
public static final int TET_NORESULT
public static final int TET_SV_YES
public static final int TET_SV_NO
public static final int TET_ER_OK
tet_errno
value for ok, success.
public static final int TET_ER_ERR
tet_errno
value for general error code.
public static final int TET_ER_MAGIC
tet_errno
value for a bad magic number.
public static final int TET_ER_LOGON
tet_errno
value for not logged on.
public static final int TET_ER_RCVERR
tet_errno
value for a receive message error.
public static final int TET_ER_REQ
tet_errno
value for an unknown request code.
public static final int TET_ER_TIMEDOUT
tet_errno
value for request timed out.
public static final int TET_ER_DUPS
tet_errno
value for request contained duplicate IDs.
public static final int TET_ER_SYNCERR
tet_errno
value for sync completed unsuccessfully.
public static final int TET_ER_INVAL
tet_errno
value for invalid request parameter.
public static final int TET_ER_TRACE
tet_errno
value for tracing not configured.
public static final int TET_ER_WAIT
tet_errno
value for process not terminated.
public static final int TET_ER_XRID
tet_errno
value for bad xrid in xresd request.
public static final int TET_ER_SNID
tet_errno
value for bad snid in syncd request.
public static final int TET_ER_SYSID
tet_errno
value for sysid not in system name list.
public static final int TET_ER_INPROGRESS
tet_errno
value for event in progress.
public static final int TET_ER_DONE
tet_errno
value for event finished or already happened.
public static final int TET_ER_CONTEXT
tet_errno
value for request out of context.
public static final int TET_ER_PERM
tet_errno
value for priv request/kill error.
public static final int TET_ER_FORK
tet_errno
value for can't fork.
public static final int TET_ER_NOENT
tet_errno
value for no such file or directory.
public static final int TET_ER_PID
tet_errno
value for no such process.
public static final int TET_ER_SIGNUM
tet_errno
value for a bad signal number.
public static final int TET_ER_FID
tet_errno
value for a bad file id.
public static final int TET_ER_INTERN
tet_errno
value for a server internal error.
public static final int TET_ER_ABORT
tet_errno
value for abort TCM on TP end.
public static final int TET_ER_2BIG
tet_errno
value for argument list too long.
Method Detail |
---|
public int tet_thistest()
public java.lang.String tet_pname()
public java.lang.String[] tet_errlist()
tet_errno
.
public void tet_setcontext()
public void tet_setblock()
public int tet_getblock()
public void tet_infoline(java.lang.String line)
line
- line to print to the results file.public void tet_minfoline(java.lang.String[] lines) throws TetException
lines
- group of lines to print to the results file.
TetException
- if there was an error printing the
lines.public void tet_result(int result)
result
- the result code.public void tet_delete(int testno, java.lang.String reason)
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.public java.lang.String tet_reason(int testno)
testno
- absolute test number of the test purpose.
null
if this test purpose
is not marked as cancelled.public java.lang.String tet_getvar(java.lang.String name)
name
- name of the configuration variable.
String
object of zero length is
returned. If the variable is undefined,
null
is returned.public long tet_spawn(java.lang.String file, java.lang.String[] argv, java.lang.String[] envp) throws TetException
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.
TetException
- if there is an error launching the
child process.public long tet_jspawn(java.lang.String classname, java.lang.String[] args, java.lang.String[] envp) throws TetException
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.
TetException
- if there is an error launching the
child process.public int tet_wait(long pid) throws TetException
pid
- process ID of the process to wait for.
TetException
- if the wait is unsuccessful.public void tet_kill(long pid, int sig) throws TetException
pid
- process ID of the victim process.sig
- number of the signal to send. Note that this is
ignored on a Windows NT system.
TetException
- the kill was unsuccessful.public void tet_remsync(long syncptno, int[] sysnames, int waittime, int vote, SyncMessage msg) throws TetException
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.
TetException
- if this is TETware-Lite, or if an error
occurs during the sync.SyncMessage
public int[] tet_remgetlist()
null
in TETware-Lite or
for a test case in which no other systems are
participating.public int tet_remgetsys()
public SystemEntry tet_getsysbyid(int sysid) throws TetException
sysid
- ID of the system of interest.
TetException
- if this is TETware-Lite, or if an error
occurs retrieving the entry for the
specified system.SystemEntry
public java.util.Date tet_remtime(int sysid) throws TetException
sysid
- ID of the system of interest.
TetException
- if this is TETware-Lite, or if an error
occurs retrieving the system time of
the specified system.public void tet_exit(int status)
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.
status
- exit status.public void tet_logoff()
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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |