Titan Core Initial Contribution
[deliverable/titan.core.git] / regression_test / XML / TTCNandXML / AnnexB1Template.ttcnpp
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 ******************************************************************************/
8 module AnnexB1Template
9 {
10 import from AnnexB1 all;
11 import from Flattener { function all }
12
13 modulepar boolean AnnexB1Template_verbose := false;
14 #define verbose AnnexB1Template_verbose
15
16 #include "../macros.ttcnin"
17
18 template Shiporder t_Shiporder:={
19 orderid:="18920320_17",
20 orderperson:="Dr.Watson",
21 shipto:=
22 {
23 name:="Sherlock Holmes",
24 address_1:="Baker Street 221B",
25 city:="London",
26 country:="England"
27 },
28 item:=
29 {
30 title:="Memoirs",
31 note:= omit,
32 quantity:=2,
33 price:=10632191074844.699219 // U.S. national debt
34 }
35 }
36
37 type component air {}
38
39 DECLARE_EXER_ENCODERS(Shiporder, shp)
40 DECLARE_XER_ENCODERS(Shiporder, shp)
41
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" &
46 "\t<shipto>\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" &
51 "\t</shipto>\n" &
52 "\t<item>\n" &
53 "\t\t<title>Memoirs</title>\n" &
54 "\t\t<quantity>2</quantity>\n" &
55 "\t\t<price>10632191074844.699219</price>\n" &
56 "\t</item>\n" &
57 "</shiporder>\n" &
58 "\n";
59
60 const universal charstring expected_basic :=
61 //"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" &
62 "<Shiporder>\n" &
63 "\t<orderid>18920320_17</orderid>\n" &
64 "\t<orderperson>Dr.Watson</orderperson>\n" &
65 "\t<shipto>\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" &
70 "\t</shipto>\n" &
71 "\t<item>\n" &
72 "\t\t<title>Memoirs</title>\n" &
73 "\t\t<quantity>2</quantity>\n" &
74 "\t\t<price>1.063219e+13</price>\n" &
75 "\t</item>\n" &
76 "</Shiporder>\n" &
77 "\n";
78
79 testcase encode_order() runs on air
80 {
81 CHECK_METHOD(exer_enc_shp, valueof(t_Shiporder), expected);
82 CHECK_METHOD(bxer_enc_shp, valueof(t_Shiporder), expected_basic);
83 }
84
85 testcase decode_order() runs on air
86 {
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);
90 }
91
92 control {
93 execute(encode_order())
94 }
95
96 }//end module
97
This page took 0.03323 seconds and 5 git commands to generate.