ETSI ES 201 873-11-2018 Methods for Testing and Specification (MTS) The Testing and Test Control Notation version 3 Part 11 Using JSON with TTCN-3 (V4 8 1).pdf

上传人:刘芸 文档编号:730777 上传时间:2019-01-08 格式:PDF 页数:34 大小:234.47KB
下载 相关 举报
ETSI ES 201 873-11-2018 Methods for Testing and Specification (MTS) The Testing and Test Control Notation version 3 Part 11 Using JSON with TTCN-3 (V4 8 1).pdf_第1页
第1页 / 共34页
ETSI ES 201 873-11-2018 Methods for Testing and Specification (MTS) The Testing and Test Control Notation version 3 Part 11 Using JSON with TTCN-3 (V4 8 1).pdf_第2页
第2页 / 共34页
ETSI ES 201 873-11-2018 Methods for Testing and Specification (MTS) The Testing and Test Control Notation version 3 Part 11 Using JSON with TTCN-3 (V4 8 1).pdf_第3页
第3页 / 共34页
ETSI ES 201 873-11-2018 Methods for Testing and Specification (MTS) The Testing and Test Control Notation version 3 Part 11 Using JSON with TTCN-3 (V4 8 1).pdf_第4页
第4页 / 共34页
ETSI ES 201 873-11-2018 Methods for Testing and Specification (MTS) The Testing and Test Control Notation version 3 Part 11 Using JSON with TTCN-3 (V4 8 1).pdf_第5页
第5页 / 共34页
点击查看更多>>
资源描述

1、 ETSI ES 201 873-11 V4.8.1 (2018-05) Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 11: Using JSON with TTCN-3 ETSI STANDARD ETSI ETSI ES 201 873-11 V4.8.1 (2018-05)2 Reference RES/MTS-201873-11ed481 Keywords JSON, language, testing, TTCN-3 ETSI 65

2、0 Route des 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

3、.etsi.org/standards-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 differ

4、ence in contents 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 chan

5、ge of status. Information on the current status of this and other ETSI documents is available at https:/portal.etsi.org/TB/ETSIDeliverableStatus.aspx If you find errors in the present document, please send your comment to one of the following services: https:/portal.etsi.org/People/CommiteeSupportSt

6、aff.aspx Copyright Notification 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

7、 of ETSI. The copyright and the foregoing restriction extend to reproduction in all media. ETSI 2018. All rights reserved. DECTTM, PLUGTESTSTM, UMTSTMand the ETSI logo are trademarks of ETSI registered for the benefit of its Members. 3GPPTM and LTETMare trademarks of ETSI registered for the benefit

8、of its Members and of the 3GPP Organizational Partners. oneM2M logo is protected for the benefit of its Members. GSMand the GSM logo are trademarks registered and owned by the GSM Association. ETSI ETSI ES 201 873-11 V4.8.1 (2018-05)3 Contents Intellectual Property Rights 5g3Foreword . 5g3Modal verb

9、s terminology 5g31 Scope 6g32 References 6g32.1 Normative references 6g32.2 Informative references . 6g33 Definitions and abbreviations . 7g33.1 Definitions . 7g33.2 Abbreviations 7g34 Introduction 8g35 Conformance and compatibility . 8g36 Using TTCN-3 as JSON Schema . 9g36.1 Approach . 9g36.2 Valid

10、ation of JSON Values . 9g36.3 Name conversion rules 9g36.4 Mapping of JSON Values 10g36.4.1 JSON Numbers 10g36.4.2 JSON Strings . 10g36.4.3 JSON Arrays 12g36.4.4 JSON Objects. 13g36.4.5 JSON Literals. 15g37 Using JSON to exchange data between TTCN-3 and other systems . 15g37.1 General rules . 15g37.

11、2 JSON representations of TTCN-3 values 16g37.2.1 Character strings 16g37.2.2 Binary Strings 17g37.2.3 Integer 17g37.2.4 Float . 17g37.2.5 Boolean 18g37.2.6 Enumerated 18g37.2.7 Verdicttype 18g37.2.8 Record and set 19g37.2.9 Record of, set of and arrays . 20g37.2.10 Union and anytype . 20g37.2.11 Ob

