blob: 238e8096e66126cc90e6668246e5fd13a841e5fc [file] [log] [blame]
---
Author: Gábor Szalai
Version: 1551-CNL 113, Rev. A
Date: 2014-08-08
---
= Thrift Test Port generator for TTCN-3 Toolset with TITAN, Description
:author: Gábor Szalai
:revnumber: 1551-CNL 113, Rev. A
:revdate: 2014-08-08
:toc:
*Abstract*
The Thrift Test Port generator produces TTCN-3 test ports based on Apache Thrift definitions.
= Functionality
The Thrift Test Port Generator generates TTCN3 test port definition and c++ wrapper from the Apache Thrift definitions.
The generated test port is able to simulate both Thrift based client and servers.
== System Requirements
In order to operate the Thrift test port, the following system requirements must be satisfied:
* TITAN TTCN-3 Test Executor version R7A (1.7.pl0) or higher installed. For installation guide, see <<_2,here>>.
* Platform:- Linux- Solaris
* <<_5,Thrift library>>
* Gnu AWK 3.1.8 or later
= Feature list
== Generate test port
First the Thrift library files should be generated by the Thrift:
[source]
----
thrift gen cpp <thrift files>
----
The command above generates the C++ code for the thrift functionality. The Thrift Test Port generator creates the TTCN-3 type definition, test port and wrapper around code generated above.
Generate the TTCN-3 test port from the Thrift definition:
[source]
----
gawk f TTPG.awk <thrift files>
----
== Server closing issue
The Thrift library doesnt support the forced close of the inactive client connection from server side. There is a workaround implemented in the Thrift Test Port generator. Generate the test port with the following way:
[source]
----
gawk f TTPG.awk v myserver=1 <thrift files>
----
And add the files `myTThreadedServer.cc` and `myTThreadedServer.h` to the project.
Those files are a patched version of the original thrift library code, and support the closing of the connection by the server.
== Type mapping
The following mapping is used:
=== Basic types
The TTCN-3 type definitions of the Thrift basic types:
[source]
----
type boolean bool
type integer byte
type integer i16
type integer i32
type integer i64
type charstring string
type octetstring binary
----
=== Complex types
The complex type and definition mapping:
[cols=",",options="header",]
|==================================
|Thrift |TTCN-3
|`list<>` |record of
|`set<>` |set of
|`struct` |record
|`exception` |record
|`service` |Procedure based test port
|`funct` |signature
|==================================
= Terminology
No specific terminology is used.
== Abbreviations
API:: Application Programming Interface
ASP:: Abstract Service Primitive
PDU:: Protocol Data Unit
RTE:: Run-Time Environment
SUT:: System Under Test
TTCN-3:: Testing and Test Control Notation version 3
= References
1. [[_1]]ETSI ES 201 873-1 v4.3.1 (2011-06) +
The Testing and Test Control Notation version 3. Part 1: Core Language
2. [[_2]]1/198 17-CRL 113 200/4 Uen +
User Guide for the TITAN TTCN-3 Test Executor
3. [[_3]]109 21-CNL 113 785-1 +
Thrift Test Port generator for TTCN-3 Toolset with TITAN, Product Revision Information
4. [[_4]]2/198 17-CRL 113 200/4 Uen +
Programmers Technical Reference for TITAN TTCN3 Test Executor
5. [[_5]]Apache Thrift +
https://thrift.apache.org/