1、 ETSI ES 201 873-8 V4.6.1 (2015-06) Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 8: The IDL to TTCN-3 Mapping ETSI STANDARD ETSI ETSI ES 201 873-8 V4.6.1 (2015-06)2 Reference RES/MTS-201873-8 T3ed461 Keywords IDL, testing, TTCN ETSI 650 Route des
2、 Lucioles F-06921 Sophia Antipolis Cedex - FRANCE Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16 Siret N 348 623 562 00017 - NAF 742 C Association but non lucratif enregistre la Sous-Prfecture de Grasse (06) N 7803/88 Important notice The present document can be downloaded from: http:/www.etsi.org/s
3、tandards-search The present document may be made available in electronic versions and/or in print. The content of any electronic and/or print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any existing or perceived difference in con
4、tents between such versions and/or in print, the only prevailing document is the print of the Portable Document Format (PDF) version kept on a specific network drive within ETSI Secretariat. Users of the present document should be aware that the document may be subject to revision or change of statu
5、s. Information on the current status of this and other ETSI documents is available at http:/portal.etsi.org/tb/status/status.asp If you find errors in the present document, please send your comment to one of the following services: https:/portal.etsi.org/People/CommiteeSupportStaff.aspx Copyright No
6、tification No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm except as authorized by written permission of ETSI. The content of the PDF version shall not be modified without the written authorization of ETSI. The copyrig
7、ht and the foregoing restriction extend to reproduction in all media. European Telecommunications Standards Institute 2015. All rights reserved. DECTTM, PLUGTESTSTM, UMTSTMand the ETSI logo are Trade Marks of ETSI registered for the benefit of its Members. 3GPPTM and LTE are Trade Marks of ETSI regi
8、stered for the benefit of its Members and of the 3GPP Organizational Partners. GSM and the GSM logo are Trade Marks registered and owned by the GSM Association. ETSI ETSI ES 201 873-8 V4.6.1 (2015-06)3 Contents Intellectual Property Rights 5g3Foreword . 5g3Modal verbs terminology 5g3Introduction 5g3
9、1 Scope 7g32 References 7g32.1 Normative references . 7g32.2 Informative references 7g33 Abbreviations . 8g34 Approach 8g35 Lexical Conventions . 8g35.1 Comments. 8g35.2 Identifiers . 9g35.3 Keywords . 9g35.4 Literals 9g36 Pre-processing 9g37 Importing from IDL specifications . 9g37.1 Importing modu
10、le declaration 9g37.2 Importing interface declaration 10g37.3 Importing value declaration 11g37.4 Importing constant declaration . 11g38 Importing type declaration . 12g38.1 IDL basic types . 12g38.1.1 Integer and floating-point types 12g38.1.2 Char and wide char type . 13g38.1.3 Boolean type . 13g3
11、8.1.4 Octet type 13g38.1.5 Any type . 13g38.2 Constructed types . 13g38.2.1 Struct . 14g38.2.2 Discriminated unions 14g38.2.3 Enumerations 15g38.3 Template types . 15g38.3.1 Sequence. 15g38.3.2 String and wstring . 16g38.3.3 Fixed types 16g38.4 Complex declarator 16g38.4.1 Arrays . 16g38.4.2 Native
12、types 16g39 Importing exception declaration . 17g310 Importing operation declaration . 18g311 Importing attribute declaration . 19g312 Names and scoping . 19g3Annex A (informative): Examples . 21g3A.1 Example 21g3A.1.1 IDL specification 21g3A.1.2 Derived TTCN-3 specification . 22g3ETSI ETSI ES 201 8
13、73-8 V4.6.1 (2015-06)4 Annex B (informative): Mapping lists 27g3B.1 IDL keyword and concept mapping list . 27g3B.2 Comparison of IDL, ASN.1, TTCN-2 and TTCN-3 data types . 28g3Annex C (informative): Bibliography . 29g3History 30g3ETSI ETSI ES 201 873-8 V4.6.1 (2015-06)5 Intellectual Property Rights
14、IPRs essential or potentially essential to the present document may have been declared to ETSI. The information pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found in ETSI SR 000 314: “Intellectual Property Rights (IPRs); Essential, or
15、 potentially Essential, IPRs notified to ETSI in respect of ETSI standards“, which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web server (http:/ipr.etsi.org). Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI
16、. No guarantee can be given as to the existence of other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web server) which are, or may be, or may become, essential to the present document. Foreword This ETSI Standard (ES) has been produced by ETSI Technical Committee Methods for T
17、esting and Specification (MTS). The present document is part 8 of a multi-part deliverable. Full details of the entire series can be found in part 1 1. Modal verbs terminology In the present document “shall“, “shall not“, “should“, “should not“, “may“, “need not“, “will“, “will not“, “can“ and “cann
18、ot“ are to be interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions). “must“ and “must not“ are NOT allowed in ETSI deliverables except when used in direct citation. Introduction Object-based technologies (such as CORBA, DCOM, DCE) and compo
19、nent-based technologies (such as CCM, EJB, Microsoft.NET) use interface specifications to describe the structure of an object-/component-based system and its operations and capabilities to interact with the environment. These interface specifications support interoperability and reusability of objec
20、ts/components. The techniques used for interface specifications are often called Interface Definition Language (IDL), for example CORBA IDL, MicrosoftIDL or DCE IDL. These languages are comparable in their abilities to define system interfaces, operations at system interfaces and system structures t
21、o various extends. They differ in details of the object/component model. When considering the testing of object-/component-based systems with TTCN-3, one is faced with the problem of accessing the systems to be tested via the system interfaces as described in an IDL specification. In particular, for
22、 TTCN-3 based test systems a direct import of IDL specifications into the test specifications for the use of e.g. systems interface, operation and exception definitions is prevalent to any manual transformation into TTCN-3. The present document discusses the mapping of CORBA IDL specifications into
23、TTCN-3. This mapping rules out the principles not only for CORBA IDL, but also for other interface specification languages. The mapping can be adapted to the details of other interface specification languages. The Interface Definition Language (IDL) (chapter 3 in 4) is a base of the whole Common Obj
24、ect Request Broker Architecture (CORBA) 4 and an important point in developing distributed systems with CORBA. It allows the reuse and interoperability of objects in a system. A mapping between IDL and a programming language is defined in the CORBA standard. IDL is very similar to C+ containing pre-
25、processor directives (include, comments, etc.), grammar as well as constant, type and operation declarations. There are no programming language features like, e.g. if-statements. The core language of TTCN-3 is defined in ETSI ES 201 873-1 1 and provides a full text-based syntax, static semantics and
26、 operational semantics. The IDL mapping provides a definition for the use of the core language with IDL (figure 1). ETSI ETSI ES 201 873-8 V4.6.1 (2015-06)6 TTCN-3 Core Language Presentation format nTTCN-3 User ASN.1 types and values Other types and valuesnGraphical format IDL types and values The s
27、haded boxes are not defined in the present document Tabular format Figure 1: Users view of the core language and the various presentation formats It makes no difference for the mapping if requested or provided interfaces are required by the test system and SUT. Hence, TTCN can be used on client and
28、server side without modifications to the mapping rules. The present document is structured similar to the IDL specification document to provide easy access to the mapping of each IDL element. ETSI ETSI ES 201 873-8 V4.6.1 (2015-06)7 1 Scope The present document defines the mapping rules for CORBA ID
29、L (as defined in chapter 3 in 4) to TTCN-3 (as defined in ETSI ES 201 873-1 1) to enable testing of CORBA-based systems. The principles of mapping CORBA IDL to TTCN-3 can be also used for the mapping of interface specification languages of other object-/component-based technologies. The specificatio
30、n of other mappings is outside the scope of the present document. 2 References 2.1 Normative references References are either specific (identified by date of publication and/or edition number or version number) or non-specific. For specific references, only the cited version applies. For non-specifi
31、c references, the latest version of the reference document (including any amendments) applies. Referenced documents which are not found to be publicly available in the expected location might be found at http:/docbox.etsi.org/Reference. NOTE: While any hyperlinks included in this clause were valid a
32、t the time of publication, ETSI cannot guarantee their long term validity. The following referenced documents are necessary for the application of the present document. 1 ETSI ES 201 873-1: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 1: TTCN-3
33、Core Language“. 2 Recommendation ITU-T T.50: “International Reference Alphabet (IRA) (Formerly International Alphabet No. 5 or IA5) - Information technology - 7-bit coded character set for information interchange“. 3 ISO/IEC 10646 (2014): “Information technology - Universal Coded Character Set (UCS)
34、“. 4 CORBA 3.0: “The Common Object Request Broker: Architecture and Specification“. NOTE: Available at http:/www.omg.org/spec/CORBA/. 2.2 Informative references References are either specific (identified by date of publication and/or edition number or version number) or non-specific. For specific re
35、ferences, only the cited version applies. For non-specific references, the latest version of the reference document (including any amendments) applies. NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee their long term validity. The follow
36、ing referenced documents are not necessary for the application of the present document but they assist the user with regard to a particular subject area. i.1 ETSI ES 201 873-7: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 7: Using ASN.1 with TTC
37、N-3“. i.2 Void. i.3 Void. i.4 Void. i.5 ETSI ES 202 781: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: Configuration and Deployment Support“. ETSI ETSI ES 201 873-8 V4.6.1 (2015-06)8 i.6 ETSI ES 202 782: “Methods for Testin
38、g and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: TTCN-3 Performance and Real Time Testing“. i.7 ETSI ES 202 784: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: Advanced
39、Parameterization“. i.8 ETSI ES 202 785: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: Behaviour Types“. i.9 ETSI ES 202 786: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTC
40、N-3 Language Extensions: Support of interfaces with continuous signals“. 3 Abbreviations For the purposes of the present document, the following abbreviations apply: ASN.1 Abstract Syntax Notation One CCM CORBA Component Model NOTE: By OMG. CORBA Common Object Request Broker Architecture NOTE: By OM
41、G. DCE Distributed Computing Environment NOTE: By OSF. EJB Enterprise JavaBeansTMNOTE: By Sun. IDL Interface Definition Language NET XML-based component technology NOTE: By Microsoft. OMG Object Management Group OSF Open Software Foundation SUT System Under Test TTCN Testing and Test Control Notatio
42、n XML eXtended Markup Language 4 Approach Two different approaches can be identified: the use of either implicit or explicit mapping. The implicit mapping makes use of the import mechanism of TTCN-3, denoted by the keywords language and import. It facilitates the immediate use of data specified in o
43、ther languages. Therefore, the definition of a specific data interface for each of these languages is required. Currently, ASN.1 data can be used besides the native TTCN-3 types (see ETSI ES 201 873-7 i.1). The present document follows the approach of explicit mapping, i.e. IDL data are translated i
44、nto appropriate TTCN-3 data. And only those TTCN-3 data are further used in the test specification. 5 Lexical Conventions The lexical conventions of IDL define the comments, identifiers, keywords and literals conventions which are described below. 5.1 Comments Comment definitions in TTCN-3 and IDL a
45、re the same and therefore, no conversion of comments is necessary. ETSI ETSI ES 201 873-8 V4.6.1 (2015-06)9 5.2 Identifiers IDL identifier rules define a subset of the TTCN-3 rules in which no conversion is necessary. 5.3 Keywords When IDL is used with TTCN-3 the keywords of TTCN-3 shall not be used
46、 as identifiers in an IDL module. 5.4 Literals The definition of literals differs slightly between IDL and TTCN-3 why some modifications have to be made. Table 1 gives the mapping for each literal type. Table 1: Literal mapping Literal IDL TTCN Integer no “0“ as first digit no “0“ as first digit Oct
47、et “0“ as first digit FF96O Hex “0X“ or “0x“ as first digits AB01DH Floating 1222.44E5 (Base 10) 1222.44E5 (Base 10) Char A “A“ Wide char L“A“ “A“ Boolean TRUE, FALSE true, false String “text“ “text“ Wide string L“text“ “text“ Fixed point 33.33D (see useful type IDLfixed) IDL uses the ISO Latin-1 ch
48、aracter set for string and wide string literals and TTCN-3 uses Recommendation ITU-T T.50 2 for string literals and ISO/IEC 10646 3 for wide string literals. 6 Pre-processing Pre-processor statements are not matched to TTCN-3 because the IDL specification shall be used after pre-processing it. 7 Imp
49、orting from IDL specifications The import of module, interface, value and constant declaration are described in this clause. The type and exception declaration as well as the bodies of interfaces are described later. All imported IDL declarations are in TTCN-3 public by default (see clause 8.2.5 of ETSI ES 201 873-1 1). 7.1 Importing module declaration IDL modules are mapped to TTCN-3 modules. Nested IDL modules shall be flattened accordingly to TTCN-3 modules. As one IDL module can contain many nested IDL module