Commit | Line | Data |
---|---|---|
970ed795 | 1 | /****************************************************************************** |
3abe9331 | 2 | * Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
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 | ||
9 | //========================================================================= | |
10 | // References: (XSD_0) XML Schema Part 0: Primer Second Edition | |
11 | // (XSD_1) XML Schema Part 1: Structures Second Edition | |
12 | // (XSD_2) XML Schema Part 2: Datatypes Second Edition | |
13 | // (ETSI_9) ETSI ES 201 873-9 V4.1.2, The Testing and Test Control Notation version 3; | |
14 | // Part 9: Using XML schema with TTCN-3 | |
15 | // Last modified: 2013-12-02 by ethbaat | |
16 | // Temporarily commented out: tc_complex_import_withSL_encDec fails on some platforms because of TR:HR88527 | |
17 | ||
18 | module xmlTest_Testcases | |
19 | { | |
20 | ||
21 | //========================================================================= | |
22 | // Import Part | |
23 | //========================================================================= | |
24 | //import from XSD all; | |
25 | import from PIPEasp_Types all; | |
26 | import from PIPEasp_PortType all; | |
27 | import from PIPEasp_Templates all; | |
28 | import from xmlTest_Shell all; | |
29 | ||
30 | import from www_XmlTest_org_element_anyType_e all; | |
31 | import from www_XmlTest_org_complex_all_e all; | |
32 | import from www_XmlTest_org_complex_extension_e all; | |
33 | import from www_XmlTest_org_complex_restriction_e all; | |
34 | import from www_XmlTest_org_complex_import_e all; | |
35 | import from www_XmlTest_org_complex_any_e all; | |
36 | ||
37 | import from xmlTest_Functions_string all; | |
38 | import from xmlTest_Functions_complex1 all; | |
39 | import from xmlTest_Functions_complex2 all; | |
40 | import from xmlTest_Functions_complex all; | |
41 | import from xmlTest_Functions_element all; | |
42 | import from xmlTest_Functions_list all; | |
43 | ||
44 | ||
45 | //========================================================================= | |
46 | // Module Parameters | |
47 | //========================================================================= | |
48 | ||
49 | // Insert module parameters here if applicable! | |
50 | // You can use the module_param skeleton! | |
51 | ||
52 | //========================================================================= | |
53 | // Data Types | |
54 | //========================================================================= | |
55 | ||
56 | // Insert data type defintions here if applicable! | |
57 | // You can use the data_type skeleton! | |
58 | ||
59 | //========================================================================= | |
60 | // Signatures | |
61 | //========================================================================= | |
62 | ||
63 | // Insert signature definitions here if applicable! | |
64 | // You can use the signature skeleton! | |
65 | ||
66 | //========================================================================= | |
67 | //Port Types | |
68 | //========================================================================= | |
69 | ||
70 | // Insert port type defintions here if applicable! | |
71 | // You can use the port_type skeleton! | |
72 | ||
73 | //========================================================================= | |
74 | //Component Types | |
75 | //========================================================================= | |
76 | ||
77 | type component xmlTest_CT extends Shell_CT {} | |
78 | ||
79 | type component mtc_CT {} | |
80 | //========================================================================= | |
81 | // Constants | |
82 | //========================================================================= | |
83 | ||
84 | ||
85 | //========================================================================= | |
86 | // Templates | |
87 | //========================================================================= | |
88 | ||
89 | // Insert templates here if applicable! | |
90 | // You can use the template skeleton! | |
91 | ||
92 | //========================================================================= | |
93 | // Altsteps | |
94 | //========================================================================= | |
95 | ||
96 | // Insert altsteps here if applicable! | |
97 | // You can use the altstep skeleton! | |
98 | ||
99 | //========================================================================= | |
100 | // Functions | |
101 | //========================================================================= | |
102 | ||
103 | //========================================================================= | |
104 | // f_countDelimiters | |
105 | //========================================================================= | |
106 | function f_countDelimiters(in charstring pl_string, in charstring pl_delimiter, inout integer pl_counter) { | |
107 | pl_counter:=0; | |
108 | var integer pos:=0; | |
109 | var integer vl_size:=lengthof(pl_string); | |
110 | var integer vl_delimsize:=lengthof(pl_delimiter); | |
111 | while(pos<vl_size) { | |
112 | if( substr(pl_string,pos,vl_delimsize)==pl_delimiter) { pl_counter:=pl_counter+1} | |
113 | pos:=pos+1; | |
114 | } | |
115 | }//f_ | |
116 | ||
117 | //========================================================================= | |
118 | // f_compareFiles | |
119 | //========================================================================= | |
120 | //pl_diffLimit: upper limit of acceptable diff lines. 4 means one acceptable difference | |
121 | function f_compareFiles(in charstring pl_file1, in charstring pl_file2, in integer pl_diffLimit) runs on xmlTest_CT { | |
122 | var integer vl_expectedResult:=0 | |
123 | if(pl_diffLimit>0) { vl_expectedResult:=256; } | |
124 | var boolean vl_success:=false; | |
125 | f_shell_command("diff -w " & pl_file1 & " " & pl_file2,"",vl_expectedResult,vl_success); | |
126 | ||
127 | if(v_ASP_PResult.code==0) | |
128 | { | |
129 | setverdict(pass); | |
130 | } | |
131 | else if(v_ASP_PResult.code==256) { | |
132 | var integer vl_counter:=0; | |
133 | f_countDelimiters(v_ASP_PResult.stdout,"\n",vl_counter); | |
134 | log("Counted lines: ",vl_counter, " diffLimit: ", pl_diffLimit) | |
135 | if(vl_counter>pl_diffLimit) { | |
136 | setverdict(fail); | |
137 | } | |
138 | } else { //e.g 512: No such file or directory | |
139 | log("Wrong result code: ",v_ASP_PResult.code, " Expected result code: ", vl_expectedResult) | |
140 | setverdict(fail); | |
141 | } | |
142 | }//f_ | |
143 | ||
144 | ||
145 | //========================================================================= | |
146 | // Testcases | |
147 | //========================================================================= | |
148 | testcase tc_versionTest() runs on xmlTest_CT | |
149 | { | |
150 | f_shellCommandWithVerdict("compiler -v","",0) | |
151 | } | |
152 | ||
153 | testcase tc_xsd2ttcn_versionTest() runs on xmlTest_CT | |
154 | { | |
155 | f_shellCommandWithVerdict("xsd2ttcn -v","",0) | |
156 | } | |
157 | ||
158 | //simple records | |
159 | testcase tc_firstTrial() runs on xmlTest_CT | |
160 | { | |
3abe9331 | 161 | f_shellCommandWithVerdict("xsd2ttcn elements.xsd","",c_shell_successWithoutWarningAndError) |
970ed795 EL |
162 | } |
163 | ||
164 | // see http://www.w3.org/TR/xmlschema-0/ 2.1 The Purchase Order Schema | |
165 | // This tc is "passed" but it is generated into noTargetNaespace.ttcn | |
166 | testcase tc_secondTrial() runs on xmlTest_CT | |
167 | { | |
168 | f_shellCommandWithVerdict("xsd2ttcn po.xsd noTargetNamespace.xsd","",c_shell_successWithoutWarningAndError) | |
169 | } | |
170 | testcase tc_empty() runs on xmlTest_CT | |
171 | { | |
172 | f_shellCommandWithVerdict("xsd2ttcn empty.xsd","",c_shell_successWithoutWarningAndError); | |
173 | ||
174 | if(getverdict==pass) { | |
175 | f_compareFiles( | |
176 | "www_XmlTest_org_empty_e.ttcn","www_XmlTest_org_empty.ttcn", c_numOfDiff_headerAndModuleName); | |
177 | } | |
178 | } | |
179 | ||
180 | testcase tc_annotation() runs on xmlTest_CT | |
181 | { | |
3abe9331 | 182 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_annotation.xsd","",c_shell_successWithWarning); |
970ed795 EL |
183 | if(getverdict==pass) { |
184 | f_compareFiles( | |
185 | "www_XmlTest_org_annotation_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
186 | } | |
187 | } | |
188 | ||
189 | testcase tc_annotation1() runs on xmlTest_CT | |
190 | { | |
191 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_annotation1.xsd","",c_shell_successWithoutWarningAndError); | |
192 | } | |
193 | ||
194 | testcase tc_annotation2() runs on xmlTest_CT | |
195 | { | |
196 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_annotation2.xsd","",c_shell_error); | |
197 | } | |
198 | ||
3abe9331 | 199 | testcase tc_xml_in_annotation() runs on xmlTest_CT |
200 | { | |
201 | f_shellCommandWithVerdict("xsd2ttcn xml_in_annotation.xsd","",c_shell_successWithoutWarningAndError); | |
202 | if(getverdict==pass) { | |
203 | f_compareFiles( | |
204 | "www_example_org_xml_in_annotation_e.ttcn","www_example_org_xml_in_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
205 | } | |
206 | } | |
207 | ||
970ed795 EL |
208 | //Incorrect version: 1.1 |
209 | testcase tc_version() runs on xmlTest_CT | |
210 | { | |
211 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_version.xsd","",c_shell_successWithWarning); | |
212 | } | |
213 | ||
214 | //************************************ | |
215 | // === Converter switch tests: === | |
216 | //************************************ | |
217 | // usage: xsd2ttcn [-cepstVwx] [-f file] schema.xsd ... | |
218 | // or xsd2ttcn -v | |
219 | // | |
220 | // OPTIONS: | |
221 | // -c: disable the generation of comments in TTCN-3 modules | |
222 | // -e: disable the generation of encoding instructions in TTCN-3 modules | |
223 | // -f file: the XSD files are taken from file instead of the command line | |
224 | // -p: do not generate the UsefulTtcn3Types and XSD predefined modules | |
225 | // -q: quiet - disable the issue of status messages | |
226 | // -s: parse and validate only - no TTCN-3 module generation | |
227 | // -t: disable the generation of timing information in TTCN-3 modules | |
228 | // -v: show version information | |
229 | // -w: suppress warnings | |
230 | // -x: disable schema validation but generate TTCN-3 modules | |
231 | ||
232 | //TODO:Not ready yet | |
233 | testcase tc_options_c() runs on xmlTest_CT | |
234 | { | |
3abe9331 | 235 | f_shellCommandWithVerdict("xsd2ttcn -c XmlTest_annotation.xsd","",c_shell_successWithWarning ); |
970ed795 EL |
236 | if(getverdict==pass) { |
237 | f_compareFiles("www_XmlTest_org_annotation_c_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
238 | } | |
239 | } | |
240 | ||
241 | // -e: disable the generation of encoding instructions in TTCN-3 modules | |
242 | testcase tc_options_e() runs on xmlTest_CT | |
243 | { | |
3abe9331 | 244 | f_shellCommandWithVerdict("xsd2ttcn -e XmlTest_annotation.xsd","",c_shell_successWithWarning ); |
970ed795 EL |
245 | if(getverdict==pass) { |
246 | f_compareFiles("www_XmlTest_org_annotation_e_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
247 | } | |
248 | } | |
249 | ||
250 | // -f file: the XSD files are taken from file instead of the command line | |
251 | testcase tc_options_f() runs on xmlTest_CT | |
252 | { | |
3abe9331 | 253 | f_shellCommandWithVerdict("xsd2ttcn -f XmlTest_files1.txt","",c_shell_successWithWarning ); |
970ed795 EL |
254 | if(getverdict==pass) { |
255 | f_compareFiles("www_XmlTest_org_annotation_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
256 | } | |
257 | } | |
258 | ||
3abe9331 | 259 | testcase tc_options_g() runs on xmlTest_CT |
260 | { | |
261 | f_shellCommandWithVerdict("xsd2ttcn -g dont_generate_element_substitution.xsd","",c_shell_successWithoutWarningAndError ); | |
262 | if(getverdict==pass) { | |
263 | f_compareFiles("www_example_org_dont_generate_element_substitution_e.ttcn", | |
264 | "www_example_org_dont_generate_element_substitution.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
265 | } | |
266 | ||
267 | f_shellCommandWithVerdict("xsd2ttcn generate_element_substitution.xsd","",c_shell_successWithoutWarningAndError ); | |
268 | if(getverdict==pass) { | |
269 | f_compareFiles("www_example_org_generate_element_substitution_e.ttcn", | |
270 | "www_example_org_generate_element_substitution.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
271 | } | |
272 | } | |
273 | ||
970ed795 EL |
274 | //TODO: more filename in XmlTest_files2.txt |
275 | // testcase tc_options_f() runs on xmlTest_CT | |
276 | // { | |
277 | // f_shellCommandWithVerdict("xsd2ttcn -f XmlTest_files1.txt","",c_shell_successWithoutWarningAndError ); | |
278 | // if(getverdict==pass) { | |
279 | // f_compareFiles("www_XmlTest_org_annotation_e.ttcn)","www_XmlTest_org_annotation.ttcn)", c_numOfDiff_headerModNameAndNamespace); | |
280 | // } | |
281 | // } | |
282 | ||
283 | //-p: do not generate the UsefulTtcn3Types and XSD predefined modules | |
284 | testcase tc_options_p() runs on xmlTest_CT | |
285 | { | |
286 | f_shellCommandWithVerdict("mv www_XmlTest_org_annotation.ttcn tmp_www_XmlTest_org_annotation.ttcn","",c_shell_successWithoutWarningAndError ); | |
287 | f_shellCommandWithVerdict("mv XSD.ttcn tmp_XSD.ttcn","",c_shell_successWithoutWarningAndError ); | |
288 | f_shellCommandWithVerdict("mv UsefulTtcn3Types.ttcn tmp_UsefulTtcn3Types.ttcn","",c_shell_successWithoutWarningAndError ); | |
289 | ||
3abe9331 | 290 | f_shellCommandWithVerdict("xsd2ttcn -p XmlTest_annotation.xsd","",c_shell_successWithWarning ); |
970ed795 EL |
291 | if(getverdict==pass) { |
292 | f_shellCommandWithVerdict("ls www_XmlTest_org_annotation.ttcn", "",c_shell_successWithoutWarningAndError); | |
293 | f_shellCommandWithVerdict("ls XSD.ttcn", "",c_shell_error_noSuchFileOrDirectory ); | |
294 | f_shellCommandWithVerdict("ls UsefulTtcn3Types.ttcn.ttcn","", c_shell_error_noSuchFileOrDirectory ); | |
295 | } | |
296 | ||
297 | f_shellCommandWithVerdict("mv tmp_www_XmlTest_org_annotation.ttcn www_XmlTest_org_annotation.ttcn","",c_shell_successWithoutWarningAndError ); | |
298 | f_shellCommandWithVerdict("mv tmp_XSD.ttcn XSD.ttcn","",c_shell_successWithoutWarningAndError ); | |
299 | f_shellCommandWithVerdict("mv tmp_UsefulTtcn3Types.ttcn UsefulTtcn3Types.ttcn","",c_shell_successWithoutWarningAndError ); | |
300 | } | |
301 | ||
302 | //-s: parse and validate only - no TTCN-3 module generation | |
303 | testcase tc_options_s() runs on xmlTest_CT | |
304 | { | |
305 | f_shellCommandWithVerdict("mv www_XmlTest_org_annotation.ttcn tmp_www_XmlTest_org_annotation.ttcn","",c_shell_successWithoutWarningAndError ); | |
306 | f_shellCommandWithVerdict("mv XSD.ttcn tmp_XSD.ttcn","",c_shell_successWithoutWarningAndError ); | |
307 | f_shellCommandWithVerdict("mv UsefulTtcn3Types.ttcn tmp_UsefulTtcn3Types.ttcn","",c_shell_successWithoutWarningAndError ); | |
308 | ||
309 | f_shellCommandWithVerdict("xsd2ttcn -s XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError ); | |
310 | //TODO:test if wrong xsd causes conversion error wit this switch | |
311 | ||
312 | //test if www_XmlTest_org_annotation.ttcn.ttcn, XSD.ttcn and UsefulTtcn3Types.ttcn exist: | |
313 | if(getverdict==pass) { | |
314 | f_shellCommandWithVerdict("ls www_XmlTest_org_annotation.ttcn", "", c_shell_error_noSuchFileOrDirectory ); | |
315 | f_shellCommandWithVerdict("ls XSD.ttcn", "",c_shell_error_noSuchFileOrDirectory ); | |
316 | f_shellCommandWithVerdict("ls UsefulTtcn3Types.ttcn.ttcn","", c_shell_error_noSuchFileOrDirectory ); | |
317 | } | |
318 | f_shellCommandWithVerdict("mv tmp_www_XmlTest_org_annotation.ttcn www_XmlTest_org_annotation.ttcn","",c_shell_successWithoutWarningAndError ); | |
319 | f_shellCommandWithVerdict("mv tmp_XSD.ttcn XSD.ttcn","",c_shell_successWithoutWarningAndError ); | |
320 | f_shellCommandWithVerdict("mv tmp_UsefulTtcn3Types.ttcn UsefulTtcn3Types.ttcn","",c_shell_successWithoutWarningAndError ); | |
321 | } | |
322 | ||
323 | //Ready | |
324 | // -t: disable the generation of timing information in TTCN-3 modules | |
325 | testcase tc_options_t() runs on xmlTest_CT | |
326 | { | |
3abe9331 | 327 | f_shellCommandWithVerdict("xsd2ttcn -t XmlTest_annotation.xsd","",c_shell_successWithWarning ); |
970ed795 EL |
328 | if(getverdict==pass) { |
329 | f_compareFiles("www_XmlTest_org_annotation_t_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
330 | } | |
331 | } | |
332 | ||
333 | // -v: show version information | |
334 | //TODO:Not ready yet | |
335 | testcase tc_options_v() runs on xmlTest_CT | |
336 | { | |
337 | f_shellCommandWithVerdict("xsd2ttcn -v","",c_shell_successWithoutWarningAndError ); | |
338 | } | |
339 | ||
340 | //TODO:Not ready yet | |
341 | // -q: quiet - disable the issue of status messages | |
342 | testcase tc_options_V() runs on xmlTest_CT | |
343 | { | |
3abe9331 | 344 | f_shellCommandWithVerdict("xsd2ttcn -q XmlTest_annotation.xsd","",c_shell_successWithWarning); |
970ed795 EL |
345 | } |
346 | ||
347 | //TODO:Not ready yet | |
348 | // -w: suppress warnings | |
349 | testcase tc_options_w() runs on xmlTest_CT | |
350 | { | |
351 | f_shellCommandWithVerdict("xsd2ttcn -w XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError ); | |
352 | } | |
353 | ||
354 | //TODO:Not ready yet | |
355 | // -x: disable schema validation but generate TTCN-3 modules | |
356 | testcase tc_options_x() runs on xmlTest_CT | |
357 | { | |
3abe9331 | 358 | f_shellCommandWithVerdict("xsd2ttcn -x XmlTest_annotation.xsd","",c_shell_successWithWarning); |
970ed795 EL |
359 | } |
360 | ||
361 | testcase tc_options_wrong() runs on xmlTest_CT | |
362 | { | |
363 | f_shellCommandWithVerdict("xsd2ttcn -H XmlTest_annotation.xsd","", c_shell_error); | |
364 | } | |
365 | ||
366 | testcase tc_options_missing() runs on xmlTest_CT | |
367 | { | |
368 | f_shellCommandWithVerdict("xsd2ttcn ","",c_shell_successWithoutWarningAndError ); | |
369 | //TODO: check the output | |
370 | } | |
371 | ||
372 | ||
373 | testcase tc_XmlTest_label() runs on xmlTest_CT | |
374 | { | |
375 | f_shellCommandWithVerdict("xsd2ttcn -x XmlTest_label.xsd","",c_shell_successWithoutWarningAndError ); | |
376 | } | |
377 | ||
378 | testcase tc_XmlTest_definition() runs on xmlTest_CT | |
379 | { | |
380 | f_shellCommandWithVerdict("xsd2ttcn -x XmlTest_definition.xsd","",c_shell_successWithoutWarningAndError ); | |
381 | } | |
382 | //************************************ | |
383 | // Testcases_basedOnTtcnStandard9 | |
384 | //************************************ | |
385 | group Testcases_basedOnTtcnStandard9 { | |
386 | ||
387 | //Passed | |
388 | testcase tc_XmlTest_all() runs on xmlTest_CT | |
389 | { | |
390 | f_shellCommandWithVerdict("xsd2ttcn all.xsd","",c_shell_successWithoutWarningAndError); | |
3abe9331 | 391 | if(getverdict==pass) { |
392 | f_compareFiles( | |
393 | "www_example_org_all_e.ttcn","www_example_org_all.ttcn", c_numOfDiff_headerAndModuleName); | |
394 | } | |
395 | } | |
396 | ||
397 | testcase tc_element_in_all_neg() runs on xmlTest_CT | |
398 | { | |
399 | f_shellCommandWithVerdict("xsd2ttcn element_in_all_minmax.xsd","",c_shell_error); | |
970ed795 EL |
400 | } |
401 | ||
402 | //Passed | |
403 | testcase tc_XmlTest_any_anyAttribute() runs on xmlTest_CT | |
404 | { | |
3abe9331 | 405 | f_shellCommandWithVerdict("xsd2ttcn any_anyAttribute.xsd","",c_shell_successWithWarning); |
970ed795 EL |
406 | } |
407 | ||
408 | //HQ73011 | |
409 | //Heading: XSD anyAtribute is inserted into a wrong place | |
410 | //Passed | |
411 | testcase tc_XmlTest_HQ73011() runs on xmlTest_CT | |
412 | { | |
413 | f_shellCommandWithVerdict("xsd2ttcn HQ73011.xsd","",c_shell_successWithoutWarningAndError); | |
414 | if(getverdict==pass) { | |
415 | f_compareFiles( | |
416 | "urn_ietf_params_xml_ns_conference_info_e.ttcn","urn_ietf_params_xml_ns_conference_info.ttcn", c_numOfDiff_headerAndModuleName); | |
417 | } | |
418 | } | |
419 | ||
3abe9331 | 420 | testcase tc_anyattribute_optional() runs on xmlTest_CT |
421 | { | |
422 | f_shellCommandWithVerdict("xsd2ttcn anyattribute_optional.xsd","",c_shell_successWithoutWarningAndError); | |
423 | if(getverdict==pass) { | |
424 | f_compareFiles( | |
425 | "http_www_example_org_wildcards_e.ttcn","http_www_example_org_wildcards.ttcn", c_numOfDiff_headerAndModuleName); | |
426 | } | |
427 | } | |
428 | ||
429 | testcase tc_anyattribute_single() runs on xmlTest_CT | |
430 | { | |
431 | f_shellCommandWithVerdict("xsd2ttcn anyattrib_single.xsd","",c_shell_successWithoutWarningAndError); | |
432 | if(getverdict==pass) { | |
433 | f_compareFiles( | |
434 | "www_example_org_anyattrib_single_e.ttcn","www_example_org_anyattrib_single.ttcn", c_numOfDiff_headerAndModuleName); | |
435 | } | |
436 | } | |
437 | ||
438 | testcase tc_anyattribute_in_complex() runs on xmlTest_CT | |
439 | { | |
440 | f_shellCommandWithVerdict("xsd2ttcn anyattr_in_complex.xsd","",c_shell_successWithoutWarningAndError); | |
441 | if(getverdict==pass) { | |
442 | f_compareFiles( | |
443 | "www_example_org_anyattr_in_complex_e.ttcn","www_example_org_anyattr_in_complex.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
444 | } | |
445 | } | |
446 | ||
447 | ||
970ed795 EL |
448 | //Passed |
449 | testcase tc_XmlTest_attributeGroup() runs on xmlTest_CT | |
450 | { | |
451 | f_shellCommandWithVerdict("xsd2ttcn attributeGroup.xsd","",c_shell_successWithoutWarningAndError); | |
452 | } | |
453 | ||
454 | //double schema definition - Validator Returns with Error, Passed | |
455 | testcase tc_XmlTest_attribute_use_noTNS() runs on xmlTest_CT | |
456 | { | |
457 | f_shellCommandWithVerdict("xsd2ttcn attribute_use_noTNS.xsd","",c_shell_error); | |
458 | } | |
459 | ||
3abe9331 | 460 | testcase tc_id_attribute() runs on xmlTest_CT |
461 | { | |
462 | f_shellCommandWithVerdict("xsd2ttcn id_attrib.xsd","",c_shell_successWithWarning); | |
463 | if(getverdict==pass) { | |
464 | f_compareFiles( | |
465 | "www_example_org_id_attrib_e.ttcn", "www_example_org_id_attrib.ttcn", c_numOfDiff_headerAndModuleName); | |
466 | } | |
467 | } | |
468 | ||
469 | testcase tc_attribute_order() runs on xmlTest_CT | |
470 | { | |
471 | f_shellCommandWithVerdict("xsd2ttcn attrib_order_a.xsd attrib_order_b.xsd attrib_order_c.xsd","",c_shell_successWithoutWarningAndError); | |
472 | if(getverdict==pass) { | |
473 | f_compareFiles( | |
474 | "www_example_org_attrib_order_a_e.ttcn", "www_example_org_attrib_order_a.ttcn", c_numOfDiff_headerAndModuleName); | |
475 | } | |
476 | ||
477 | if(getverdict==pass) { | |
478 | f_compareFiles( | |
479 | "www_example_org_attrib_order_b_e.ttcn", "www_example_org_attrib_order_b.ttcn", c_numOfDiff_headerAndModuleName); | |
480 | } | |
481 | } | |
482 | ||
483 | testcase tc_name_conv_non_alphanumeric() runs on xmlTest_CT | |
484 | { | |
485 | f_shellCommandWithVerdict("xsd2ttcn name_conv_non_alphanumeric.xsd","",c_shell_successWithoutWarningAndError); | |
486 | if(getverdict==pass) { | |
487 | f_compareFiles( | |
488 | "http_www_example_org_name_conv2_e.ttcn", | |
489 | "http_www_example_org_name_conv2.ttcn", c_numOfDiff_headerAndModuleName); | |
490 | } | |
491 | } | |
492 | ||
493 | testcase tc_module_name_convert_with_diff_namespace() runs on xmlTest_CT { | |
494 | f_shellCommandWithVerdict("xsd2ttcn imported_module.xsd imported_module_.xsd","",c_shell_successWithoutWarningAndError); | |
495 | ||
496 | if(getverdict==pass) { | |
497 | f_compareFiles( | |
498 | "imported_module_e.ttcn","imported_module.ttcn", c_numOfDiff_headerAndModuleName); | |
499 | } | |
500 | ||
501 | if(getverdict==pass) { | |
502 | f_compareFiles( | |
503 | "imported_module_1_e.ttcn","imported_module_1.ttcn", c_numOfDiff_headerAndModuleName); | |
504 | } | |
505 | }//tc_ | |
506 | ||
507 | testcase tc_module_typename_conversion() runs on xmlTest_CT { | |
508 | f_shellCommandWithVerdict("xsd2ttcn module_typename_conversion.xsd module_typename_conversion_1.xsd","",c_shell_successWithoutWarningAndError); | |
509 | ||
510 | if(getverdict==pass) { | |
511 | f_compareFiles( | |
512 | "module_typename_conversion_e.ttcn","module_typename_conversion.ttcn", c_numOfDiff_headerAndModuleName); | |
513 | } | |
514 | ||
515 | if(getverdict==pass) { | |
516 | f_compareFiles( | |
517 | "MyTypes_e.ttcn","MyTypes.ttcn", c_numOfDiff_headerAndModuleName); | |
518 | } | |
519 | }//tc_ | |
520 | ||
521 | testcase tc_name_conv_remove_seq_of_low_line() runs on xmlTest_CT | |
522 | { | |
523 | f_shellCommandWithVerdict("xsd2ttcn name_conv_remove_seq_of_low_line.xsd","", | |
524 | c_shell_successWithoutWarningAndError); | |
525 | if(getverdict==pass) { | |
526 | f_compareFiles( | |
527 | "http_www_example_org_name_conv3_e.ttcn", | |
528 | "http_www_example_org_name_conv3.ttcn", c_numOfDiff_headerAndModuleName); | |
529 | } | |
530 | } | |
531 | ||
532 | testcase tc_name_conv_with_z() runs on xmlTest_CT | |
533 | { | |
534 | f_shellCommandWithVerdict("xsd2ttcn -z name_conv_with_z.xsd","",c_shell_successWithoutWarningAndError); | |
535 | if(getverdict==pass) { | |
536 | f_compareFiles( | |
537 | "www_example_org_name_conv_http_e.ttcn", | |
538 | "www_example_org_name_conv_http.ttcn", c_numOfDiff_headerAndModuleName); | |
539 | } | |
540 | } | |
541 | ||
542 | testcase tc_comment_placement() runs on xmlTest_CT | |
543 | { | |
544 | f_shellCommandWithVerdict("xsd2ttcn comment_placement.xsd","",c_shell_successWithoutWarningAndError); | |
545 | if(getverdict==pass) { | |
546 | f_compareFiles( | |
547 | "www_example_org_comment_placement_e.ttcn", | |
548 | "www_example_org_comment_placement.ttcn", c_numOfDiff_headerAndModuleName); | |
549 | } | |
550 | } | |
551 | ||
970ed795 EL |
552 | }//group |
553 | ||
554 | //************************************ | |
555 | // Testcases based on W3C standards | |
556 | //************************************ | |
557 | ||
558 | //****************************** | |
559 | // StringTest | |
560 | //****************************** | |
561 | group StringTest { | |
562 | ||
563 | //=== Correct string type definitions: ==== | |
564 | //TR HL21086 - whitespace preserve. TODO: standalone testcase | |
565 | testcase tc_string() runs on xmlTest_CT | |
566 | { | |
567 | f_shellCommandWithVerdict("xsd2ttcn -z XmlTest_string.xsd","",c_shell_successWithoutWarningAndError) | |
568 | if(getverdict==pass) { | |
569 | f_compareFiles( | |
570 | "www_XmlTest_org_string.ttcn", | |
571 | "www_XmlTest_org_string_e.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
572 | } | |
573 | //////////////////////////////////////////// | |
574 | // | |
575 | // f_encDecTest_NameA(); | |
576 | // f_encDecTest_NameB(); | |
577 | // f_encDecTest_Non_empty_string(); | |
578 | // f_encDecTest_Type(); | |
579 | // | |
580 | //////////////////////////////////////////// | |
581 | } | |
582 | ||
583 | //Passed, TR: Hl21086 - Solved | |
584 | testcase tc_string_withWhitespace() runs on xmlTest_CT | |
585 | { | |
586 | f_shellCommandWithVerdict("xsd2ttcn -z XmlTest_string_withWhitespace.xsd","",c_shell_successWithoutWarningAndError) | |
587 | if(getverdict==pass) { | |
588 | f_compareFiles( | |
589 | "www_XmlTest_org_string_withWhitespace.ttcn", | |
590 | "www_XmlTest_org_string_withWhitespace_e.ttcn", c_numOfDiff_headerAndModuleName); | |
591 | } | |
592 | f_encDecTest_StringWhiteSpaceP(); | |
593 | f_encDecTest_StringWhiteSpaceR(); | |
594 | f_encDecTest_StringWhiteSpaceC(); | |
595 | } | |
596 | ||
597 | //Passed, TR: HL26227 -Solved BUT rethink if variant part is well ordered or not!! | |
598 | testcase tc_string_withEnum() runs on xmlTest_CT | |
599 | { | |
600 | f_shellCommandWithVerdict("xsd2ttcn -z XmlTest_string_withEnum.xsd","",c_shell_successWithoutWarningAndError) | |
601 | if(getverdict==pass) { | |
602 | f_compareFiles( | |
603 | "www_XmlTest_org_string_withEnum.ttcn", | |
604 | "www_XmlTest_org_string_withEnum_e.ttcn", c_numOfDiff_headerAndModuleName); | |
605 | } | |
606 | f_encDecTest_StringEnum(); | |
607 | } | |
608 | //TODO: Write length of child restriction tests based on tc_string!!! | |
609 | ||
610 | //=== Length restriction tests === | |
611 | ||
612 | ||
613 | ||
614 | //=== Faulty String definitions: ========= | |
615 | ||
616 | //===length=== | |
617 | //TR: HL21257 --Solved | |
618 | testcase tc_string_withPosLength() runs on xmlTest_CT | |
619 | { | |
620 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withPosLength.xsd","",c_shell_successWithoutWarningAndError); | |
621 | if(getverdict==pass) { | |
622 | f_compareFiles( | |
623 | "www_XmlTest_org_string_withPosLength.ttcn", | |
624 | "www_XmlTest_org_string_withPosLength_e.ttcn", c_numOfDiff_headerAndModuleName); | |
625 | } | |
626 | } | |
627 | ||
628 | //Passed, returs with error | |
629 | testcase tc_string_withEmptyLength() runs on xmlTest_CT | |
630 | { | |
631 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withEmptyLength.xsd","",c_shell_error) | |
632 | } | |
633 | ||
634 | testcase tc_string_withNegativeLength() runs on xmlTest_CT | |
635 | { | |
636 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withNegativeLength.xsd","",c_shell_error) | |
637 | } | |
638 | ||
639 | //Passed | |
640 | testcase tc_string_withFixedLength() runs on xmlTest_CT | |
641 | { | |
3abe9331 | 642 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withFixedLength.xsd","",c_shell_error); |
643 | } | |
644 | ||
645 | testcase tc_fixed_value() runs on xmlTest_CT | |
646 | { | |
647 | f_shellCommandWithVerdict("xsd2ttcn fixed_value.xsd","",c_shell_successWithWarning); | |
648 | if(getverdict==pass) { | |
649 | f_compareFiles( | |
650 | "www_example_org_fixed_value.ttcn", | |
651 | "www_example_org_fixed_value_e.ttcn", c_numOfDiff_headerAndModuleName); | |
652 | } | |
970ed795 EL |
653 | } |
654 | ||
655 | //Passed | |
656 | testcase tc_string_withFloatLength() runs on xmlTest_CT | |
657 | { | |
658 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withFloatLength.xsd","", c_shell_error) | |
659 | } | |
660 | ||
661 | //===minLength=== | |
662 | //Passed, TR: HL21690 | |
663 | testcase tc_string_withPosMinLength() runs on xmlTest_CT | |
664 | { | |
665 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withMinLength.xsd","",c_shell_successWithoutWarningAndError) | |
666 | if(getverdict==pass) { | |
667 | f_compareFiles( | |
668 | "www_XmlTest_org_string_withMinLength.ttcn", | |
669 | "www_XmlTest_org_string_withMinLength_e.ttcn", c_numOfDiff_headerAndModuleName); | |
670 | } | |
671 | } | |
672 | ||
673 | //Passed | |
674 | testcase tc_string_withEmptyMin() runs on xmlTest_CT | |
675 | { | |
676 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withEmptyMin.xsd","",c_shell_error) | |
677 | } | |
678 | ||
679 | //Passed | |
680 | testcase tc_string_withNegativeMin() runs on xmlTest_CT | |
681 | { | |
682 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withNegativeMin.xsd","",c_shell_error) | |
683 | } | |
684 | ||
685 | //===maxLength=== | |
686 | //Passed | |
687 | testcase tc_string_withPosMax() runs on xmlTest_CT | |
688 | { | |
689 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withPosMax.xsd","",c_shell_successWithoutWarningAndError); | |
690 | if(getverdict==pass) { | |
691 | f_compareFiles( | |
692 | "www_XmlTest_org_string_withPosMax_e.ttcn","www_XmlTest_org_string_withPosMax.ttcn", c_numOfDiff_headerAndModuleName); | |
693 | } | |
694 | } | |
695 | ||
696 | //Passed | |
697 | testcase tc_string_withEmptyMax() runs on xmlTest_CT | |
698 | { | |
699 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withEmptyMax.xsd","",c_shell_error) | |
700 | } | |
701 | ||
702 | //Passed | |
703 | testcase tc_string_withNegativeMax() runs on xmlTest_CT | |
704 | { | |
705 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withNegativeMax.xsd","",c_shell_error) | |
706 | } | |
707 | //=== minLength>maxLength | |
708 | //Passed, TR: | |
709 | testcase tc_string_withFaultyMinMaxLength() runs on xmlTest_CT | |
710 | { | |
711 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withFaultyMinMax.xsd","",c_shell_error) | |
712 | } | |
713 | //Passed | |
714 | testcase tc_string_withOverDefinition() runs on xmlTest_CT | |
715 | { | |
716 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withOverDefinition.xsd","",c_shell_error) | |
717 | } | |
718 | ||
719 | testcase tc_string_withTypeAndBase() runs on xmlTest_CT | |
720 | { | |
721 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withTypeAndBase.xsd","",c_shell_error) | |
722 | } | |
3abe9331 | 723 | |
724 | //testcase tc_string_pattern_square_brackets() runs on xmlTest_CT | |
725 | //{ | |
726 | // f_shellCommandWithVerdict("xsd2ttcn regex_square_brackets.xsd","",c_shell_successWithoutWarningAndError); | |
727 | // if(getverdict==pass) { | |
728 | // f_compareFiles( | |
729 | // "www_example_org_regex_square_brackets_e.ttcn","www_example_org_regex_square_brackets.ttcn", c_numOfDiff_headerAndModuleName); | |
730 | // } | |
731 | //} | |
970ed795 EL |
732 | }//StringTest |
733 | ||
734 | //****************************** | |
735 | // BooleanTest | |
736 | //****************************** | |
737 | group BooleanTest { | |
738 | ||
739 | //TODO: check warning sending for not supported:features | |
740 | testcase tc_boolean() runs on xmlTest_CT { | |
741 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_boolean.xsd","",c_shell_successWithoutWarningAndError) | |
742 | if(getverdict==pass) { | |
743 | f_compareFiles( | |
744 | "www_XmlTest_org_boolean_e.ttcn","www_XmlTest_org_boolean.ttcn", c_numOfDiff_headerAndModuleName); | |
745 | } | |
746 | } | |
3abe9331 | 747 | |
748 | testcase tc_boolean_variant_commented() runs on xmlTest_CT { | |
749 | f_shellCommandWithVerdict("xsd2ttcn boolean_variant_commented.xsd","",c_shell_successWithoutWarningAndError) | |
750 | if(getverdict==pass) { | |
751 | f_compareFiles( | |
752 | "www_example_org_boolean_variant_commented_e.ttcn", | |
753 | "www_example_org_boolean_variant_commented.ttcn", c_numOfDiff_headerAndModuleName); | |
754 | } | |
755 | } | |
970ed795 EL |
756 | }//BooleanTest |
757 | ||
758 | ||
759 | //****************************** | |
760 | // DecimalTest | |
761 | //****************************** | |
762 | group DecimalTest { | |
763 | ||
764 | //Passed | |
765 | testcase tc_decimal() runs on xmlTest_CT { | |
766 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal.xsd","",c_shell_successWithoutWarningAndError) | |
767 | if(getverdict==pass) { | |
768 | f_compareFiles( | |
769 | "www_XmlTest_org_decimal_e.ttcn", | |
770 | "www_XmlTest_org_decimal.ttcn", c_numOfDiff_headerAndModuleName); | |
771 | } | |
772 | } | |
773 | ||
774 | //!!!!!Length not supported!!!! | |
775 | // testcase tc_decimal_withLength() runs on xmlTest_CT { | |
776 | // f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal_withLength.xsd","",c_shell_successWithoutWarningAndError) | |
777 | // if(getverdict==pass) { | |
778 | // f_compareFiles( | |
779 | // "www_XmlTest_org_decimal_withLength_e.ttcn", | |
780 | // "www_XmlTest_org_decimal_withLength.ttcn", c_numOfDiff_headerAndModuleName); | |
781 | // } | |
782 | // } | |
783 | ||
784 | //TR: Generates integer limits instead of decimal | |
785 | //TR: HL2715 -Solved | |
786 | testcase tc_decimal_withMinMaxInclusive() runs on xmlTest_CT { | |
787 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal_withMinMaxInclusive.xsd","",c_shell_successWithoutWarningAndError) | |
788 | ||
789 | if(getverdict==pass) { | |
790 | f_compareFiles( | |
791 | "www_XmlTest_org_decimal_withMinMaxInclusive_e.ttcn", | |
792 | "www_XmlTest_org_decimal_withMinMaxInclusive.ttcn", c_numOfDiff_headerAndModuleName); | |
793 | } | |
794 | }//tc_ | |
795 | ||
796 | //TR21266 -Solved | |
797 | testcase tc_decimal_withMinMaxExclusive() runs on xmlTest_CT { | |
798 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal_withMinMaxExclusive.xsd","",c_shell_successWithoutWarningAndError) | |
799 | ||
800 | if(getverdict==pass) { | |
801 | f_compareFiles( | |
802 | "www_XmlTest_org_decimal_withMinMaxExclusive_e.ttcn", | |
803 | "www_XmlTest_org_decimal_withMinMaxExclusive.ttcn", c_numOfDiff_headerAndModuleName); | |
804 | } | |
805 | }//tc_ | |
806 | ||
807 | //TR HL21296 | |
808 | testcase tc_decimal_withEnum() runs on xmlTest_CT { | |
809 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal_withEnum.xsd","",c_shell_successWithoutWarningAndError) | |
810 | ||
811 | if(getverdict==pass) { | |
812 | f_compareFiles( | |
813 | "www_XmlTest_org_decimal_withEnum_e.ttcn", | |
814 | "www_XmlTest_org_decimal_withEnum.ttcn", c_numOfDiff_headerAndModuleName); | |
815 | } | |
816 | } | |
3abe9331 | 817 | |
818 | testcase tc_decimal_fractiondigits() runs on xmlTest_CT { | |
819 | f_shellCommandWithVerdict("xsd2ttcn decimal_fractiondigits.xsd","",c_shell_successWithWarning) | |
820 | ||
821 | if(getverdict==pass) { | |
822 | f_compareFiles( | |
823 | "www_example_org_decimal_fractiondigits_e.ttcn", | |
824 | "www_example_org_decimal_fractiondigits.ttcn", c_numOfDiff_headerAndModuleName); | |
825 | } | |
826 | } | |
970ed795 EL |
827 | }//DecimalTest |
828 | ||
829 | //****************************** | |
830 | // IntegerTest | |
831 | // Based on (XSD_2)/3.3.13 and (ETSI_9)/6.1/Table1 | |
832 | //****************************** | |
833 | group IntegerTest { | |
834 | ||
835 | testcase tc_integer() runs on xmlTest_CT { | |
836 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer.xsd","",c_shell_successWithoutWarningAndError) | |
837 | ||
838 | if(getverdict==pass) { | |
839 | f_compareFiles( | |
840 | "www_XmlTest_org_integer_e.ttcn", | |
841 | "www_XmlTest_org_integer.ttcn", c_numOfDiff_headerAndModuleName); | |
842 | } | |
843 | ||
844 | }//tc_ | |
845 | ||
846 | //negative test | |
847 | testcase tc_integer_empty1() runs on xmlTest_CT { | |
848 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_empty1.xsd","",c_shell_error) | |
849 | }//tc_ | |
850 | ||
851 | //negative test | |
852 | testcase tc_integer_withLength() runs on xmlTest_CT { | |
853 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withLength.xsd","",c_shell_error) | |
854 | }//tc_ | |
855 | ||
856 | //Ready, passed, TR:HL21694 -solved | |
857 | testcase tc_integer_withEnum() runs on xmlTest_CT { | |
858 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withEnum.xsd","",c_shell_successWithoutWarningAndError) | |
859 | ||
860 | if(getverdict==pass) { | |
861 | f_compareFiles( | |
862 | "www_XmlTest_org_integer_withEnum_e.ttcn","www_XmlTest_org_integer_withEnum.ttcn", c_numOfDiff_headerAndModuleName); | |
863 | } | |
864 | }//tc_ | |
865 | ||
866 | //Passed | |
867 | testcase tc_integer_withMinIncl() runs on xmlTest_CT { | |
868 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withMinIncl.xsd","",c_shell_successWithoutWarningAndError) | |
869 | ||
870 | if(getverdict==pass) { | |
871 | f_compareFiles( | |
872 | "www_XmlTest_org_integer_withMinIncl_e.ttcn", | |
873 | "www_XmlTest_org_integer_withMinIncl.ttcn",c_numOfDiff_headerAndModuleName); | |
874 | } | |
875 | }//tc_ | |
876 | ||
877 | //Passed | |
878 | testcase tc_integer_withMaxIncl() runs on xmlTest_CT { | |
879 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withMaxIncl.xsd","",c_shell_successWithoutWarningAndError) | |
880 | ||
881 | if(getverdict==pass) { | |
882 | f_compareFiles( | |
883 | "www_XmlTest_org_integer_withMaxIncl_e.ttcn","www_XmlTest_org_integer_withMaxIncl.ttcn", c_numOfDiff_headerAndModuleName); | |
884 | } | |
885 | }//tc_ | |
886 | ||
887 | //Passed | |
888 | testcase tc_integer_withMinExcl() runs on xmlTest_CT { | |
889 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withMinExcl.xsd","",c_shell_successWithoutWarningAndError) | |
890 | ||
891 | if(getverdict==pass) { | |
892 | f_compareFiles( | |
893 | "www_XmlTest_org_integer_withMinExcl_e.ttcn", | |
894 | "www_XmlTest_org_integer_withMinExcl.ttcn", c_numOfDiff_headerAndModuleName); | |
895 | } | |
896 | }//tc_ | |
897 | ||
898 | //Passed | |
899 | testcase tc_integer_withMaxExcl() runs on xmlTest_CT { | |
900 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withMaxExcl.xsd","",c_shell_successWithoutWarningAndError) | |
901 | ||
902 | if(getverdict==pass) { | |
903 | f_compareFiles( | |
904 | "www_XmlTest_org_integer_withMaxExcl_e.ttcn","www_XmlTest_org_integer_withMaxExcl.ttcn", c_numOfDiff_headerAndModuleName); | |
905 | } | |
906 | }//tc_ | |
907 | ||
908 | ||
909 | }//IntegerTest | |
910 | ||
3abe9331 | 911 | |
912 | testcase tc_float_not_a_number() runs on xmlTest_CT { | |
913 | f_shellCommandWithVerdict("xsd2ttcn not_a_number_minex_inf_maxex_-inf.xsd","",c_shell_successWithoutWarningAndError) | |
914 | ||
915 | if(getverdict==pass) { | |
916 | f_compareFiles( | |
917 | "www_example_org_not_a_number_minex_inf_maxex_inf_e.ttcn", | |
918 | "www_example_org_not_a_number_minex_inf_maxex_inf.ttcn", c_numOfDiff_headerAndModuleName); | |
919 | } | |
920 | }//tc_ | |
921 | ||
970ed795 EL |
922 | // |
923 | testcase tc_simpleType_enum() runs on xmlTest_CT { | |
924 | ||
925 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_simple_enum.xsd","",c_shell_successWithoutWarningAndError) | |
926 | ||
927 | if(getverdict==pass) { | |
928 | f_compareFiles( | |
929 | "www_XmlTest_org_simple_enum_e.ttcn","www_XmlTest_org_simple_enum.ttcn", c_numOfDiff_headerAndModuleName); | |
930 | } | |
931 | ||
932 | }//tc_ | |
933 | ||
3abe9331 | 934 | testcase tc_simpleType_restrict_comp() runs on xmlTest_CT { |
935 | ||
936 | f_shellCommandWithVerdict("xsd2ttcn simpletype_restrict_comp.xsd","",c_shell_successWithoutWarningAndError) | |
937 | ||
938 | if(getverdict==pass) { | |
939 | f_compareFiles( | |
940 | "www_example_org_simpletype_restrict_comp_e.ttcn","www_example_org_simpletype_restrict_comp.ttcn", c_numOfDiff_headerAndModuleName); | |
941 | } | |
942 | ||
943 | }//tc_ | |
944 | ||
945 | testcase tc_simpleType_ref() runs on xmlTest_CT { | |
946 | ||
947 | f_shellCommandWithVerdict("xsd2ttcn simpletype_ref.xsd","",c_shell_successWithoutWarningAndError) | |
948 | ||
949 | if(getverdict==pass) { | |
950 | f_compareFiles( | |
951 | "www_example_org_simpletype_ref_e.ttcn","www_example_org_simpletype_ref.ttcn", c_numOfDiff_headerAndModuleName); | |
952 | } | |
953 | ||
954 | }//tc_ | |
955 | ||
956 | testcase tc_simpleType_base() runs on xmlTest_CT { | |
957 | ||
958 | f_shellCommandWithVerdict("xsd2ttcn simpletype_base.xsd","",c_shell_successWithoutWarningAndError) | |
959 | ||
960 | if(getverdict==pass) { | |
961 | f_compareFiles( | |
962 | "www_example_org_simpletype_base_e.ttcn","www_example_org_simpletype_base.ttcn", c_numOfDiff_headerAndModuleName); | |
963 | } | |
964 | ||
965 | }//tc_ | |
966 | ||
967 | // | |
968 | testcase tc_enum_field_names() runs on xmlTest_CT { | |
969 | ||
970 | f_shellCommandWithVerdict("xsd2ttcn enum_field_names.xsd","",c_shell_successWithoutWarningAndError) | |
971 | ||
972 | if(getverdict==pass) { | |
973 | f_compareFiles( | |
974 | "www_example_org_enum_field_names_e.ttcn","www_example_org_enum_field_names.ttcn", c_numOfDiff_headerAndModuleName); | |
975 | } | |
976 | ||
977 | }//tc_ | |
978 | ||
970ed795 EL |
979 | |
980 | //****************************** | |
981 | // TimeTest | |
982 | // Based on (XSD_2)/ | |
983 | //****************************** | |
984 | group TimeTest { | |
985 | ||
986 | //Passed: | |
987 | testcase tc_time() runs on xmlTest_CT { | |
988 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_time.xsd","",c_shell_successWithoutWarningAndError) | |
989 | ||
990 | if(getverdict==pass) { | |
991 | f_compareFiles( | |
992 | "www_XmlTest_org_time_e.ttcn","www_XmlTest_org_time.ttcn", c_numOfDiff_headerAndModuleName); | |
993 | } | |
994 | }//tc_ | |
995 | ||
996 | //Passed TR HL22058 | |
997 | testcase tc_time_withEnum() runs on xmlTest_CT { | |
998 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_time_withEnum.xsd","",c_shell_successWithoutWarningAndError) | |
999 | ||
1000 | if(getverdict==pass) { | |
1001 | f_compareFiles( | |
1002 | "www_XmlTest_org_time_withEnum_e.ttcn","www_XmlTest_org_time_withEnum.ttcn", c_numOfDiff_headerAndModuleName); | |
1003 | } | |
1004 | }//tc_ | |
1005 | }//TimeTest | |
1006 | ||
1007 | group ListTest { | |
1008 | //converter | |
1009 | testcase tc_list_conv() runs on xmlTest_CT { | |
1010 | ||
1011 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_list.xsd","",c_shell_successWithoutWarningAndError) | |
1012 | ||
1013 | if(getverdict==pass) { | |
1014 | f_compareFiles( | |
1015 | "www_XmlTest_org_list_e.ttcn","www_XmlTest_org_list.ttcn", c_numOfDiff_headerAndModuleName); | |
1016 | } | |
1017 | ||
1018 | // restrictions:length, minLength, maxLength, pattern, and enumeration. | |
1019 | }//tc_ | |
1020 | ||
1021 | testcase tc_list_encDec() runs on xmlTest_CT { | |
1022 | f_encDecTest_StringList(); | |
1023 | }//tc_ | |
1024 | ||
1025 | testcase tc_integerList() runs on xmlTest_CT { | |
1026 | ||
1027 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_list_integer.xsd","",c_shell_successWithoutWarningAndError) | |
1028 | ||
1029 | if(getverdict==pass) { | |
1030 | f_compareFiles( | |
1031 | "www_XmlTest_org_list_integer_e.ttcn","www_XmlTest_org_list_integer.ttcn", c_numOfDiff_headerAndModuleName); | |
1032 | } | |
1033 | ||
1034 | }//tc_ | |
3abe9331 | 1035 | |
1036 | testcase tc_list_simpletype() runs on xmlTest_CT { | |
1037 | ||
1038 | f_shellCommandWithVerdict("xsd2ttcn list_simpletype.xsd","",c_shell_successWithoutWarningAndError) | |
1039 | ||
1040 | if(getverdict==pass) { | |
1041 | f_compareFiles( | |
1042 | "www_example_org_list_simpletype_e.ttcn","www_example_org_list_simpletype.ttcn", c_numOfDiff_headerAndModuleName); | |
1043 | } | |
1044 | ||
1045 | }//tc_ | |
970ed795 EL |
1046 | }//ListTest |
1047 | ||
1048 | group UnionTest { | |
1049 | //TR:HL23577 | |
1050 | testcase tc_union() runs on xmlTest_CT { | |
1051 | ||
1052 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_union.xsd","",c_shell_successWithoutWarningAndError) | |
1053 | ||
1054 | if(getverdict==pass) { | |
1055 | f_compareFiles( | |
1056 | "www_XmlTest_org_union_e.ttcn","www_XmlTest_org_union.ttcn", c_numOfDiff_headerAndModuleName); | |
1057 | } | |
1058 | }//tc_ | |
1059 | ||
1060 | testcase tc_union_optional() runs on xmlTest_CT { | |
1061 | ||
1062 | f_shellCommandWithVerdict("xsd2ttcn ETSI_CR5852_union.xsd","",c_shell_successWithoutWarningAndError) | |
1063 | ||
1064 | if(getverdict==pass) { | |
1065 | f_compareFiles( | |
1066 | "ETSI_CR5852_union_e.ttcn","ETSI_CR5852_union.ttcn", c_numOfDiff_headerAndModuleName); | |
1067 | } | |
1068 | } | |
1069 | ||
3abe9331 | 1070 | testcase tc_enumeration_union_restriction() runs on xmlTest_CT { |
1071 | ||
1072 | f_shellCommandWithVerdict("xsd2ttcn enumeration_restriction.xsd","",c_shell_successWithWarning) | |
1073 | ||
1074 | if(getverdict==pass) { | |
1075 | f_compareFiles( | |
1076 | "www_example_org_enumeration_restriction_e.ttcn", | |
1077 | "www_example_org_enumeration_restriction.ttcn", c_numOfDiff_headerAndModuleName); | |
1078 | } | |
1079 | } | |
1080 | ||
1081 | testcase tc_enumeration_union_restriction2() runs on xmlTest_CT { | |
1082 | ||
1083 | f_shellCommandWithVerdict("xsd2ttcn enumeration_restriction2.xsd","",c_shell_successWithoutWarningAndError) | |
1084 | ||
1085 | if(getverdict==pass) { | |
1086 | f_compareFiles( | |
1087 | "www_example_org_seq_enumeration_restriction_e.ttcn", | |
1088 | "www_example_org_seq_enumeration_restriction.ttcn", c_numOfDiff_headerAndModuleName); | |
1089 | } | |
1090 | } | |
1091 | ||
1092 | testcase tc_enumeration_remove_dup() runs on xmlTest_CT { | |
1093 | ||
1094 | f_shellCommandWithVerdict("xsd2ttcn enumeration_remove_dup.xsd","",c_shell_successWithoutWarningAndError) | |
1095 | ||
1096 | if(getverdict==pass) { | |
1097 | f_compareFiles( | |
1098 | "www_example_org_enumeration_remove_dup_e.ttcn", | |
1099 | "www_example_org_enumeration_remove_dup.ttcn", c_numOfDiff_headerAndModuleName); | |
1100 | } | |
1101 | } | |
1102 | ||
970ed795 EL |
1103 | }//UnionTest |
1104 | ||
1105 | ||
1106 | ||
1107 | group ComplexType { | |
1108 | ||
1109 | testcase tc_complex1() runs on xmlTest_CT { | |
1110 | ||
1111 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex1.xsd","",c_shell_successWithoutWarningAndError) | |
1112 | ||
1113 | if(getverdict==pass) { | |
1114 | f_compareFiles( | |
1115 | "www_XmlTest_org_complex1_e.ttcn","www_XmlTest_org_complex1.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1116 | f_encDecTest_InternationalPrice(); | |
1117 | } | |
1118 | }//tc_ | |
1119 | ||
1120 | //TR: HL24977 -Solved | |
1121 | testcase tc_complex2() runs on xmlTest_CT { | |
1122 | ||
1123 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex2.xsd","",c_shell_successWithoutWarningAndError) | |
1124 | ||
1125 | if(getverdict==pass) { | |
1126 | f_compareFiles( | |
1127 | "www_XmlTest_org_complex2_e.ttcn","www_XmlTest_org_complex2.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1128 | } | |
1129 | f_encDecTest_InternationalPrice2(); //TR: HL24977 -solved -Primer, 2.5.3 Empty Content | |
1130 | f_encDecTest_InternationalPrice3(); | |
1131 | f_encDecTest_InternationalPrice4(); | |
1132 | }//tc_ | |
1133 | ||
1134 | testcase tc_complex_simpleContent() runs on xmlTest_CT { | |
1135 | ||
1136 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_simpleContent.xsd","",c_shell_successWithoutWarningAndError) | |
1137 | ||
1138 | if(getverdict==pass) { | |
1139 | f_compareFiles( | |
1140 | "www_XmlTest_org_complex_simpleContent_e.ttcn","www_XmlTest_org_complex_simpleContent.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1141 | f_encDecTest_ComplexTypeWithSimpleContent1(); | |
1142 | f_encDecTest_ComplexTypeWithSimpleContent2(); | |
1143 | f_encDecTest_ComplexTypeWithSimpleContent2_neg(); | |
1144 | } | |
1145 | }//tc_ | |
1146 | ||
3abe9331 | 1147 | testcase tc_complex_namespaceas() runs on xmlTest_CT { |
1148 | ||
1149 | f_shellCommandWithVerdict("xsd2ttcn namespaceas.xsd imported2.xsd","",c_shell_successWithoutWarningAndError) | |
1150 | ||
1151 | if(getverdict==pass) { | |
1152 | f_compareFiles( | |
1153 | "www_example_org_namespaceas_e.ttcn","www_example_org_namespaceas.ttcn", c_numOfDiff_headerAndModuleName); | |
1154 | f_compareFiles( | |
1155 | "www_example_org_imported2_e.ttcn","www_example_org_imported2.ttcn", c_numOfDiff_headerAndModuleName); | |
1156 | } | |
1157 | }//tc_ | |
1158 | ||
970ed795 EL |
1159 | testcase tc_complex_mixed_conv() runs on xmlTest_CT { |
1160 | ||
1161 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_mixed.xsd","",c_shell_successWithoutWarningAndError) | |
1162 | ||
1163 | if(getverdict==pass) { | |
1164 | f_compareFiles( | |
1165 | "www_XmlTest_org_complex_mixed_e.ttcn","www_XmlTest_org_complex_mixed.ttcn", c_numOfDiff_headerAndModuleName); | |
1166 | } | |
1167 | }//tc_ | |
1168 | ||
3abe9331 | 1169 | testcase tc_complex_group_reference() runs on xmlTest_CT { |
1170 | ||
1171 | f_shellCommandWithVerdict("xsd2ttcn seq_group_reference.xsd","",c_shell_successWithoutWarningAndError) | |
1172 | ||
1173 | if(getverdict==pass) { | |
1174 | f_compareFiles( | |
1175 | "www_example_org_seq_group_reference_e.ttcn","www_example_org_seq_group_reference.ttcn", c_numOfDiff_headerAndModuleName); | |
1176 | } | |
1177 | }//tc_ | |
1178 | ||
970ed795 EL |
1179 | //TR:HL29258 |
1180 | testcase tc_complex_mixed_encDec() runs on xmlTest_CT { | |
1181 | f_encDecTest_ComplexTypeWithMixed(); | |
1182 | }//tc_ | |
1183 | ||
3abe9331 | 1184 | testcase tc_complex_seq_embeds_seq() runs on xmlTest_CT { |
1185 | ||
1186 | f_shellCommandWithVerdict("xsd2ttcn sequence_embeds_sequence.xsd","",c_shell_successWithoutWarningAndError) | |
1187 | ||
1188 | if(getverdict==pass) { | |
1189 | f_compareFiles( | |
1190 | "http_www_example_org_seq_embeds_seq_e.ttcn","http_www_example_org_seq_embeds_seq.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1191 | f_encDecTest_InternationalPrice(); | |
1192 | } | |
1193 | }//tc_ | |
970ed795 EL |
1194 | |
1195 | testcase tc_complex_choice_converter() runs on xmlTest_CT { | |
1196 | ||
3abe9331 | 1197 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_choice.xsd","",c_shell_successWithWarning) |
970ed795 EL |
1198 | |
1199 | if(getverdict==pass) { | |
1200 | f_compareFiles( | |
1201 | "www_XmlTest_org_complex_choice_e.ttcn","www_XmlTest_org_complex_choice.ttcn", c_numOfDiff_headerAndModuleName); | |
1202 | } | |
1203 | }//tc_ | |
1204 | ||
1205 | // | |
1206 | testcase tc_complex_choice_encDec() runs on xmlTest_CT { | |
1207 | f_encDecTest_ComplexTypeWithChoice_1(); | |
1208 | f_encDecTest_ComplexTypeWithChoice_2(); | |
1209 | f_encDecTest_ComplexTypeWithChoice_3(); | |
1210 | f_encDecTest_ComplexTypeWithChoice_4(); | |
1211 | f_encDecTest_ComplexTypeWithChoice_5(); | |
1212 | f_encDecTest_ComplexTypeWithChoice_6(); | |
1213 | f_encDecTest_ComplexTypeWithChoice_7(); | |
1214 | f_encDecTest_ComplexTypeWithChoice_8(); | |
1215 | f_encDecTest_ComplexTypeWithChoice_9(); | |
1216 | f_encDecTest_ComplexTypeWithChoice_10(); | |
1217 | }//tc_ | |
1218 | ||
1219 | //Passed, TR: HL30830 -solved | |
1220 | testcase tc_complex_all_converter() runs on xmlTest_CT { | |
1221 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_all.xsd","",c_shell_successWithoutWarningAndError) | |
1222 | ||
1223 | if(getverdict==pass) { | |
1224 | f_compareFiles( | |
1225 | "www_XmlTest_org_complex_all_e.ttcn","www_XmlTest_org_complex_all.ttcn", c_numOfDiff_headerAndModuleName); | |
1226 | } | |
1227 | }//tc_ | |
1228 | ||
1229 | //HL29679 | |
1230 | testcase tc_complex_all_emptySet_encDec() runs on xmlTest_CT { | |
1231 | var MySubjects1 vl_pdu:= { | |
1232 | order:={}, | |
1233 | year:="2009", | |
1234 | english:=omit, | |
1235 | math:=omit, | |
1236 | physics:=omit, | |
1237 | chemistry:=omit | |
1238 | } | |
1239 | var charstring vl_expectedEncodedPdu:="<MySubjects1 Year='2009'/>\n\n"; | |
1240 | f_encDecTest_ComplexTypeWithAll_MySubject1(vl_pdu,vl_expectedEncodedPdu,vl_pdu); | |
1241 | }//tc_ | |
1242 | ||
1243 | testcase tc_complex_all_fullSet_encDec() runs on xmlTest_CT { | |
1244 | var MySubjects1 vl_pdu:= { | |
1245 | order:={math,english,chemistry, physics}, | |
1246 | year:="2009", | |
1247 | english:="Advanced Group 1", | |
1248 | math:="Beginners 1", | |
1249 | physics:="Mechanics 1", | |
1250 | chemistry:="CH2" | |
1251 | } | |
1252 | var charstring vl_expectedEncodedPdu:= | |
1253 | "<MySubjects1 Year='2009'>\n\t<Math>Beginners 1</Math>\n\t<English>Advanced Group 1</English>\n\t<Chemistry>CH2</Chemistry>\n\t<Physics>Mechanics 1</Physics>\n</MySubjects1>\n\n" | |
1254 | f_encDecTest_ComplexTypeWithAll_MySubject1(vl_pdu,vl_expectedEncodedPdu,vl_pdu); | |
1255 | }//tc_ | |
1256 | ||
1257 | testcase tc_complex_all_subSet_encDec() runs on xmlTest_CT { | |
1258 | var MySubjects1 vl_pdu:= { | |
1259 | order:={math,english,chemistry}, | |
1260 | year:="2009", | |
1261 | english:="Advanced Group 1", | |
1262 | math:="Beginners 1", | |
1263 | physics:=omit, | |
1264 | chemistry:="CH2" | |
1265 | }, | |
1266 | vl_expectedPdu:={ | |
1267 | order:={math,english}, | |
1268 | year:="2009", | |
1269 | english:="Advanced Group 1", | |
1270 | math:="Beginners 1", | |
1271 | physics:=omit, | |
1272 | chemistry:=omit | |
1273 | }; | |
1274 | var charstring vl_expectedEncodedPdu:= | |
1275 | "<MySubjects1 Year='2009'>\n\t<Math>Beginners 1</Math>\n\t<English>Advanced Group 1</English>\n\t<Chemistry>CH2</Chemistry>\n</MySubjects1>\n\n" | |
1276 | f_encDecTest_ComplexTypeWithAll_MySubject1(vl_pdu,vl_expectedEncodedPdu,vl_pdu); | |
1277 | }//tc_ | |
1278 | ||
1279 | testcase tc_complex_all_inconsistentSet_encDec() runs on xmlTest_CT { | |
1280 | f_encDecTest_ComplexTypeWithAll_inconsistentSet(); | |
1281 | }//tc_ | |
1282 | ||
1283 | //positive testcase for group "all". The type has no optional field (element).The input is correct | |
1284 | testcase tc_complex_all_noOptional_pos_encDec() runs on xmlTest_CT { | |
1285 | var MySubjects2 vl_pdu:= { | |
3abe9331 | 1286 | order:={math,english,chemistry, physics,history}, |
970ed795 | 1287 | year:="2009", |
3abe9331 | 1288 | english:="Advanced Group 1", |
1289 | math:="Beginners 1", | |
1290 | physics:="Mechanics 1", | |
1291 | chemistry:="CH2", | |
1292 | history:="H1" | |
970ed795 EL |
1293 | } |
1294 | var charstring vl_expectedEncodedPdu:= | |
1295 | "<MySubjects2 Year='2009'>\n\t<Math>Beginners 1</Math>\n\t<English>Advanced Group 1</English>\n\t<Chemistry>CH2</Chemistry>\n\t<Physics>Mechanics 1</Physics>\n\t<History>H1</History>\n</MySubjects2>\n\n"; | |
1296 | f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_pdu,0); | |
1297 | }//tc_ | |
1298 | ||
1299 | //Negative testcase for group "all". The type has no optional field (element). | |
1300 | //The input is not correct: value of one field (history) is missing | |
1301 | //Passed, TR: HL32978 | |
1302 | testcase tc_complex_all_noOptional_neg1_encDec() runs on xmlTest_CT { | |
1303 | var MySubjects2 vl_pdu:= { | |
3abe9331 | 1304 | order:={math,english,chemistry, physics,history}, |
970ed795 | 1305 | year:="2009", |
3abe9331 | 1306 | english:="Advanced Group 1", |
1307 | math:="Beginners 1", | |
1308 | physics:="Mechanics 1", | |
1309 | chemistry:="CH2" | |
1310 | //history:="H1" | |
970ed795 EL |
1311 | } |
1312 | var MySubjects2 vl_expectedDecodedPdu:= { | |
3abe9331 | 1313 | order:={math,english,chemistry, physics,history}, |
970ed795 | 1314 | year:="2009", |
3abe9331 | 1315 | english:="Advanced Group 1", |
1316 | math:="Beginners 1", | |
1317 | physics:="Mechanics 1", | |
1318 | chemistry:="CH2", | |
1319 | history:="" | |
970ed795 EL |
1320 | } |
1321 | var charstring vl_expectedEncodedPdu:="<MySubjects2 Year='2009'>\n\t<Math>Beginners 1</Math>\n\t<English>Advanced Group 1</English>\n\t<Chemistry>CH2</Chemistry>\n\t<Physics>Mechanics 1</Physics>\n\t<History/>\n</MySubjects2>\n\n" | |
1322 | f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_expectedDecodedPdu,0); | |
1323 | }//tc_ | |
1324 | ||
1325 | //Negative testcase for group "all". The type has no optional field (element). | |
1326 | //The input is not correct: value of one field (history) and its place in order-list is missing. | |
1327 | // ***Less elements of record of order than required*** | |
1328 | //expectation: error report at encoding, returning 1 at decoding | |
1329 | //Passed, TR: HL32978 | |
1330 | testcase tc_complex_all_noOptional_neg2_encDec() runs on xmlTest_CT { | |
1331 | var MySubjects2 vl_pdu:= { | |
3abe9331 | 1332 | order:={math,english,chemistry, physics}, |
970ed795 | 1333 | year:="2009", |
3abe9331 | 1334 | english:="Advanced Group 1", |
1335 | math:="Beginners 1", | |
1336 | physics:="Mechanics 1", | |
1337 | chemistry:="CH2" | |
1338 | //history:="H1" | |
970ed795 EL |
1339 | } |
1340 | var MySubjects2 vl_expectedDecodedPdu:= { | |
3abe9331 | 1341 | order:={math,english,chemistry, physics}, |
970ed795 | 1342 | year:="2009", |
3abe9331 | 1343 | english:="Advanced Group 1", |
1344 | math:="Beginners 1", | |
1345 | physics:="Mechanics 1", | |
1346 | chemistry:="CH2", | |
1347 | history:="" | |
970ed795 EL |
1348 | } |
1349 | var charstring vl_expectedEncodedPdu:="<MySubjects2 Year='2009'/>\n\n"; //expecting error report!!! | |
1350 | //"<MySubjects2 Year='2009'>\n\t<Math>Beginners 1</Math>\n\t<English>Advanced Group 1</English>\n\t<Chemistry>CH2</Chemistry>\n\t<Physics>Mechanics 1</Physics>\n</MySubjects2>\n\n" | |
1351 | f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_expectedDecodedPdu,1); | |
1352 | }//tc_ | |
1353 | ||
1354 | //Negative testcase for group "all". The type has no optional field (element). | |
1355 | //The input is not correct: order three times contains "math", Physics and history are missing. | |
1356 | //expectation: error report at encoding, returning 1 at decoding | |
1357 | //Passed, TR: HL32978 | |
1358 | testcase tc_complex_all_noOptional_neg3_encDec() runs on xmlTest_CT { | |
1359 | var MySubjects2 vl_pdu:= { | |
3abe9331 | 1360 | order:={math,english,chemistry,math,math}, |
970ed795 | 1361 | year:="2009", |
3abe9331 | 1362 | english:="Advanced Group 1", |
1363 | math:="Beginners 1", | |
1364 | physics:="Mechanics 1", | |
1365 | chemistry:="CH2" | |
1366 | //history:="H1" | |
970ed795 EL |
1367 | } |
1368 | var charstring vl_expectedEncodedPdu:="<MySubjects2 Year='2009'/>\n\n"; //expecting error report!!! | |
1369 | //"<MySubjects2 Year='2009'>\n\t<Math>Beginners 1</Math>\n\t<English>Advanced Group 1</English>\n\t<Chemistry>CH2</Chemistry>\n\t<Physics>Mechanics 1</Physics>\n</MySubjects2>\n\n" | |
1370 | f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_pdu,1); | |
1371 | }//tc_ | |
1372 | ||
1373 | ||
1374 | //========================================================================= | |
1375 | // tc_complex_all_noOptional_empty_encDec | |
1376 | //========================================================================= | |
1377 | //Negative testcase for group "all". The type has no optional field (element). | |
1378 | //The input is not correct: value of all the fields and their place in order-list is missing | |
1379 | //expectation: error report at encoding | |
1380 | //Passed, TR: HL32978 | |
1381 | testcase tc_complex_all_noOptional_empty_encDec() runs on xmlTest_CT { | |
1382 | var MySubjects2 vl_pdu:= { | |
3abe9331 | 1383 | order:={ }, |
1384 | year:="2009" | |
1385 | //english:="Advanced Group 1", | |
1386 | //math:="Beginners 1", | |
1387 | //physics:="Mechanics 1", | |
1388 | //chemistry:="CH2" | |
1389 | //history:="H1" | |
970ed795 EL |
1390 | } |
1391 | var charstring vl_expectedEncodedPdu:="<MySubjects2 Year='2009'/>\n\n"; //expecting error report!!! | |
1392 | f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_pdu,1); | |
1393 | }//tc_ | |
1394 | ||
1395 | //========================================================================= | |
1396 | // tc_complex_minOccursMaxOccurs | |
1397 | //========================================================================= | |
1398 | //Old name: tc_XmlTest_minOccursMaxOccurs | |
1399 | ////TR (ethgry): HL10386 | |
1400 | testcase tc_complex_minOccursMaxOccurs() runs on xmlTest_CT | |
1401 | { | |
1402 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_minOccursMaxOccurs.xsd","",c_shell_successWithoutWarningAndError); | |
1403 | if(getverdict==pass) { | |
1404 | f_compareFiles( | |
1405 | "www_XmlTest_org_complex_minOccursMaxOccurs_e.ttcn","www_XmlTest_org_complex_minOccursMaxOccurs.ttcn", c_numOfDiff_headerAndModuleName); | |
1406 | } | |
1407 | } | |
1408 | ||
1409 | ||
1410 | testcase tc_complex_extension_converter() runs on xmlTest_CT { | |
1411 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_extension.xsd","",c_shell_successWithoutWarningAndError) | |
1412 | ||
1413 | if(getverdict==pass) { | |
1414 | f_compareFiles( | |
1415 | "www_XmlTest_org_complex_extension_e.ttcn","www_XmlTest_org_complex_extension.ttcn", c_numOfDiff_headerAndModuleName); | |
1416 | } | |
1417 | }//tc_ | |
1418 | ||
3abe9331 | 1419 | testcase tc_complex_extension_name_attrib_convert() runs on xmlTest_CT { |
1420 | f_shellCommandWithVerdict("xsd2ttcn name_conversion_extension_attrib.xsd","",c_shell_successWithoutWarningAndError) | |
1421 | ||
1422 | if(getverdict==pass) { | |
1423 | f_compareFiles( | |
1424 | "name_conversion_extension_attrib_e.ttcn","name_conversion_extension_attrib.ttcn", c_numOfDiff_headerAndModuleName); | |
1425 | } | |
1426 | }//tc_ | |
1427 | ||
1428 | testcase tc_complex_long_extension() runs on xmlTest_CT { | |
1429 | f_shellCommandWithVerdict("xsd2ttcn long_extension.xsd","",c_shell_successWithoutWarningAndError) | |
1430 | ||
1431 | if(getverdict==pass) { | |
1432 | f_compareFiles( | |
1433 | "www_example_org_long_extension_e.ttcn","www_example_org_long_extension.ttcn", c_numOfDiff_headerAndModuleName); | |
1434 | } | |
1435 | }//tc_ | |
1436 | ||
1437 | testcase tc_complex_self_recursion() runs on xmlTest_CT { | |
1438 | f_shellCommandWithVerdict("xsd2ttcn complex_self_recursion.xsd","",c_shell_successWithoutWarningAndError) | |
1439 | ||
1440 | if(getverdict==pass) { | |
1441 | f_compareFiles( | |
1442 | "www_example_org_self_recursion_e.ttcn","www_example_org_self_recursion.ttcn", c_numOfDiff_headerAndModuleName); | |
1443 | } | |
1444 | }//tc_ | |
1445 | ||
1446 | testcase tc_type_name_conversion_follow() runs on xmlTest_CT { | |
1447 | f_shellCommandWithVerdict("xsd2ttcn type_conversion_follow.xsd","",c_shell_successWithoutWarningAndError) | |
1448 | ||
1449 | if(getverdict==pass) { | |
1450 | f_compareFiles( | |
1451 | "www_example_org_type_conversion_follow_e.ttcn","www_example_org_type_conversion_follow.ttcn", c_numOfDiff_headerAndModuleName); | |
1452 | } | |
1453 | }//tc_ | |
1454 | ||
1455 | testcase tc_complex_extension_with_attrib() runs on xmlTest_CT { | |
1456 | f_shellCommandWithVerdict("xsd2ttcn attribute_in_extension.xsd","",c_shell_successWithoutWarningAndError) | |
1457 | ||
1458 | if(getverdict==pass) { | |
1459 | f_compareFiles( | |
1460 | "attribute_in_extension_e.ttcn","attribute_in_extension.ttcn", c_numOfDiff_headerAndModuleName); | |
1461 | } | |
1462 | }//tc_ | |
1463 | ||
1464 | testcase tc_extension_restriction_with_attrib() runs on xmlTest_CT { | |
1465 | f_shellCommandWithVerdict("xsd2ttcn attrib_restriction_extension.xsd","",c_shell_successWithoutWarningAndError) | |
1466 | ||
1467 | if(getverdict==pass) { | |
1468 | f_compareFiles( | |
1469 | "www_example_org_attr_ext_rest_e.ttcn","www_example_org_attr_ext_rest.ttcn", c_numOfDiff_headerAndModuleName); | |
1470 | } | |
1471 | }//tc_ | |
1472 | ||
1473 | testcase tc_attrib_enum() runs on xmlTest_CT { | |
1474 | f_shellCommandWithVerdict("xsd2ttcn attrib_enum.xsd","",c_shell_successWithoutWarningAndError) | |
1475 | ||
1476 | if(getverdict==pass) { | |
1477 | f_compareFiles( | |
1478 | "www_example_org_attrib_enum_e.ttcn","www_example_org_attrib_enum.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1479 | } | |
1480 | }//tc_ | |
1481 | ||
970ed795 EL |
1482 | testcase tc_complex_extension_encDec() runs on xmlTest_CT |
1483 | { | |
1484 | var MySubjects3Extension vl_pdu:={ | |
1485 | semester:="Autumn", | |
1486 | year:="2009", | |
1487 | english:="B1", | |
1488 | math:=omit, | |
1489 | physics:="Optics", | |
1490 | chemistry:=omit, | |
1491 | arts:="Impressionism" | |
1492 | } | |
1493 | var charstring vl_expectedEncodedPdu:= | |
1494 | "<MySubjects3Extension Semester='Autumn' Year='2009'>\n\t<English>B1</English>\n\t<Physics>Optics</Physics>\n\t<Arts>Impressionism</Arts>\n</MySubjects3Extension>\n\n"; | |
1495 | f_encDecTest_ComplexTypeWithExtension_MySubject3(vl_pdu,vl_expectedEncodedPdu, vl_pdu); | |
1496 | } | |
1497 | ||
1498 | testcase tc_complex_restriction_converter() runs on xmlTest_CT { | |
1499 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_restriction.xsd","",c_shell_successWithoutWarningAndError) | |
1500 | ||
1501 | if(getverdict==pass) { | |
1502 | f_compareFiles( | |
1503 | "www_XmlTest_org_complex_restriction_e.ttcn","www_XmlTest_org_complex_restriction.ttcn", c_numOfDiff_headerAndModuleName); | |
1504 | } | |
1505 | }//tc_ | |
1506 | ||
3abe9331 | 1507 | testcase tc_complex_restriction_with_use() runs on xmlTest_CT { |
1508 | f_shellCommandWithVerdict("xsd2ttcn complex_restriction_with_use.xsd","",c_shell_successWithoutWarningAndError) | |
1509 | ||
1510 | if(getverdict==pass) { | |
1511 | f_compareFiles( | |
1512 | "http_www_example_org_complex_restriction_with_use_e.ttcn", | |
1513 | "http_www_example_org_complex_restriction_with_use.ttcn", c_numOfDiff_headerAndModuleName); | |
1514 | } | |
1515 | }//tc_ | |
1516 | ||
1517 | testcase tc_complex_nillable() runs on xmlTest_CT { | |
1518 | f_shellCommandWithVerdict("xsd2ttcn complex_nillable.xsd","",c_shell_successWithoutWarningAndError) | |
1519 | ||
1520 | if(getverdict==pass) { | |
1521 | f_compareFiles( | |
1522 | "www_example_org_complex_nillable_e.ttcn", | |
1523 | "www_example_org_complex_nillable.ttcn", c_numOfDiff_headerAndModuleName); | |
1524 | } | |
1525 | }//tc_ | |
1526 | ||
1527 | //Fixed or defaultforempty attribute is not allowed on nillable elements according to TITAN | |
1528 | testcase tc_nillable_fixed() runs on xmlTest_CT { | |
1529 | f_shellCommandWithVerdict("xsd2ttcn nillable_fixed.xsd","",c_shell_successWithoutWarningAndError) | |
1530 | ||
1531 | if(getverdict==pass) { | |
1532 | f_compareFiles( | |
1533 | "www_example_org_nillable_fixed_e.ttcn", | |
1534 | "www_example_org_nillable_fixed.ttcn", c_numOfDiff_headerAndModuleName); | |
1535 | } | |
1536 | }//tc_ | |
1537 | ||
1538 | testcase tc_no_ns_connector() runs on xmlTest_CT { | |
1539 | f_shellCommandWithVerdict("xsd2ttcn no_ns_connector.xsd","",c_shell_successWithWarning) | |
1540 | ||
1541 | if(getverdict==pass) { | |
1542 | f_compareFiles( | |
1543 | "www_example_org_no_ns_connector_e.ttcn", | |
1544 | "www_example_org_no_ns_connector.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1545 | } | |
1546 | }//tc_ | |
1547 | ||
970ed795 EL |
1548 | testcase tc_complex_restriction_encDec() runs on xmlTest_CT |
1549 | { | |
1550 | var MySubjects4Restriction vl_pdu:={ | |
1551 | year:="2009", | |
1552 | english:="B1", | |
1553 | math:="Combinatorics 1" | |
1554 | } | |
1555 | var charstring vl_expectedEncodedPdu:= "<MySubjects4Restriction Year='2009'>\n\t<English>B1</English>\n\t<Math>Combinatorics 1</Math>\n</MySubjects4Restriction>\n\n"; | |
1556 | f_encDecTest_ComplexTypeWithExtension_MySubject4(vl_pdu,vl_expectedEncodedPdu, vl_pdu); | |
1557 | } | |
1558 | //TR: HL32948, Solved | |
1559 | testcase tc_complex_restriction_neg1_converter() runs on xmlTest_CT { | |
1560 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_restriction_neg1.xsd","",c_shell_error); | |
1561 | }//tc_ | |
1562 | ||
1563 | //TR: HL32948, Solved | |
1564 | testcase tc_complex_restriction_neg2_converter() runs on xmlTest_CT { | |
1565 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_restriction_neg2.xsd","",c_shell_error); | |
1566 | }//tc_ | |
1567 | ||
1568 | //not supported: | |
1569 | testcase tc_complex_unique_converter() runs on xmlTest_CT { | |
1570 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_unique.xsd","",c_shell_successWithWarning); | |
1571 | }//tc_ | |
1572 | ||
1573 | //Positive test: The including and the included schema are in the same namespace | |
1574 | testcase tc_complex_include_converter() runs on xmlTest_CT { | |
1575 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_include.xsd XmlTest_complex_include1.xsd","",c_shell_successWithoutWarningAndError); | |
1576 | ||
1577 | if(getverdict==pass) { | |
1578 | f_compareFiles( | |
1579 | "www_XmlTest_org_complex_include1_e.ttcn","www_XmlTest_org_complex_include.ttcn", c_numOfDiff_headerAndModuleName); | |
1580 | } | |
1581 | }//tc_ | |
1582 | ||
1583 | //========================================================================= | |
1584 | // tc_complex_include_neg1_converter | |
1585 | //========================================================================= | |
1586 | //Negative test: The including and the included schema are not in the same namespace | |
1587 | testcase tc_complex_include_neg1_converter() runs on xmlTest_CT { | |
1588 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_include.xsd XmlTest_complex_include2.xsd","",c_shell_error); | |
1589 | }//tc_ | |
1590 | ||
1591 | //========================================================================= | |
1592 | // tc_complex_import_pos1_converter | |
1593 | //========================================================================= | |
1594 | //Positive test: The including and the included schema are in different namespaces (import and include) | |
1595 | testcase tc_complex_import_pos1_converter() runs on xmlTest_CT { | |
1596 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_pos.xsd XmlTest_complex_include1.xsd","",c_shell_successWithoutWarningAndError); | |
1597 | ||
1598 | if(getverdict==pass) { | |
1599 | f_compareFiles( | |
1600 | "www_XmlTest_org_complex_import_e.ttcn","www_XmlTest_org_complex_import.ttcn", c_numOfDiff_headerModNameAndImport); | |
1601 | ||
1602 | f_compareFiles( | |
1603 | "www_XmlTest_org_complex_include2_e.ttcn","www_XmlTest_org_complex_include.ttcn", c_numOfDiff_headerModNameAndImport); | |
1604 | } | |
1605 | }//tc_ | |
1606 | ||
1607 | //========================================================================= | |
1608 | // tc_complex_import_pos2_converter | |
1609 | //========================================================================= | |
1610 | //Pos test: Checks if the converter can choose the file having the correct namespace | |
1611 | //The types are the same in the 2nd and the 3rd file but only the 3rd have the namespace having prefix in the first file | |
1612 | testcase tc_complex_import_pos2_converter() runs on xmlTest_CT { | |
1613 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_pos.xsd XmlTest_complex_include2.xsd XmlTest_complex_include1.xsd","",c_shell_successWithoutWarningAndError); | |
1614 | ||
1615 | if(getverdict==pass) { | |
1616 | f_compareFiles( | |
1617 | "www_XmlTest_org_complex_import_e.ttcn","www_XmlTest_org_complex_import.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1618 | ||
1619 | f_compareFiles( | |
1620 | "www_XmlTest_org_complex_include2_e.ttcn","www_XmlTest_org_complex_include.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1621 | } | |
1622 | }//tc_ | |
1623 | ||
1624 | //========================================================================= | |
1625 | // tc_complex_import_neg1_converter | |
1626 | //========================================================================= | |
1627 | //Negative test: The importing and the imported schema are in different namespaces, but the first file contains unknown type | |
1628 | //If the type checking is switched off the testcase fails. | |
1629 | testcase tc_complex_import_neg1_converter() runs on xmlTest_CT { | |
1630 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_neg1.xsd XmlTest_complex_include1.xsd","",c_shell_error); | |
1631 | }//tc_ | |
1632 | ||
1633 | //========================================================================= | |
1634 | // tc_complex_import_withSL_converter | |
1635 | //========================================================================= | |
1636 | //Positive test: The importing schema contains the namespace and the schema location of the imported schema. | |
1637 | testcase tc_complex_import_withSL_converter() runs on xmlTest_CT { | |
1638 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_withSchemaLocation.xsd XmlTest_complex_include1.xsd","",c_shell_successWithoutWarningAndError); | |
1639 | ||
1640 | if(getverdict==pass) { | |
1641 | f_compareFiles( | |
1642 | "www_XmlTest_org_complex_import_e.ttcn","www_XmlTest_org_complex_import.ttcn", c_numOfDiff_headerModNameAndNamespace+4); | |
1643 | } | |
1644 | }//tc_ | |
1645 | ||
1646 | //========================================================================= | |
1647 | // tc_complex_import_withSL_encDec | |
1648 | //========================================================================= | |
1649 | // TODO: fix HR88527 | |
1650 | testcase tc_complex_import_withSL_encDec() runs on xmlTest_CT { | |
1651 | var PurchaseReportImport pl_pdu:= { | |
1652 | period :="P3M", | |
1653 | periodEnding :="1999-12-31", | |
1654 | regions:= { | |
1655 | zip_list :={ | |
1656 | { | |
1657 | code:=95819, | |
1658 | part_list:= { | |
1659 | { | |
1660 | number:="872-AA", | |
1661 | quantity:=1 | |
1662 | }, | |
1663 | { | |
1664 | number:="926-AA", | |
1665 | quantity:=2 | |
1666 | } | |
1667 | } | |
1668 | } | |
1669 | } | |
1670 | }, | |
1671 | parts :={ | |
1672 | part_list:= { | |
1673 | { | |
1674 | number:="872-AA", | |
1675 | base:="Lawnmower" | |
1676 | }, | |
1677 | { | |
1678 | number:="926-AA", | |
1679 | base:="Baby Monitor" | |
1680 | } | |
1681 | } | |
1682 | } | |
1683 | } | |
1684 | var charstring pl_expectedEncodedPdu:="<imp:purchaseReportImport xmlns:imp='www.XmlTest.org/complex_import' xmlns:r='www.XmlTest.org/complex_include' period='P3M' periodEnding='1999-12-31'>\n\t<imp:regions>\n\t\t<r:zip code='95819'>\n\t\t\t<r:part number='872-AA' quantity='1'/>\n\t\t\t<r:part number='926-AA' quantity='2'/>\n\t\t</r:zip>\n\t</imp:regions>\n\t<imp:parts>\n\t\t<r:part number='872-AA'>Lawnmower</r:part>\n\t\t<r:part number='926-AA'>Baby Monitor</r:part>\n\t</imp:parts>\n</imp:purchaseReportImport>\n\n"; | |
1685 | //see http://www.w3.org/TR/xmlschema-0/#quartelyReport ! | |
1686 | f_encDecTest_PurchaseReportImport(pl_pdu,pl_expectedEncodedPdu,pl_pdu); | |
1687 | }//tc_ | |
1688 | ||
1689 | //========================================================================= | |
1690 | // tc_complex_import_nameCollision_converter | |
1691 | //========================================================================= | |
1692 | //imports the same type from different namespaces | |
1693 | testcase tc_complex_import_nameCollision_converter() runs on xmlTest_CT { | |
1694 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_AB.xsd XmlTest_complex_import_A.xsd XmlTest_complex_import_B.xsd","",c_shell_successWithoutWarningAndError); | |
1695 | ||
1696 | if(getverdict==pass) { | |
1697 | f_compareFiles( | |
1698 | "www_XmlTest_org_complex_import_A_e.ttcn","www_XmlTest_org_complex_import_A.ttcn", c_numOfDiff_headerAndModuleName); | |
1699 | f_compareFiles( | |
1700 | "www_XmlTest_org_complex_import_B_e.ttcn","www_XmlTest_org_complex_import_B.ttcn", c_numOfDiff_headerAndModuleName); | |
1701 | f_compareFiles( | |
1702 | "www_XmlTest_org_complex_import_AB_e.ttcn","www_XmlTest_org_complex_import_AB.ttcn", 10+c_numOfDiff_headerModNameAndImport); | |
1703 | } | |
1704 | }//tc_ | |
1705 | ||
1706 | //========================================================================= | |
1707 | // tc_complex_import_nameCollision2_converter | |
1708 | //========================================================================= | |
1709 | //imports the same type from different namespaces | |
1710 | testcase tc_complex_import_nameCollision2_converter() runs on xmlTest_CT { | |
1711 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_AB.xsd XmlTest_complex_import_B.xsd XmlTest_complex_import_A.xsd","",c_shell_successWithoutWarningAndError); | |
1712 | }//tc_ | |
1713 | ||
1714 | //========================================================================= | |
1715 | // tc_complex_any_pos_converter | |
1716 | //========================================================================= | |
1717 | testcase tc_complex_any_pos_converter() runs on xmlTest_CT { | |
3abe9331 | 1718 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_any.xsd","",c_shell_successWithWarning); |
970ed795 EL |
1719 | |
1720 | if(getverdict==pass) { | |
1721 | f_compareFiles( | |
1722 | "www_XmlTest_org_complex_any_e.ttcn","www_XmlTest_org_complex_any.ttcn", c_numOfDiff_headerAndModuleName); | |
1723 | } | |
1724 | }//tc_ | |
1725 | ||
3abe9331 | 1726 | testcase tc_imported_type_prefix() runs on xmlTest_CT { |
1727 | f_shellCommandWithVerdict("xsd2ttcn import_prefix_name.xsd imported_prefix_name.xsd","",c_shell_successWithoutWarningAndError); | |
1728 | ||
1729 | if(getverdict==pass) { | |
1730 | f_compareFiles( | |
1731 | "www_example_org_import_prefix_e.ttcn","www_example_org_import_prefix.ttcn", c_numOfDiff_headerAndModuleName); | |
1732 | } | |
1733 | }//tc_ | |
1734 | ||
970ed795 EL |
1735 | |
1736 | //========================================================================= | |
1737 | // tc_complex_any_pos1_encDec | |
1738 | // Failed, TR: HL37887 | |
1739 | //========================================================================= | |
1740 | testcase tc_complex_any_pos1_encDec() runs on xmlTest_CT { | |
1741 | ||
1742 | var ElementContainingXhtml_1 vl_pdu := { | |
1743 | firstField:="1st field", | |
1744 | elem_list:= { | |
1745 | "<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>" | |
1746 | }, | |
1747 | thirdField:="3rd field" | |
1748 | } | |
1749 | var charstring vl_expectedEncodedPdu:="<r1:ElementContainingXhtml_1 xmlns:r1='www.XmlTest.org/complex_any'>\n\t<r1:FirstField>1st field</r1:FirstField>\n\t<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>\n\t<r1:ThirdField>3rd field</r1:ThirdField>\n</r1:ElementContainingXhtml_1>\n\n"; | |
1750 | f_encDecTest_ElementContainingXhtml_1(vl_pdu,vl_expectedEncodedPdu, vl_pdu); | |
1751 | }//tc_ | |
1752 | ||
1753 | //========================================================================= | |
1754 | // tc_complex_any_pos2_encDec | |
1755 | //========================================================================= | |
1756 | testcase tc_complex_any_pos2_encDec() runs on xmlTest_CT { | |
1757 | ||
1758 | var ElementContainingXhtml_2 vl_pdu := { | |
1759 | elem_list:= { | |
1760 | "<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>" | |
1761 | } | |
1762 | } | |
1763 | var charstring vl_expectedEncodedPdu:= | |
1764 | "<r1:ElementContainingXhtml_2 xmlns:r1='www.XmlTest.org/complex_any'>\n\t<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>\n</r1:ElementContainingXhtml_2>\n\n"; | |
1765 | f_encDecTest_ElementContainingXhtml_2(vl_pdu,vl_expectedEncodedPdu, vl_pdu); | |
1766 | }//tc_ | |
1767 | ||
1768 | //========================================================================= | |
1769 | // tc_complex_any_pos3_encDec | |
1770 | // Failed, TR: HL37887 | |
1771 | //========================================================================= | |
1772 | testcase tc_complex_any_pos3_encDec() runs on xmlTest_CT { | |
1773 | ||
1774 | var ElementContainingXhtml_1 vl_pdu := | |
1775 | { | |
1776 | firstField := "1st field", | |
1777 | elem_list := { | |
1778 | "<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>", | |
1779 | "<second xmlns=\"http://www.w3.org/1999/xhtml\" element=\"rabbit\"/>" }, | |
1780 | thirdField := "3rd field" | |
1781 | } | |
1782 | ||
1783 | var charstring vl_expectedEncodedPdu:="<r1:ElementContainingXhtml_1 xmlns:r1='www.XmlTest.org/complex_any'>\n\t<r1:FirstField>1st field</r1:FirstField>\n\t<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>\n\t<second xmlns=\"http://www.w3.org/1999/xhtml\" element=\"rabbit\"/>\n\t<r1:ThirdField>3rd field</r1:ThirdField>\n</r1:ElementContainingXhtml_1>\n\n"; | |
1784 | f_encDecTest_ElementContainingXhtml_1(vl_pdu,vl_expectedEncodedPdu, vl_pdu); | |
1785 | }//tc_ | |
1786 | ||
1787 | }//complexTypes | |
1788 | ||
1789 | //========================================================================= | |
1790 | // group Elements | |
1791 | //========================================================================= | |
1792 | group Elements{ | |
1793 | ||
1794 | //Passed | |
1795 | testcase tc_element_anyType_converter() runs on xmlTest_CT { | |
1796 | ||
1797 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_anyType.xsd","",c_shell_successWithoutWarningAndError) | |
1798 | ||
1799 | if(getverdict==pass) { | |
1800 | f_compareFiles( | |
1801 | "www_XmlTest_org_element_anyType_e.ttcn","www_XmlTest_org_element_anyType.ttcn", c_numOfDiff_headerAndModuleName); | |
1802 | } | |
1803 | }//tc_ | |
1804 | ||
3abe9331 | 1805 | testcase tc_element_attrib_qualified() runs on xmlTest_CT { |
1806 | ||
1807 | f_shellCommandWithVerdict("xsd2ttcn qualified_element_attrib.xsd","",c_shell_successWithoutWarningAndError) | |
1808 | ||
1809 | if(getverdict==pass) { | |
1810 | f_compareFiles( | |
1811 | "www_example_org_qualified_element_attrib_e.ttcn","www_example_org_qualified_element_attrib.ttcn", c_numOfDiff_headerAndModuleName); | |
1812 | } | |
1813 | }//tc_ | |
1814 | ||
1815 | testcase tc_element_attrib_unqualified() runs on xmlTest_CT { | |
1816 | ||
1817 | f_shellCommandWithVerdict("xsd2ttcn unqualified_element_attrib.xsd","",c_shell_successWithoutWarningAndError) | |
1818 | ||
1819 | if(getverdict==pass) { | |
1820 | f_compareFiles( | |
1821 | "www_example_org_unqualified_element_attrib_e.ttcn","www_example_org_unqualified_element_attrib.ttcn", c_numOfDiff_headerAndModuleName); | |
1822 | } | |
1823 | }//tc_ | |
1824 | ||
970ed795 EL |
1825 | //Passed TR: Hl29679 |
1826 | testcase tc_element_anyType_empty_encDec() runs on xmlTest_CT { | |
1827 | var Anything1 vl_pdu:= { attr:={},elem_list:={}}; | |
1828 | var charstring vl_expectedEncodedPdu:="<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType'/>\n\n" | |
1829 | f_encDecTest_Anything1(vl_pdu, vl_expectedEncodedPdu,vl_pdu); | |
1830 | }//tc_ | |
1831 | ||
1832 | //Passed | |
1833 | testcase tc_element_anyType_attrOnly_encDec() runs on xmlTest_CT { | |
1834 | var Anything1 vl_pdu:= { attr:={"name=\"First\""},elem_list:={}}; | |
1835 | var charstring vl_expectedEncodedPdu:= | |
1836 | "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType' name=\"First\"/>\n\n"; | |
1837 | f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_pdu); | |
1838 | }//tc_ | |
1839 | ||
1840 | testcase tc_element_anyType_2attrOnly_encDec() runs on xmlTest_CT { | |
1841 | var Anything1 vl_pdu:= { attr:={"name=\"Hunor\"","nationality=\"HU\""},elem_list:={}}; | |
1842 | var charstring vl_expectedEncodedPdu:= | |
1843 | "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType' name=\"Hunor\" nationality=\"HU\"/>\n\n"; | |
1844 | f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_pdu); | |
1845 | }//tc_ | |
1846 | ||
1847 | //Passed, TR: HL29711 | |
1848 | testcase tc_element_anyType_elemOnly_encDec() runs on xmlTest_CT { | |
1849 | var Anything1 vl_pdu:= { attr:={ }, elem_list:={"<MyElement1/>", "<MyElement2></MyElement2>"} }; | |
1850 | var charstring vl_expectedEncodedPdu:= | |
1851 | "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType'>\n\t<MyElement1/>\n\t<MyElement2></MyElement2>\n</ns31:anything1>\n\n" | |
1852 | var Anything1 vl_expectedDecodedPdu:= { attr:={ }, elem_list:={"<MyElement1/>", "<MyElement2/>"} }; | |
1853 | f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_expectedDecodedPdu); | |
1854 | }//tc_ | |
1855 | ||
1856 | testcase tc_element_anyType_encDec() runs on xmlTest_CT { | |
1857 | var Anything1 vl_pdu:= { | |
1858 | attr:={"name=\"Hunor\"","nationality=\"HU\""}, | |
1859 | elem_list:={"<MyElement1/>", "<MyElement2></MyElement2>"} }; | |
1860 | var charstring vl_expectedEncodedPdu:= | |
1861 | "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType' name=\"Hunor\" nationality=\"HU\">\n\t<MyElement1/>\n\t<MyElement2></MyElement2>\n</ns31:anything1>\n\n"; | |
1862 | var Anything1 vl_expectedDecodedPdu:= { | |
1863 | attr:={"name=\"Hunor\"","nationality=\"HU\""}, | |
1864 | elem_list:={"<MyElement1/>", "<MyElement2/>"} | |
1865 | }; | |
1866 | f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_expectedDecodedPdu); | |
1867 | }//tc_ | |
1868 | ||
1869 | //=============================================================== | |
1870 | // tc_element_anyType_deeper_encDec | |
1871 | //=============================================================== | |
1872 | testcase tc_element_anyType_deeper_encDec() runs on xmlTest_CT { | |
1873 | var Anything1 vl_pdu:= { | |
1874 | attr:={"name=\"Hunor\"","nationality=\"HU\""}, | |
1875 | elem_list:={"<MyElement1>\n\t<Level2>\n\t<Level3_1>Great</Level3_1>\n\t<Level3_2>Britain</Level3_2>\n\t</Level2>\n</MyElement1>", "<MyElement2><Level2>Goddag</Level2>\n</MyElement2>"} }; | |
1876 | ||
1877 | var charstring vl_expectedEncodedPdu:= | |
1878 | "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType' name=\"Hunor\" nationality=\"HU\">\n\t<MyElement1>\n\t<Level2>\n\t<Level3_1>Great</Level3_1>\n\t<Level3_2>Britain</Level3_2>\n\t</Level2>\n</MyElement1>\n\t<MyElement2><Level2>Goddag</Level2>\n</MyElement2>\n</ns31:anything1>\n\n" | |
1879 | f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_pdu); | |
1880 | }//tc_ | |
1881 | ||
1882 | ||
1883 | type record of charstring charstringList; | |
1884 | ||
1885 | //=============================================================== | |
1886 | // tc_element_anyType_longer_encDec | |
1887 | //=============================================================== | |
1888 | testcase tc_element_anyType_longer_encDec() runs on xmlTest_CT { | |
1889 | var charstringList vl_elementList:= { | |
1890 | "<MyElement1>\n\t<Level2>\n\t<Level3_1>Great</Level3_1>\n\t<Level3_2>Britain</Level3_2>\n\t</Level2>\n</MyElement1>", | |
1891 | "<MyElement2><Level2>Goddag</Level2>\n</MyElement2>", | |
1892 | "<MyElement3><Level2>Goddag</Level2>\n</MyElement3>", | |
1893 | "<MyElement4><Level2>Goddag</Level2>\n</MyElement4>" | |
1894 | }; | |
1895 | var Anything1 vl_pdu:= { | |
1896 | attr:={ | |
1897 | "name=\"Hunor\"", | |
1898 | "nationality=\"HU\"" | |
1899 | }, | |
1900 | elem_list:={ } | |
1901 | }; | |
1902 | ||
1903 | var charstring vl_expectedEncodedPdu:= | |
1904 | "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType' name=\"Hunor\" nationality=\"HU\">\n"; | |
1905 | ||
1906 | for(var integer i:=0;i<sizeof(vl_elementList);i:=i+1){ | |
1907 | vl_pdu.elem_list[i]:=vl_elementList[i]; | |
1908 | vl_expectedEncodedPdu:=vl_expectedEncodedPdu & "\t" & vl_elementList[i] & "\n"; | |
1909 | } | |
1910 | vl_expectedEncodedPdu:=vl_expectedEncodedPdu & "</ns31:anything1>\n\n" | |
1911 | ||
1912 | f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_pdu); | |
1913 | }//tc_ | |
1914 | ||
1915 | ||
1916 | //=============================================================== | |
1917 | // tc_element_recOfElements_converter | |
1918 | //=============================================================== | |
1919 | //Passed: TR: HL27438, Old name:tc_element_recOfElements_defaultAttr_converter | |
1920 | testcase tc_element_recOfElements_converter() runs on xmlTest_CT { | |
1921 | ||
1922 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements.xsd","",c_shell_successWithoutWarningAndError) | |
1923 | ||
1924 | if(getverdict==pass) { | |
1925 | f_compareFiles( | |
1926 | "www_XmlTest_org_element_recordOfElements_e.ttcn","www_XmlTest_org_element_recordOfElements.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1927 | } | |
1928 | }//tc_ | |
1929 | ||
1930 | //Passed, old name: tc_element_recOfElements | |
1931 | testcase tc_element_recOfElements_encDec() runs on xmlTest_CT { | |
1932 | f_encDecTest_PersonInfo1(); | |
1933 | f_encDecTest_PersonInfo2(); | |
1934 | f_encDecTest_PersonInfo2_omitOptionals(); | |
1935 | // } | |
1936 | }//tc_ | |
1937 | ||
1938 | //Passed, TR HL27452 | |
1939 | testcase tc_element_recOfElements_defaultAttr_encDec() runs on xmlTest_CT { | |
1940 | f_encDecTest_PersonInfo2_defaultAttribute(); | |
1941 | }//tc_ | |
1942 | ||
1943 | //Passed: TR:27484 | |
1944 | testcase tc_element_recOfElements_defaultElement() runs on xmlTest_CT { | |
1945 | ||
1946 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements.xsd","",c_shell_successWithoutWarningAndError) | |
1947 | ||
1948 | if(getverdict==pass) { | |
1949 | f_compareFiles( | |
1950 | "www_XmlTest_org_element_recordOfElements_e.ttcn","www_XmlTest_org_element_recordOfElements.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1951 | f_encDecTest_PersonInfo1_defaultElement(); | |
1952 | } | |
1953 | }//tc_ | |
1954 | ||
1955 | //Passed | |
1956 | testcase tc_element_recOfElements_minMaxOccurs() runs on xmlTest_CT { | |
1957 | ||
1958 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements4.xsd","",c_shell_successWithoutWarningAndError) | |
1959 | ||
1960 | if(getverdict==pass) { | |
1961 | f_compareFiles( | |
1962 | "www_XmlTest_org_element_recordOfElements4_e.ttcn","www_XmlTest_org_element_recordOfElements4.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1963 | f_encDecTest_PersonInfo4(); | |
1964 | } | |
1965 | }//tc_ | |
1966 | ||
1967 | //Passed, TR:HL28010 | |
1968 | testcase tc_element_recOfElements_maxOccursInfinity_converter() runs on xmlTest_CT { | |
1969 | ||
1970 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements3.xsd","",c_shell_successWithoutWarningAndError) | |
1971 | ||
1972 | if(getverdict==pass) { | |
1973 | f_compareFiles( | |
1974 | "www_XmlTest_org_element_recordOfElements3_e.ttcn","www_XmlTest_org_element_recordOfElements3.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1975 | } | |
1976 | ||
1977 | }//tc_ | |
1978 | ||
1979 | //Passed, TR: HL28024 | |
1980 | testcase tc_element_recOfElements_maxOccursInfinity_encoderDecoder() runs on xmlTest_CT { | |
1981 | ||
1982 | f_encDecTest_PersonInfo3(); | |
1983 | }//tc_ | |
1984 | ||
1985 | testcase tc_element_recOfElements_anonymousType_conv() runs on xmlTest_CT { | |
1986 | ||
1987 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements5.xsd","",c_shell_successWithoutWarningAndError) | |
1988 | ||
1989 | if(getverdict==pass) { | |
1990 | f_compareFiles( | |
1991 | "www_XmlTest_org_element_recordOfElements5_e.ttcn","www_XmlTest_org_element_recordOfElements5.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
1992 | } | |
1993 | ||
1994 | }//tc_ | |
1995 | ||
1996 | testcase tc_element_recOfElements_anonymousType_encDec() runs on xmlTest_CT { | |
1997 | f_encDecTest_PersonInfo5(); | |
1998 | }//tc_ | |
1999 | ||
2000 | ||
3abe9331 | 2001 | testcase tc_substitutiongroup() runs on xmlTest_CT { |
2002 | ||
2003 | f_shellCommandWithVerdict("xsd2ttcn substitutiongroup.xsd","",c_shell_successWithoutWarningAndError) | |
2004 | ||
2005 | if(getverdict==pass) { | |
2006 | f_compareFiles( | |
2007 | "www_example_org_substitutiongroup_e.ttcn","www_example_org_substitutiongroup.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
2008 | } | |
2009 | ||
2010 | }//tc_ | |
2011 | ||
2012 | testcase tc_substitutiongroup_abstract_block_rest() runs on xmlTest_CT { | |
2013 | ||
2014 | f_shellCommandWithVerdict("xsd2ttcn substitutiongroup_abstract_block_1.xsd","",c_shell_successWithWarning) | |
2015 | ||
2016 | if(getverdict==pass) { | |
2017 | f_compareFiles( | |
2018 | "www_example_org_substitutiongroup_abstract_block_1_e.ttcn", | |
2019 | "www_example_org_substitutiongroup_abstract_block_1.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
2020 | } | |
2021 | ||
2022 | }//tc_ | |
2023 | ||
2024 | testcase tc_substitutiongroup_abstract_block_ext() runs on xmlTest_CT { | |
2025 | ||
2026 | f_shellCommandWithVerdict("xsd2ttcn substitutiongroup_abstract_block_2.xsd","",c_shell_successWithWarning) | |
2027 | ||
2028 | if(getverdict==pass) { | |
2029 | f_compareFiles( | |
2030 | "www_example_org_substitutiongroup_abstract_block_2_e.ttcn", | |
2031 | "www_example_org_substitutiongroup_abstract_block_2.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
2032 | } | |
2033 | ||
2034 | }//tc_ | |
2035 | ||
2036 | testcase tc_substitutiongroup_complex_without_element() runs on xmlTest_CT { | |
2037 | ||
2038 | f_shellCommandWithVerdict("xsd2ttcn substitutiongroup_complex_without_element.xsd","",c_shell_successWithWarning) | |
2039 | ||
2040 | if(getverdict==pass) { | |
2041 | f_compareFiles( | |
2042 | "www_example_org_substitutiongroup_complex_without_element_e.ttcn", | |
2043 | "www_example_org_substitutiongroup_complex_without_element.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
2044 | } | |
2045 | ||
2046 | }//tc_ | |
2047 | ||
2048 | testcase tc_substitutiongroup_long_extension() runs on xmlTest_CT { | |
2049 | ||
2050 | f_shellCommandWithVerdict("xsd2ttcn substitutiongroup_complex_without_element.xsd","",c_shell_successWithWarning) | |
2051 | ||
2052 | if(getverdict==pass) { | |
2053 | f_compareFiles( | |
2054 | "www_example_org_substitutiongroup_complex_without_element_e.ttcn", | |
2055 | "www_example_org_substitutiongroup_complex_without_element.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
2056 | } | |
2057 | ||
2058 | }//tc_ | |
2059 | ||
2060 | testcase tc_substitutiongroup_neg() runs on xmlTest_CT { | |
2061 | ||
2062 | f_shellCommandWithVerdict("xsd2ttcn substitutiongroup_neg.xsd","",c_shell_error) | |
2063 | ||
2064 | }//tc_ | |
2065 | ||
2066 | testcase tc_substitutiongroup_diff_module() runs on xmlTest_CT { | |
2067 | ||
2068 | f_shellCommandWithVerdict("xsd2ttcn substitutiongroup_main.xsd substitutiongroup_ref.xsd","",c_shell_successWithWarning) | |
2069 | ||
2070 | if(getverdict==pass) { | |
2071 | f_compareFiles( | |
2072 | "www_example_org_substitutiongroup_ref_e.ttcn", | |
2073 | "www_example_org_substitutiongroup_ref.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
2074 | } | |
2075 | ||
2076 | if(getverdict==pass) { | |
2077 | f_compareFiles( | |
2078 | "www_example_org_substitutiongroup_main_e.ttcn", | |
2079 | "www_example_org_substitutiongroup_main.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
2080 | } | |
2081 | ||
2082 | }//tc_ | |
2083 | ||
2084 | ||
2085 | ||
970ed795 EL |
2086 | //======================================================== |
2087 | // tc_element_nameInheritance_conv | |
2088 | // Checks if name of named (aliased) type is not inherited | |
2089 | //======================================================== | |
2090 | testcase tc_element_nameInheritance_conv() runs on xmlTest_CT { | |
2091 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_nameInheritance.xsd","",c_shell_successWithoutWarningAndError); | |
2092 | }//tc_ | |
2093 | ||
2094 | //======================================== | |
2095 | // tc_element_nameInheritance_encDec | |
2096 | // Checks if name of named (aliased) type is not inherited | |
2097 | //======================================== | |
2098 | //TR HL49978 | |
2099 | testcase tc_element_nameInheritance_encDec() runs on xmlTest_CT { | |
2100 | f_encDecTest_nameInheritance(); | |
2101 | }//tc_ | |
2102 | ||
2103 | //======================================== | |
2104 | // tc_element_Tgc_encDec | |
2105 | // Checks if name of named (aliased) type is not inherited | |
2106 | //======================================== | |
2107 | //TR HL49978 | |
2108 | testcase tc_element_Tgc_encDec() runs on xmlTest_CT { | |
2109 | f_encDecTest_Tgc(); | |
2110 | }//tc_ | |
2111 | ||
3abe9331 | 2112 | //"Abstract" are not supported. Therefore converter sends WARNINGs |
970ed795 EL |
2113 | testcase tc_element_abstract_conv() runs on xmlTest_CT { |
2114 | f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_abstract.xsd","",c_shell_successWithWarning); | |
2115 | }//tc_ | |
2116 | ||
2117 | testcase tc_element_nillable_converter() runs on xmlTest_CT { | |
2118 | f_shellCommandWithVerdict("xsd2ttcn -z XmlTest_imsike.xsd","",c_shell_successWithoutWarningAndError ); | |
2119 | ||
2120 | if(getverdict==pass) { | |
2121 | f_compareFiles( | |
2122 | "XmlTest_imsike_e.ttcn","XmlTest_imsike.ttcn", c_numOfDiff_headerAndModuleName); | |
2123 | } | |
2124 | }//tc_ | |
2125 | ||
3abe9331 | 2126 | testcase tc_element_nillable_with_annotations() runs on xmlTest_CT { |
2127 | f_shellCommandWithVerdict("xsd2ttcn nillable_annotations.xsd","",c_shell_successWithoutWarningAndError ); | |
2128 | ||
2129 | if(getverdict==pass) { | |
2130 | f_compareFiles( | |
2131 | "nillable_annotations_e.ttcn","nillable_annotations.ttcn", c_numOfDiff_headerAndModuleName); | |
2132 | } | |
2133 | }//tc_ | |
2134 | ||
2135 | testcase tc_element_nillable_in_nillable_extension() runs on xmlTest_CT { | |
2136 | f_shellCommandWithVerdict("xsd2ttcn nillable_in_nillable_extension.xsd","",c_shell_successWithoutWarningAndError ); | |
2137 | ||
2138 | if(getverdict==pass) { | |
2139 | f_compareFiles( | |
2140 | "http_www_example_org_nillable_in_nillable_extension_e.ttcn", | |
2141 | "http_www_example_org_nillable_in_nillable_extension.ttcn", c_numOfDiff_headerAndModuleName); | |
2142 | } | |
2143 | }//tc_ | |
2144 | ||
2145 | testcase tc_element_attributegroup_nillable() runs on xmlTest_CT { | |
2146 | f_shellCommandWithVerdict("xsd2ttcn attributegroup_nillable.xsd","",c_shell_successWithoutWarningAndError ); | |
2147 | ||
2148 | if(getverdict==pass) { | |
2149 | f_compareFiles( | |
2150 | "www_example_org_type_attributegroup_nillable_e.ttcn", | |
2151 | "www_example_org_type_attributegroup_nillable.ttcn", c_numOfDiff_headerAndModuleName); | |
2152 | } | |
2153 | }//tc_ | |
2154 | ||
2155 | testcase tc_element_attributegroup_ingroup() runs on xmlTest_CT { | |
2156 | f_shellCommandWithVerdict("xsd2ttcn attribgroup_ingroup.xsd","",c_shell_successWithoutWarningAndError ); | |
2157 | ||
2158 | if(getverdict==pass) { | |
2159 | f_compareFiles( | |
2160 | "www_example_org_attribgroup_ingroup_e.ttcn", | |
2161 | "www_example_org_attribgroup_ingroup.ttcn", c_numOfDiff_headerModNameAndNamespace); | |
2162 | } | |
2163 | }//tc_ | |
2164 | ||
970ed795 EL |
2165 | //IndividualTrigger, nile="false" |
2166 | testcase tc_element_nillable_IndividualTrigger_nilFalse_encDec() runs on xmlTest_CT { | |
2167 | f_encDecTest_IndividualTrigger1(); | |
2168 | }//tc_ | |
2169 | ||
2170 | //IndividualTrigger, nil="true" | |
2171 | testcase tc_element_nillable_IndividualTrigger_nilTrue_encDec() runs on xmlTest_CT { | |
2172 | f_encDecTest_IndividualTrigger2(); //empty record | |
2173 | }//tc_ | |
2174 | ||
2175 | //Isp, nil="false" | |
2176 | testcase tc_element_nillable_Isp_nilFalse_encDec() runs on xmlTest_CT { | |
2177 | f_encDecTest_Isp1(); | |
2178 | }//tc_ | |
2179 | ||
2180 | //Isp, nil="true" | |
2181 | testcase tc_element_nillable_Isp_nilTrue_encDec() runs on xmlTest_CT { | |
2182 | f_encDecTest_Isp2(); | |
2183 | }//tc_ | |
2184 | ||
2185 | //RemarkNillable, nil="false" | |
2186 | testcase tc_element_nillable_RemarkNillable_nilFalse_encDec() runs on xmlTest_CT { | |
2187 | f_encDecTest_RemarkNillable1(); | |
2188 | }//tc_ | |
2189 | ||
2190 | //RemarkNillable, nil="true" | |
2191 | testcase tc_element_nillable_RemarkNillable_nilTrue_encDec() runs on xmlTest_CT { | |
2192 | f_encDecTest_RemarkNillable2(); | |
2193 | }//tc_ | |
2194 | ||
2195 | }//Element | |
2196 | ||
2197 | //========================================================================= | |
2198 | // Control | |
2199 | //========================================================================= | |
2200 | ||
2201 | control { | |
2202 | execute(tc_versionTest());//Passed | |
2203 | execute(tc_xsd2ttcn_versionTest());//Passed | |
2204 | //====My tcs==== | |
2205 | execute(tc_firstTrial());//Passed | |
2206 | execute(tc_secondTrial());//Passed | |
2207 | execute(tc_empty()); //Passed, TR: | |
2208 | //appended to increase coverage: | |
2209 | ||
2210 | execute(tc_annotation()); | |
2211 | execute(tc_annotation1()); | |
2212 | execute(tc_annotation2()); | |
3abe9331 | 2213 | execute(tc_xml_in_annotation()); |
970ed795 EL |
2214 | //option tests: |
2215 | execute(tc_version()); | |
2216 | execute(tc_options_c()); | |
2217 | execute(tc_options_e()); | |
2218 | execute(tc_options_f()); | |
3abe9331 | 2219 | execute(tc_options_g()); |
970ed795 EL |
2220 | execute(tc_options_p()); |
2221 | execute(tc_options_s()); | |
2222 | execute(tc_options_t()); | |
2223 | execute(tc_options_v()); | |
2224 | execute(tc_options_V()); | |
2225 | execute(tc_options_w()); | |
2226 | execute(tc_options_x()); | |
2227 | execute(tc_options_wrong()); | |
2228 | execute(tc_options_missing()); | |
2229 | //===LABEL and DEFINITION - unknown but used tags | |
2230 | ||
2231 | //===ttcn standard=== | |
2232 | execute(tc_XmlTest_all());//Passed | |
3abe9331 | 2233 | execute(tc_element_in_all_neg()); |
970ed795 EL |
2234 | execute(tc_XmlTest_any_anyAttribute());//Passed |
2235 | execute(tc_XmlTest_HQ73011());//Passed | |
3abe9331 | 2236 | execute(tc_anyattribute_optional()); |
2237 | execute(tc_anyattribute_single()); | |
2238 | execute(tc_anyattribute_in_complex()); | |
970ed795 EL |
2239 | execute(tc_XmlTest_attributeGroup());//Passed |
2240 | execute(tc_XmlTest_attribute_use_noTNS());//Passed | |
3abe9331 | 2241 | execute(tc_id_attribute()); |
2242 | execute(tc_attribute_order()); | |
2243 | execute(tc_name_conv_non_alphanumeric()); | |
2244 | execute(tc_module_name_convert_with_diff_namespace()); | |
2245 | execute(tc_module_typename_conversion()); | |
2246 | execute(tc_name_conv_remove_seq_of_low_line()); | |
2247 | execute(tc_name_conv_with_z()); | |
2248 | execute(tc_comment_placement()); | |
970ed795 EL |
2249 | |
2250 | //===W3C standard=== | |
2251 | ||
2252 | //===String=== | |
2253 | execute(tc_string()); //passed | |
2254 | execute(tc_string_withWhitespace());//Check it once again if encoder or decoder transform "content" !!! | |
2255 | execute(tc_string_withEnum());//Passed, TR: HL26227 | |
2256 | execute(tc_string_withPosLength());//TR: HL21257, | |
2257 | execute(tc_string_withEmptyLength()); //TR: HL20441, Solved | |
2258 | execute(tc_string_withNegativeLength());//Passed | |
2259 | execute(tc_string_withFixedLength()); //Passed | |
3abe9331 | 2260 | execute(tc_fixed_value()); |
970ed795 EL |
2261 | execute(tc_string_withFloatLength()); //passed ??? |
2262 | execute(tc_string_withPosMinLength()); //Passed, TR: HL21690 | |
2263 | execute(tc_string_withEmptyMin());//Passed | |
2264 | execute(tc_string_withNegativeMin());//Passed | |
2265 | execute(tc_string_withPosMax())//Passed | |
2266 | execute(tc_string_withEmptyMax());//Passed | |
2267 | execute(tc_string_withNegativeMax());//Passed | |
2268 | execute(tc_string_withFaultyMinMaxLength());//Passed, TR: TODO | |
2269 | execute(tc_string_withOverDefinition()); //TR: HL25948, Solved | |
2270 | execute(tc_string_withTypeAndBase());//Passed | |
3abe9331 | 2271 | //TODO: put this test back later |
2272 | //execute(tc_string_pattern_square_brackets()); | |
970ed795 EL |
2273 | //===Boolean=== |
2274 | execute(tc_boolean());//Passed | |
3abe9331 | 2275 | execute(tc_boolean_variant_commented()); |
970ed795 EL |
2276 | //===Decimal=== |
2277 | execute(tc_decimal());//Passed | |
2278 | //execute(tc_decimal_withLength()); length not supported | |
2279 | execute(tc_decimal_withMinMaxInclusive());//TR: HL20715 | |
2280 | execute(tc_decimal_withMinMaxExclusive());//Passed TR: HL21166 -solved | |
2281 | execute(tc_decimal_withEnum()); //Passed,TR HL21196 -solved | |
3abe9331 | 2282 | execute(tc_decimal_fractiondigits()); |
970ed795 EL |
2283 | //===Integer=== |
2284 | execute(tc_integer());//Passed | |
2285 | execute(tc_integer_empty1());//Passed | |
2286 | execute(tc_integer_withEnum()); //Passed, TR:HL21694 -solved | |
2287 | execute(tc_integer_withMinIncl());//Passed | |
2288 | execute(tc_integer_withMaxIncl());//Passed | |
2289 | execute(tc_integer_withMinExcl());//Passed | |
2290 | execute(tc_integer_withMaxExcl());//Passed | |
2291 | //===Time=== | |
2292 | execute(tc_time());//passed | |
2293 | execute(tc_time_withEnum());//Passed TR HL22058 | |
2294 | //==list=== | |
2295 | execute(tc_list_conv()); //Passed | |
2296 | execute(tc_list_encDec());//Passed | |
2297 | execute(tc_integerList());//Passed | |
3abe9331 | 2298 | execute(tc_list_simpletype());//Passed |
2299 | //===Float=== | |
2300 | execute(tc_float_not_a_number()); | |
970ed795 EL |
2301 | |
2302 | //===simpleType enum==== | |
2303 | execute(tc_simpleType_enum());//Passed | |
3abe9331 | 2304 | execute(tc_simpleType_restrict_comp()); |
2305 | execute(tc_simpleType_ref()); | |
2306 | execute(tc_simpleType_base()); | |
2307 | execute(tc_enum_field_names()); | |
970ed795 EL |
2308 | //===union=== |
2309 | execute(tc_union());//TR:HL23577 | |
2310 | execute(tc_union_optional());//CR_TR18883 | |
3abe9331 | 2311 | execute(tc_enumeration_union_restriction()); |
2312 | execute(tc_enumeration_union_restriction2()); | |
2313 | execute(tc_enumeration_remove_dup()); | |
970ed795 EL |
2314 | //===complex=== |
2315 | execute(tc_complex1()); //Passed | |
2316 | execute(tc_complex2());//TR: HL24977 | |
2317 | execute(tc_complex_simpleContent()); | |
3abe9331 | 2318 | execute(tc_complex_namespaceas()); |
970ed795 | 2319 | execute(tc_complex_mixed_conv()); //Passed |
3abe9331 | 2320 | execute(tc_complex_group_reference()); |
970ed795 | 2321 | execute(tc_complex_mixed_encDec()); //TR:HL29258 - Rejected. Reason: Not supported feature, TODO:Write CR!! |
3abe9331 | 2322 | execute(tc_complex_seq_embeds_seq()); |
970ed795 EL |
2323 | execute(tc_complex_choice_converter());//Passed |
2324 | execute(tc_complex_choice_encDec());//Passed | |
2325 | ||
2326 | execute(tc_complex_all_converter());//Passed | |
2327 | execute(tc_complex_all_emptySet_encDec());//Passed | |
2328 | execute(tc_complex_all_fullSet_encDec());//Passed | |
2329 | execute(tc_complex_all_subSet_encDec());//Passed | |
2330 | execute(tc_complex_all_inconsistentSet_encDec());//Passed | |
2331 | execute(tc_complex_all_noOptional_pos_encDec()); //Passed | |
2332 | execute(tc_complex_all_noOptional_neg1_encDec()); //Error, TR: HL32978 | |
2333 | execute(tc_complex_all_noOptional_neg2_encDec()); //Failed, TR: HL32978 | |
2334 | execute(tc_complex_all_noOptional_neg3_encDec()); //Failed, TR: HL32978 | |
2335 | execute(tc_complex_all_noOptional_empty_encDec()); //Failed, TR: HL32978 | |
2336 | execute(tc_complex_minOccursMaxOccurs()); //Passed, TR (ethgry): HL10386 | |
2337 | execute(tc_complex_extension_converter()); //TR HL32505 | |
2338 | execute(tc_complex_extension_encDec()); //Passed | |
3abe9331 | 2339 | execute(tc_complex_extension_name_attrib_convert()); |
2340 | execute(tc_complex_long_extension()); | |
2341 | execute(tc_type_name_conversion_follow()); | |
2342 | execute(tc_complex_extension_with_attrib()); | |
2343 | execute(tc_extension_restriction_with_attrib()); | |
2344 | execute(tc_attrib_enum()); | |
2345 | execute(tc_complex_self_recursion()); | |
970ed795 | 2346 | execute(tc_complex_restriction_converter()); //Failed, TR HL32896 |
3abe9331 | 2347 | execute(tc_complex_restriction_with_use()); |
2348 | execute(tc_complex_nillable()); | |
2349 | execute(tc_nillable_fixed()); | |
2350 | execute(tc_no_ns_connector()); | |
970ed795 EL |
2351 | |
2352 | ||
2353 | ||
3abe9331 | 2354 | //execute(tc_complex_restriction_encDec()); Dynamic test case error:Attempt to XER-encode an unbound record of |
970ed795 EL |
2355 | |
2356 | ||
2357 | ||
2358 | ||
2359 | execute(tc_complex_restriction_neg1_converter());//TR: HL32948 | |
2360 | execute(tc_complex_restriction_neg2_converter());//TR: HL32948 | |
2361 | execute(tc_complex_unique_converter()); | |
2362 | execute(tc_complex_include_converter()); | |
2363 | execute(tc_complex_include_neg1_converter()); | |
2364 | execute(tc_complex_import_pos1_converter()); | |
2365 | execute(tc_complex_import_pos2_converter()); | |
2366 | execute(tc_complex_import_neg1_converter()); | |
2367 | execute(tc_complex_import_withSL_converter());//SchemaLocation | |
3abe9331 | 2368 | execute(tc_complex_import_withSL_encDec()); |
970ed795 EL |
2369 | execute(tc_complex_import_nameCollision_converter()); |
2370 | execute(tc_complex_import_nameCollision2_converter()); | |
2371 | execute(tc_complex_any_pos_converter()); | |
3abe9331 | 2372 | execute(tc_imported_type_prefix()); |
970ed795 EL |
2373 | execute(tc_complex_any_pos1_encDec()); //Failed, TR: HL37887 |
2374 | execute(tc_complex_any_pos2_encDec()); | |
2375 | execute(tc_complex_any_pos3_encDec());//failed, TR: | |
2376 | //===element=== | |
2377 | execute(tc_element_anyType_converter());//Passed | |
3abe9331 | 2378 | execute(tc_element_attrib_qualified()); |
2379 | execute(tc_element_attrib_unqualified()); | |
970ed795 EL |
2380 | execute(tc_element_anyType_empty_encDec());//Passed TR: HL29679 |
2381 | execute(tc_element_anyType_attrOnly_encDec());//Passed | |
2382 | execute(tc_element_anyType_2attrOnly_encDec());//Passed | |
2383 | execute(tc_element_anyType_elemOnly_encDec());//Passed, TR: HL29711 | |
2384 | execute(tc_element_anyType_encDec());//Passed, HL29711 | |
2385 | execute(tc_element_anyType_deeper_encDec()); | |
2386 | execute(tc_element_anyType_longer_encDec()); | |
2387 | execute(tc_element_recOfElements_converter()); //Passed: TR: HL27438 | |
2388 | execute(tc_element_recOfElements_encDec());//Passed | |
2389 | execute(tc_element_recOfElements_defaultAttr_encDec());//Passed, TR HL27452 | |
2390 | execute(tc_element_recOfElements_defaultElement());//Passed: TR:27484 | |
2391 | execute(tc_element_recOfElements_maxOccursInfinity_converter());//Passed, TR:HL28010 | |
2392 | execute(tc_element_recOfElements_maxOccursInfinity_encoderDecoder());//Passed, TR: HL2802 | |
2393 | execute(tc_element_recOfElements_anonymousType_conv()); | |
2394 | execute(tc_element_recOfElements_anonymousType_encDec()); | |
2395 | ||
3abe9331 | 2396 | |
2397 | //===substitutiongroup=== | |
2398 | execute(tc_substitutiongroup()); | |
2399 | execute(tc_substitutiongroup_abstract_block_rest()); | |
2400 | execute(tc_substitutiongroup_abstract_block_ext()); | |
2401 | execute(tc_substitutiongroup_complex_without_element()); | |
2402 | execute(tc_substitutiongroup_long_extension()); | |
2403 | execute(tc_substitutiongroup_neg()); | |
2404 | execute(tc_substitutiongroup_diff_module()); | |
2405 | ||
2406 | ||
2407 | ||
970ed795 EL |
2408 | execute(tc_element_nameInheritance_conv()); |
2409 | execute(tc_element_nameInheritance_encDec());//TR HL49978 | |
2410 | execute(tc_element_Tgc_encDec());//TR HL49978 | |
2411 | execute(tc_element_abstract_conv()); //Not supported features | |
2412 | execute(tc_element_nillable_converter()); | |
3abe9331 | 2413 | execute(tc_element_nillable_with_annotations()); |
2414 | execute(tc_element_nillable_in_nillable_extension()); | |
2415 | execute(tc_element_attributegroup_nillable()); | |
2416 | execute(tc_element_attributegroup_ingroup()); | |
970ed795 EL |
2417 | execute(tc_element_nillable_IndividualTrigger_nilFalse_encDec()); |
2418 | execute(tc_element_nillable_IndividualTrigger_nilTrue_encDec()); | |
2419 | execute(tc_element_nillable_Isp_nilFalse_encDec()); | |
2420 | execute(tc_element_nillable_Isp_nilTrue_encDec()); | |
2421 | execute(tc_element_nillable_RemarkNillable_nilFalse_encDec()); | |
2422 | execute(tc_element_nillable_RemarkNillable_nilTrue_encDec()); | |
2423 | } | |
2424 | ||
2425 | } with { | |
2426 | extension "version R1A02"; // a prerelease version | |
2427 | extension "requiresTITAN R1C01"; | |
2428 | } // end of module |