1 /******************************************************************************
2 * Copyright (c) 2000-2014 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 ******************************************************************************/
10 import from AnnexB1 all;
11 import from Flattener { function all }
13 modulepar boolean AnnexB1Template_verbose := false;
14 #define verbose AnnexB1Template_verbose
16 #include "../macros.ttcnin"
18 template Shiporder t_Shiporder:={
19 orderid:="18920320_17",
20 orderperson:="Dr.Watson",
23 name:="Sherlock Holmes",
24 address_1:="Baker Street 221B",
33 price:=10632191074844.699219 // U.S. national debt
39 DECLARE_EXER_ENCODERS(Shiporder, shp)
40 DECLARE_XER_ENCODERS(Shiporder, shp)
42 const universal charstring expected :=
43 //"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" &
44 "<shiporder orderid='18920320_17'>\n" &
45 "\t<orderperson>Dr.Watson</orderperson>\n" &
47 "\t\t<name>Sherlock Holmes</name>\n" &
48 "\t\t<address>Baker Street 221B</address>\n" &
49 "\t\t<city>London</city>\n" &
50 "\t\t<country>England</country>\n" &
53 "\t\t<title>Memoirs</title>\n" &
54 "\t\t<quantity>2</quantity>\n" &
55 "\t\t<price>10632191074844.699219</price>\n" &
60 const universal charstring expected_basic :=
61 //"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" &
63 "\t<orderid>18920320_17</orderid>\n" &
64 "\t<orderperson>Dr.Watson</orderperson>\n" &
66 "\t\t<name>Sherlock Holmes</name>\n" &
67 "\t\t<address_1>Baker Street 221B</address_1>\n" &
68 "\t\t<city>London</city>\n" &
69 "\t\t<country>England</country>\n" &
72 "\t\t<title>Memoirs</title>\n" &
73 "\t\t<quantity>2</quantity>\n" &
74 "\t\t<price>1.063219e+13</price>\n" &
79 testcase encode_order() runs on air
81 CHECK_METHOD(exer_enc_shp, valueof(t_Shiporder), expected);
82 CHECK_METHOD(bxer_enc_shp, valueof(t_Shiporder), expected_basic);
85 testcase decode_order() runs on air
87 CHECK_DECODE(exer_dec_shp, expected , Shiporder, t_Shiporder);
88 CHECK_DECODE(exer_dec_shp, flatten(expected), Shiporder, t_Shiporder);
89 CHECK_DECODE(bxer_dec_shp, expected_basic , Shiporder, t_Shiporder);
93 execute(encode_order())