12、ject Identifiers . 21g38 JSON representations of TTCN-3 values based on ASN.1 types . 22g38.1 General rules . 22g38.2 Character strings 22g38.3 Binary strings 22g38.4 BOOLEAN 22g38.5 ENUMERATED . 22g38.6 REAL 23g38.7 INTEGER 23g38.8 OBJID . 23g38.9 NULL 23g38.10 SEQUENCE and SET . 23g38.11 SEQUENCE

13、OF and SET OF . 23g38.12 CHOICE and Open Types . 23g3Annex A (normative): TTCN-3 module JSON 24g3ETSI ETSI ES 201 873-11 V4.8.1 (2018-05)4 Annex B (normative): Encoding instructions 26g3B.1 General . 26g3B.2 The JSON encode attribute . 26g3B.3 Encoding instructions . 26g3B.3.1 General rules . 26g3B.

14、3.2 JSON type identification . 27g3B.3.3 Normalizing JSON Values 27g3B.3.4 Name as . 27g3B.3.5 Number of fraction digits 28g3B.3.6 Use the Minus sign 29g3B.3.7 Escape as . 29g3B.3.8 Omit as null . 30g3B.3.9 Default . 30g3B.3.10 As value . 31g3B.3.11 No Type . 31g3B.3.12 Use order . 31g3B.3.13 Error

15、behaviour . 32g3Annex C (informative): Bibliography . 33g3History 34g3ETSI ETSI ES 201 873-11 V4.8.1 (2018-05)5 Intellectual Property Rights Essential patents IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The information pertaining to these essenti

16、al 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 potentially Essential, IPRs notified to ETSI in respect of ETSI standards“, which is available from the ETSI Secretariat. Latest updates a

17、re available on the ETSI Web server (https:/ipr.etsi.org/). Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. 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) w

18、hich are, or may be, or may become, essential to the present document. Trademarks The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners. ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, an

19、d conveys no right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks. Foreword This ETSI Standard (ES) has been produced by ETSI Te

20、chnical Committee Methods for Testing and Specification (MTS). The present document is part 11 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“, “wi

21、ll“, “will not“, “can“ and “cannot“ 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. ETSI ETSI ES 201 873-11 V4.8.1 (2018-05)6 1

22、 Scope The present document specifies the rules to define schemas for JSON data structures in TTCN-3, to enable testing of JSON-based systems, interfaces and protocols, and the conversion rules between TTCN-3 1 and JSON 2 to enable exchanging TTCN-3 data in JSON format between different systems. 2 R

23、eferences 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-specific references, the latest version of the referenced document (includin

24、g any amendments) applies. Referenced documents which are not found to be publicly available in the expected location might be found at https:/docbox.etsi.org/Reference/. NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee their long term v

25、alidity. 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 Core Language“. 2 IETF RFC 7159: “The JavaScript Object Notation (

26、JSON) Data Interchange Format“. NOTE: Available at http:/www.rfc-editor.org/rfc/rfc7159.txt. 3 ISO/IEC 10646:2017: “Information technology - Universal Coded Character Set (UCS)“. NOTE: Available at https:/www.iso.org/standard/69119.html. 4 IEEE 754TM: “IEEE Standard for Floating-Point Arithmetic“. 5

27、 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 TTCN-3“. 2.2 Informative references References are either specific (identified by date of publication and/or edition number or version number) or non-specific.

28、For specific references, only the cited version applies. For non-specific references, the latest version of the referenced 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 vali

29、dity. The following 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 IETF draft-handrews-json-schema-validation-00: “JSON Schema Validation: A Vocabulary for Structural Validation of JSON“. NOTE:

30、 Available at https:/datatracker.ietf.org/doc/draft-handrews-json-schema. i.2 World Wide Web Consortium W3C Recommendation: “W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures“. NOTE: Available at http:/www.w3.org/TR/xmlschema11-1. ETSI ETSI ES 201 873-11 V4.8.1 (2018-05)7 i.3 World Wid

31、e Web Consortium W3C Recommendation: “W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes“. NOTE: Available at http:/www.w3.org/TR/xmlschema11-2. i.4 ETSI ES 201 873-8: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 8: The IDL to TTCN-3

32、 Mapping“. i.5 ETSI ES 201 873-9: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 9: Using XML schema with TTCN-3“. i.6 ETSI ES 202 781: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language

