|
// TTCN-3
// TUTORIAL
// USAGE
// INTERFACES
// DOWNLOAD
// ABOUT
THE TTCN-3 INTERFACES// INTERFACES // STIMULI // RESPONSES // CODEC // ADAPTER TYPES // CODEC TYPES // STANDARDSINTERFACING THE SYSTEM UNDER TESTTo define the interface between between the Abstract Test Suite and the System Under Test (SUT) you have to write an adapter that translates TTCN-3 statements such as send into stimuli to the SUT and passes responses of the SUT back to the test system. You also have to write a Coder/Decoder (Codec) that translates abstract values into concrete representations and vice versa.The interfaces of adapters and codecs (and other runtime components) are defined by ETSI standards. Adapter and codec may be implemented in any .NET language, e.g. C# (example) or Java (example). For a discussion and an example see the Tutorial.
AdapterThe adpter may be decomposed into a stimulus adapter and a response adapter.The stimulus adapter is a class that implements the interface TriCommunicationSA. This class provides methods (such as triSend) that are invoked when certain TTCN-3 statements (such as send) are executed. The methods of the stimulus adapter are described here. The response adapter waits for responses of the SUT and passes them to the test system. To do this, it invokes static methods (such as triEnqueueMsg) of a class that implements the interface TriCommunicationTE. The methods supporting the response adapter are described here. The parameter types of adapter methods are described here. CodecThe codec is a class that implements the interface TciCDProvided which defines the methods encode and decode.These methods are documented here. The methods have to analyze and synthesize TTCN-3 types and TTCN-3 values. TTCN-3 types are accessible as instances of type Type. Values of TTCN-3 types are accessible as instances of type Value and its subclasses. (Supporting methods are provided by a class implementing the interface TciCDRequired.) The types Type and Value are documented here. FrameworkThe library provides a class Framework with methods that deliver instances of implementations of TCI and TRI interfaces. For example, the singleton instance of the class implementing TriCommunicationTE is obtained byFramework.GetTriCommunicationTE()Hence the method triEnqueueMsg can be called in this way: Framework.GetTriCommunicationTE().triEnqueueMsg(port, addr, comp, msg) The class Framework also provides a method GetFactory that delivers a factory object. It supplies factory methods for TRI and TCI types. For example, fresh instances of a class implementing TriMessage can be created in this way: TriMessage msg = Framework.GetFactory().TriMessage(); |