Home Corporate Contacts

TETware Java API Overview


Products
Solutions

Information

Datasheet
Documentation
FAQ
Knowledgebase

12. Executed Process Methods


Introduction

These methods are provided for use by an API-conforming Java test case that is launched by a call to tet_jspawn(). The test case author defines a new child test case by extending the ChildTestCase class or one of its subclasses. The new test case must provide a static main() method which creates an instance of the child test case class and passes control to the child process controller. For example:


      public class MyChildTestCase extends ChildTestCase
      {
                  . . .
                  public static void main(String[] args)
                  {
                             main(args, new MyChildTestCase());
                  }
                  . . .
      }



tet_main()

Synopsis


      public int tet_main(TestSession ts, String[] args)

Description

The method tet_main() is declared abstract in class ChildTestCase. A child test case class must extend ChildTestCase and implement tet_main(). The API services are provided by a subclass of TestSession. A TestSession object is created when the child test case is initialised and this object is passed to tet_main() in the argument ts. The current context is preserved from the calling process and the current block number is incremented before tet_main() is called.

Return value

If tet_main() returns, its return value becomes the child process' exit status. This status may be accessed in the parent by a call to tet_wait().


tet_exit() and tet_logoff()

Synopsis


      // public class TestSession
      public void tet_exit(int status)
      public void tet_logoff()

Description

The method tet_exit() should be used instead of System.exit() (or Runtime.exit()) by a child test case that is started by a call to tet_jspawn(). In Distributed TETware this method logs off all TETware servers, then exits with the specified status. The function tet_logoff() may be called by a child process that is started by a call to tet_jspawn() which does not need to make any further TETware API calls and is not able to call tet_exit() at process termination. tet_logoff() 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.

Return value

A successful call to tet_exit() does not return. A call to tet_logoff() does not return a value.

Portability

Refer to the corresponding section in the chapter entitled "The C API'' in the TETware Programmers Guide.

Return to Contents



Home Contacts Legal Copyright Corporate News

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