33、Extensions: Configuration and Deployment Support“. i.7 ETSI ES 202 782: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: TTCN-3 Performance and Real Time Testing“. i.8 ETSI ES 202 784: “Methods for Testing and Specification (M

34、TS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: Advanced Parameterization“. i.9 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.10 ETSI ES 202 786: “Metho

35、ds for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: Support of interfaces with continuous signals“. i.11 ETSI ES 202 789: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Ex

36、tensions: Extended TRI“. 3 Definitions and abbreviations 3.1 Definitions For the purposes of the present document, the terms and definitions given in ETSI ES 201 873-1 1 apply. 3.2 Abbreviations For the purposes of the present document, the following abbreviations apply: ASN.1 Abstract Syntax Notati

37、on One IO ASN.1 Information Object JSON JavaScript Object Notation SUT System Under Test TTCN-3 Testing and Test Control Notation version 3 UCS Universal Coded Character Set USI UCS Sequence Identifier UTF-8 Unicode Transformation Format-8 XML eXtensible Markup Language XSD XML Schema Definition ETS

38、I ETSI ES 201 873-11 V4.8.1 (2018-05)8 4 Introduction An increasing number of distributed applications use the JSON to exchange data for various purposes like data bases queries or updates or event telecommunications operations such as provisioning. The JSON specification 2 defines the syntax and en

39、coding for JSON types and defined literals, but no semantics is defined. JSON does not have a schema specification, like the XML Schema Definition Language used for XML documents (see i.2 and i.3). NOTE: Though an IETF draft proposal exists for JSON structural validation (see i.1), it has not reache

40、d the RFC status. 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 operational semantics. Other parts of the ETSI ES 201 873 series are defining its use with other specification languages like ASN.1 5, IDL i.4, or XSD i.5 as sh

41、own in figure 1, while other documents as ETSI ES 202 781 i.6, ETSI ES 202 782 i.7, ETSI ES 202 784 i.8, ETSI ES 202 785 i.9, ETSI ES 202 786 i.10 and ETSI ES 202 789 i.11 specify language extensions and thus can define additional rules to the JSON/TTCN-3 mapping defined in the present document. Oth

42、er presentation formats as defined in other parts of the standard or user-specific formats TTCN-3 Core Language TTCN-3 User JSON Types for example, the TTCN-3 system receiving contents of messages to be sent to an SUT, encode and send a message, receive and process the response and report the result

43、 to the other system. Consequently, there is a need to specify mappings between JSON and TTCN-3 for the above purposes. 5 Conformance and compatibility For an implementation claiming to support the use of TTCN-3 as a JSON schema language, all features specified in clause 6 of the present document sh

44、all be implemented consistently with the requirements given in clause 6 and Annex B of the present document and in ETSI ES 201 873-1 1. For an implementation claiming to support the exchange of TTCN-3-based data between systems, and not supporting using ASN.1 with TTCN-3, all features specified in c

45、lause 7 of the present document, with the exception of the mapping of the objid type in clause 7.2.11 shall be implemented consistently with the requirements given in clause 7 and Annex B of the present document and in ETSI ES 201 873-1 1. Implementations claiming the support of using ASN.1 with TTC

46、N-3, shall in addition support features in clause 7.2.11 and clause 8 of the present document. The language mappings presented in the present document is compatible to: ETSI ES 201 873-1 1, version 4.9.1. ETSI ETSI ES 201 873-11 V4.8.1 (2018-05)9 If later versions of those parts are available and sh

47、ould be used instead, the compatibility of the rules presented in the present document shall be checked individually. 6 Using TTCN-3 as JSON Schema 6.1 Approach JSON 2 defines a limited set of JSON types and literal values. The clauses below define the TTCN-3 types that can be used to specify a Sche

48、ma for any JSON interface specification. The TTCN-3 types defined in the clauses below will allow to use the same set of values as JSON permits. Annex A provides a TTCN-3 module containing all TTCN-3 definitions specified in these clauses. The JSON module in Annex A shall either explicitly be presen

49、t in TTCN-3 test suites or TTCN-3 tools shall support these types implicitly. This is left as a tool implementation option. JSON in many cases allows different encoding options for the same value. These may be controlled by the JSON encoding instructions specified in Annex B. JSON encoding instructions may be added to TTCN-3 types and fields by using TTCN-3 variant attributes (see ETSI ES 201 873-1 1, clause 27.5). 6.2 Validation of JSON Values For further study. 6.3 Name conversion rule

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 标准规范 > 国际标准 > 其他

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1