Home Corporate Contacts

TETware Java API Overview


Products
Solutions

Information

Datasheet
Documentation
FAQ
Knowledgebase

8. Making journal entries


Introduction

These methods are provided in the TestSession class for use by test cases when making entries in the execution result file.


tet_setcontext() and tet_setblock()

Synopsis


      // public class TestSession
      public void tet_setcontext()
      public void tet_setblock()

Description

The tet_setcontext() method sets the current context to the value of the current process ID. The sequence number for the calling thread is reset to 1, but sequence numbers for other threads remain unchanged, as do all block numbers. The tet_setblock() method increments the current block ID. The value of the current block ID is reset to 1 at the start of every test purpose. The sequence ID of the next entry, a number which is automatically incremented as each entry is output to the execution results file, is set to one at the start of each new block.

Return value

These methods do not return a value.

Application notes

The API calls these methods when necessary. It is not usually necessary for user-supplied test code to call these methods.


tet_infoline() and tet_minfoline()

Synopsis


      // public class TestSession
      public void tet_infoline(String line)
      public void tet_minfoline(String[] lines) throws TetException

Description

A call to tet_infoline() prints the information line specified by line to the execution results file. The sequence number is incremented by one after the line is output. If the current context and the current block ID have not been set, the call to tet_infoline() causes the current context to be set to the value of the calling process ID and the current block ID to be set to one. A call to tet_minfoline() prints groups of information 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 a particular call to this method.

Return value

These methods do not return a value.

Exceptions

tet_minfoline() throws a TetException object if the API encounters an error while printing the lines.

Application notes

Equivalents to tet_printf() and tet_vprintf() in the C API are not provided in the Java API. This is because the C and Java languages handle formatted output in different ways.


tet_result()

Synopsis


       // public class TestSession
       public void tet_result(int result)

Description

A call to tet_result() informs the API of the result of the test purpose from which it is called. The API generates a TP result line which is printed to the execution results file by the TCM upon test purpose completion. This ensures that all the informational messages are written out before the test purpose result, and that there is one (and only one) result generated per test purpose. If the result code specified by result is one for which the action specified in the result codes file is to abort testing, then the TCM will exit after the test purpose has completed. If an immediate abort is desired, then the test purpose should execute a return statement immediately after the call to tet_result(). If a test purpose does not call tet_result(), the TCM will generate a result of NORESULT. If more than one call to tet_result() is made with different result codes, the TCM determines the final result code by use of precedence rules. The precedence order (highest first) is:


       FAIL
       UNRESOLVED, UNINITIATED
       NORESULT (i.e., invalid result codes)
       Test suite supplied codes
       UNSUPPORTED, UNTESTED, NOTINUSE
       PASS

Where two or more codes have the same precedence then all calls to tet_result() with one of those codes are ignored except the first such call. The tet_result() method should only be called from within the scope of a test purpose method. It must not be called from a test case start up or clean up method.

Return value

This method does not return a value.

Return to Contents



Home Contacts Legal Copyright Corporate News

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