Titan Core Initial Contribution
[deliverable/titan.core.git] / regression_test / XML / XmlWorkflow / src / xmlTest_Testcases.ttcn
CommitLineData
970ed795
EL
1/******************************************************************************
2 * Copyright (c) 2000-2014 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 ******************************************************************************/
8
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
18module xmlTest_Testcases
19{
20
21//=========================================================================
22// Import Part
23//=========================================================================
24//import from XSD all;
25import from PIPEasp_Types all;
26import from PIPEasp_PortType all;
27import from PIPEasp_Templates all;
28import from xmlTest_Shell all;
29
30import from www_XmlTest_org_element_anyType_e all;
31import from www_XmlTest_org_complex_all_e all;
32import from www_XmlTest_org_complex_extension_e all;
33import from www_XmlTest_org_complex_restriction_e all;
34import from www_XmlTest_org_complex_import_e all;
35import from www_XmlTest_org_complex_any_e all;
36
37import from xmlTest_Functions_string all;
38import from xmlTest_Functions_complex1 all;
39import from xmlTest_Functions_complex2 all;
40import from xmlTest_Functions_complex all;
41import from xmlTest_Functions_element all;
42import 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
77type component xmlTest_CT extends Shell_CT {}
78
79type 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//=========================================================================
106function 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
121function 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//=========================================================================
148testcase tc_versionTest() runs on xmlTest_CT
149{
150 f_shellCommandWithVerdict("compiler -v","",0)
151}
152
153testcase tc_xsd2ttcn_versionTest() runs on xmlTest_CT
154{
155 f_shellCommandWithVerdict("xsd2ttcn -v","",0)
156}
157
158//simple records
159testcase tc_firstTrial() runs on xmlTest_CT
160{
161 f_shellCommandWithVerdict("xsd2ttcn elements.xsd","",c_shell_successWithWarning)
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
166testcase tc_secondTrial() runs on xmlTest_CT
167{
168 f_shellCommandWithVerdict("xsd2ttcn po.xsd noTargetNamespace.xsd","",c_shell_successWithoutWarningAndError)
169}
170testcase 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
180testcase tc_annotation() runs on xmlTest_CT
181{
182 f_shellCommandWithVerdict("xsd2ttcn XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError);
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
189testcase tc_annotation1() runs on xmlTest_CT
190{
191 f_shellCommandWithVerdict("xsd2ttcn XmlTest_annotation1.xsd","",c_shell_successWithoutWarningAndError);
192}
193
194testcase tc_annotation2() runs on xmlTest_CT
195{
196 f_shellCommandWithVerdict("xsd2ttcn XmlTest_annotation2.xsd","",c_shell_error);
197}
198
199//Incorrect version: 1.1
200testcase tc_version() runs on xmlTest_CT
201{
202 f_shellCommandWithVerdict("xsd2ttcn XmlTest_version.xsd","",c_shell_successWithWarning);
203}
204
205//************************************
206// === Converter switch tests: ===
207//************************************
208// usage: xsd2ttcn [-cepstVwx] [-f file] schema.xsd ...
209// or xsd2ttcn -v
210//
211// OPTIONS:
212// -c: disable the generation of comments in TTCN-3 modules
213// -e: disable the generation of encoding instructions in TTCN-3 modules
214// -f file: the XSD files are taken from file instead of the command line
215// -p: do not generate the UsefulTtcn3Types and XSD predefined modules
216// -q: quiet - disable the issue of status messages
217// -s: parse and validate only - no TTCN-3 module generation
218// -t: disable the generation of timing information in TTCN-3 modules
219// -v: show version information
220// -w: suppress warnings
221// -x: disable schema validation but generate TTCN-3 modules
222
223//TODO:Not ready yet
224testcase tc_options_c() runs on xmlTest_CT
225{
226 f_shellCommandWithVerdict("xsd2ttcn -c XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError );
227 if(getverdict==pass) {
228 f_compareFiles("www_XmlTest_org_annotation_c_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace);
229 }
230}
231
232// -e: disable the generation of encoding instructions in TTCN-3 modules
233testcase tc_options_e() runs on xmlTest_CT
234{
235 f_shellCommandWithVerdict("xsd2ttcn -e XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError );
236 if(getverdict==pass) {
237 f_compareFiles("www_XmlTest_org_annotation_e_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace);
238 }
239}
240
241// -f file: the XSD files are taken from file instead of the command line
242testcase tc_options_f() runs on xmlTest_CT
243{
244 f_shellCommandWithVerdict("xsd2ttcn -f XmlTest_files1.txt","",c_shell_successWithoutWarningAndError );
245 if(getverdict==pass) {
246 f_compareFiles("www_XmlTest_org_annotation_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace);
247 }
248}
249
250//TODO: more filename in XmlTest_files2.txt
251// testcase tc_options_f() runs on xmlTest_CT
252// {
253// f_shellCommandWithVerdict("xsd2ttcn -f XmlTest_files1.txt","",c_shell_successWithoutWarningAndError );
254// if(getverdict==pass) {
255// f_compareFiles("www_XmlTest_org_annotation_e.ttcn)","www_XmlTest_org_annotation.ttcn)", c_numOfDiff_headerModNameAndNamespace);
256// }
257// }
258
259//-p: do not generate the UsefulTtcn3Types and XSD predefined modules
260testcase tc_options_p() runs on xmlTest_CT
261{
262 f_shellCommandWithVerdict("mv www_XmlTest_org_annotation.ttcn tmp_www_XmlTest_org_annotation.ttcn","",c_shell_successWithoutWarningAndError );
263 f_shellCommandWithVerdict("mv XSD.ttcn tmp_XSD.ttcn","",c_shell_successWithoutWarningAndError );
264 f_shellCommandWithVerdict("mv UsefulTtcn3Types.ttcn tmp_UsefulTtcn3Types.ttcn","",c_shell_successWithoutWarningAndError );
265
266 f_shellCommandWithVerdict("xsd2ttcn -p XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError );
267 if(getverdict==pass) {
268 f_shellCommandWithVerdict("ls www_XmlTest_org_annotation.ttcn", "",c_shell_successWithoutWarningAndError);
269 f_shellCommandWithVerdict("ls XSD.ttcn", "",c_shell_error_noSuchFileOrDirectory );
270 f_shellCommandWithVerdict("ls UsefulTtcn3Types.ttcn.ttcn","", c_shell_error_noSuchFileOrDirectory );
271 }
272
273 f_shellCommandWithVerdict("mv tmp_www_XmlTest_org_annotation.ttcn www_XmlTest_org_annotation.ttcn","",c_shell_successWithoutWarningAndError );
274 f_shellCommandWithVerdict("mv tmp_XSD.ttcn XSD.ttcn","",c_shell_successWithoutWarningAndError );
275 f_shellCommandWithVerdict("mv tmp_UsefulTtcn3Types.ttcn UsefulTtcn3Types.ttcn","",c_shell_successWithoutWarningAndError );
276}
277
278//-s: parse and validate only - no TTCN-3 module generation
279testcase tc_options_s() runs on xmlTest_CT
280{
281 f_shellCommandWithVerdict("mv www_XmlTest_org_annotation.ttcn tmp_www_XmlTest_org_annotation.ttcn","",c_shell_successWithoutWarningAndError );
282 f_shellCommandWithVerdict("mv XSD.ttcn tmp_XSD.ttcn","",c_shell_successWithoutWarningAndError );
283 f_shellCommandWithVerdict("mv UsefulTtcn3Types.ttcn tmp_UsefulTtcn3Types.ttcn","",c_shell_successWithoutWarningAndError );
284
285 f_shellCommandWithVerdict("xsd2ttcn -s XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError );
286 //TODO:test if wrong xsd causes conversion error wit this switch
287
288 //test if www_XmlTest_org_annotation.ttcn.ttcn, XSD.ttcn and UsefulTtcn3Types.ttcn exist:
289 if(getverdict==pass) {
290 f_shellCommandWithVerdict("ls www_XmlTest_org_annotation.ttcn", "", c_shell_error_noSuchFileOrDirectory );
291 f_shellCommandWithVerdict("ls XSD.ttcn", "",c_shell_error_noSuchFileOrDirectory );
292 f_shellCommandWithVerdict("ls UsefulTtcn3Types.ttcn.ttcn","", c_shell_error_noSuchFileOrDirectory );
293 }
294 f_shellCommandWithVerdict("mv tmp_www_XmlTest_org_annotation.ttcn www_XmlTest_org_annotation.ttcn","",c_shell_successWithoutWarningAndError );
295 f_shellCommandWithVerdict("mv tmp_XSD.ttcn XSD.ttcn","",c_shell_successWithoutWarningAndError );
296 f_shellCommandWithVerdict("mv tmp_UsefulTtcn3Types.ttcn UsefulTtcn3Types.ttcn","",c_shell_successWithoutWarningAndError );
297}
298
299//Ready
300// -t: disable the generation of timing information in TTCN-3 modules
301testcase tc_options_t() runs on xmlTest_CT
302{
303 f_shellCommandWithVerdict("xsd2ttcn -t XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError );
304 if(getverdict==pass) {
305 f_compareFiles("www_XmlTest_org_annotation_t_e.ttcn","www_XmlTest_org_annotation.ttcn", c_numOfDiff_headerModNameAndNamespace);
306 }
307}
308
309// -v: show version information
310//TODO:Not ready yet
311testcase tc_options_v() runs on xmlTest_CT
312{
313 f_shellCommandWithVerdict("xsd2ttcn -v","",c_shell_successWithoutWarningAndError );
314}
315
316//TODO:Not ready yet
317// -q: quiet - disable the issue of status messages
318testcase tc_options_V() runs on xmlTest_CT
319{
320 f_shellCommandWithVerdict("xsd2ttcn -q XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError );
321}
322
323//TODO:Not ready yet
324// -w: suppress warnings
325testcase tc_options_w() runs on xmlTest_CT
326{
327 f_shellCommandWithVerdict("xsd2ttcn -w XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError );
328}
329
330//TODO:Not ready yet
331// -x: disable schema validation but generate TTCN-3 modules
332testcase tc_options_x() runs on xmlTest_CT
333{
334 f_shellCommandWithVerdict("xsd2ttcn -x XmlTest_annotation.xsd","",c_shell_successWithoutWarningAndError );
335}
336
337testcase tc_options_wrong() runs on xmlTest_CT
338{
339 f_shellCommandWithVerdict("xsd2ttcn -H XmlTest_annotation.xsd","", c_shell_error);
340}
341
342testcase tc_options_missing() runs on xmlTest_CT
343{
344 f_shellCommandWithVerdict("xsd2ttcn ","",c_shell_successWithoutWarningAndError );
345 //TODO: check the output
346}
347
348
349testcase tc_XmlTest_label() runs on xmlTest_CT
350{
351 f_shellCommandWithVerdict("xsd2ttcn -x XmlTest_label.xsd","",c_shell_successWithoutWarningAndError );
352}
353
354testcase tc_XmlTest_definition() runs on xmlTest_CT
355{
356 f_shellCommandWithVerdict("xsd2ttcn -x XmlTest_definition.xsd","",c_shell_successWithoutWarningAndError );
357}
358//************************************
359// Testcases_basedOnTtcnStandard9
360//************************************
361group Testcases_basedOnTtcnStandard9 {
362
363 //Passed
364 testcase tc_XmlTest_all() runs on xmlTest_CT
365 {
366 f_shellCommandWithVerdict("xsd2ttcn all.xsd","",c_shell_successWithoutWarningAndError);
367 }
368
369 //Passed
370 testcase tc_XmlTest_any_anyAttribute() runs on xmlTest_CT
371 {
372 f_shellCommandWithVerdict("xsd2ttcn any_anyAttribute.xsd","",c_shell_successWithoutWarningAndError);
373 }
374
375 //HQ73011
376 //Heading: XSD anyAtribute is inserted into a wrong place
377 //Passed
378 testcase tc_XmlTest_HQ73011() runs on xmlTest_CT
379 {
380 f_shellCommandWithVerdict("xsd2ttcn HQ73011.xsd","",c_shell_successWithoutWarningAndError);
381 if(getverdict==pass) {
382 f_compareFiles(
383 "urn_ietf_params_xml_ns_conference_info_e.ttcn","urn_ietf_params_xml_ns_conference_info.ttcn", c_numOfDiff_headerAndModuleName);
384 }
385 }
386
387 //Passed
388 testcase tc_XmlTest_attributeGroup() runs on xmlTest_CT
389 {
390 f_shellCommandWithVerdict("xsd2ttcn attributeGroup.xsd","",c_shell_successWithoutWarningAndError);
391 }
392
393 //double schema definition - Validator Returns with Error, Passed
394 testcase tc_XmlTest_attribute_use_noTNS() runs on xmlTest_CT
395 {
396 f_shellCommandWithVerdict("xsd2ttcn attribute_use_noTNS.xsd","",c_shell_error);
397 }
398
399}//group
400
401//************************************
402// Testcases based on W3C standards
403//************************************
404
405//******************************
406// StringTest
407//******************************
408group StringTest {
409
410 //=== Correct string type definitions: ====
411 //TR HL21086 - whitespace preserve. TODO: standalone testcase
412 testcase tc_string() runs on xmlTest_CT
413 {
414 f_shellCommandWithVerdict("xsd2ttcn -z XmlTest_string.xsd","",c_shell_successWithoutWarningAndError)
415 if(getverdict==pass) {
416 f_compareFiles(
417 "www_XmlTest_org_string.ttcn",
418 "www_XmlTest_org_string_e.ttcn", c_numOfDiff_headerModNameAndNamespace);
419 }
420////////////////////////////////////////////
421//
422// f_encDecTest_NameA();
423// f_encDecTest_NameB();
424// f_encDecTest_Non_empty_string();
425// f_encDecTest_Type();
426//
427////////////////////////////////////////////
428 }
429
430 //Passed, TR: Hl21086 - Solved
431 testcase tc_string_withWhitespace() runs on xmlTest_CT
432 {
433 f_shellCommandWithVerdict("xsd2ttcn -z XmlTest_string_withWhitespace.xsd","",c_shell_successWithoutWarningAndError)
434 if(getverdict==pass) {
435 f_compareFiles(
436 "www_XmlTest_org_string_withWhitespace.ttcn",
437 "www_XmlTest_org_string_withWhitespace_e.ttcn", c_numOfDiff_headerAndModuleName);
438 }
439 f_encDecTest_StringWhiteSpaceP();
440 f_encDecTest_StringWhiteSpaceR();
441 f_encDecTest_StringWhiteSpaceC();
442 }
443
444 //Passed, TR: HL26227 -Solved BUT rethink if variant part is well ordered or not!!
445 testcase tc_string_withEnum() runs on xmlTest_CT
446 {
447 f_shellCommandWithVerdict("xsd2ttcn -z XmlTest_string_withEnum.xsd","",c_shell_successWithoutWarningAndError)
448 if(getverdict==pass) {
449 f_compareFiles(
450 "www_XmlTest_org_string_withEnum.ttcn",
451 "www_XmlTest_org_string_withEnum_e.ttcn", c_numOfDiff_headerAndModuleName);
452 }
453 f_encDecTest_StringEnum();
454 }
455 //TODO: Write length of child restriction tests based on tc_string!!!
456
457 //=== Length restriction tests ===
458
459
460
461 //=== Faulty String definitions: =========
462
463 //===length===
464 //TR: HL21257 --Solved
465 testcase tc_string_withPosLength() runs on xmlTest_CT
466 {
467 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withPosLength.xsd","",c_shell_successWithoutWarningAndError);
468 if(getverdict==pass) {
469 f_compareFiles(
470 "www_XmlTest_org_string_withPosLength.ttcn",
471 "www_XmlTest_org_string_withPosLength_e.ttcn", c_numOfDiff_headerAndModuleName);
472 }
473 }
474
475 //Passed, returs with error
476 testcase tc_string_withEmptyLength() runs on xmlTest_CT
477 {
478 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withEmptyLength.xsd","",c_shell_error)
479 }
480
481 testcase tc_string_withNegativeLength() runs on xmlTest_CT
482 {
483 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withNegativeLength.xsd","",c_shell_error)
484 }
485
486 //Passed
487 testcase tc_string_withFixedLength() runs on xmlTest_CT
488 {
489 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withFixedLength.xsd","",c_shell_error)
490 }
491
492 //Passed
493 testcase tc_string_withFloatLength() runs on xmlTest_CT
494 {
495 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withFloatLength.xsd","", c_shell_error)
496 }
497
498 //===minLength===
499 //Passed, TR: HL21690
500 testcase tc_string_withPosMinLength() runs on xmlTest_CT
501 {
502 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withMinLength.xsd","",c_shell_successWithoutWarningAndError)
503 if(getverdict==pass) {
504 f_compareFiles(
505 "www_XmlTest_org_string_withMinLength.ttcn",
506 "www_XmlTest_org_string_withMinLength_e.ttcn", c_numOfDiff_headerAndModuleName);
507 }
508 }
509
510 //Passed
511 testcase tc_string_withEmptyMin() runs on xmlTest_CT
512 {
513 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withEmptyMin.xsd","",c_shell_error)
514 }
515
516 //Passed
517 testcase tc_string_withNegativeMin() runs on xmlTest_CT
518 {
519 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withNegativeMin.xsd","",c_shell_error)
520 }
521
522 //===maxLength===
523 //Passed
524 testcase tc_string_withPosMax() runs on xmlTest_CT
525 {
526 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withPosMax.xsd","",c_shell_successWithoutWarningAndError);
527 if(getverdict==pass) {
528 f_compareFiles(
529 "www_XmlTest_org_string_withPosMax_e.ttcn","www_XmlTest_org_string_withPosMax.ttcn", c_numOfDiff_headerAndModuleName);
530 }
531 }
532
533 //Passed
534 testcase tc_string_withEmptyMax() runs on xmlTest_CT
535 {
536 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withEmptyMax.xsd","",c_shell_error)
537 }
538
539 //Passed
540 testcase tc_string_withNegativeMax() runs on xmlTest_CT
541 {
542 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withNegativeMax.xsd","",c_shell_error)
543 }
544 //=== minLength>maxLength
545 //Passed, TR:
546 testcase tc_string_withFaultyMinMaxLength() runs on xmlTest_CT
547 {
548 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withFaultyMinMax.xsd","",c_shell_error)
549 }
550 //Passed
551 testcase tc_string_withOverDefinition() runs on xmlTest_CT
552 {
553 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withOverDefinition.xsd","",c_shell_error)
554 }
555
556 testcase tc_string_withTypeAndBase() runs on xmlTest_CT
557 {
558 f_shellCommandWithVerdict("xsd2ttcn XmlTest_string_withTypeAndBase.xsd","",c_shell_error)
559 }
560}//StringTest
561
562//******************************
563// BooleanTest
564//******************************
565group BooleanTest {
566
567 //TODO: check warning sending for not supported:features
568 testcase tc_boolean() runs on xmlTest_CT {
569 f_shellCommandWithVerdict("xsd2ttcn XmlTest_boolean.xsd","",c_shell_successWithoutWarningAndError)
570 if(getverdict==pass) {
571 f_compareFiles(
572 "www_XmlTest_org_boolean_e.ttcn","www_XmlTest_org_boolean.ttcn", c_numOfDiff_headerAndModuleName);
573 }
574 }
575}//BooleanTest
576
577
578//******************************
579// DecimalTest
580//******************************
581group DecimalTest {
582
583 //Passed
584 testcase tc_decimal() runs on xmlTest_CT {
585 f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal.xsd","",c_shell_successWithoutWarningAndError)
586 if(getverdict==pass) {
587 f_compareFiles(
588 "www_XmlTest_org_decimal_e.ttcn",
589 "www_XmlTest_org_decimal.ttcn", c_numOfDiff_headerAndModuleName);
590 }
591 }
592
593 //!!!!!Length not supported!!!!
594 // testcase tc_decimal_withLength() runs on xmlTest_CT {
595 // f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal_withLength.xsd","",c_shell_successWithoutWarningAndError)
596 // if(getverdict==pass) {
597 // f_compareFiles(
598 // "www_XmlTest_org_decimal_withLength_e.ttcn",
599 // "www_XmlTest_org_decimal_withLength.ttcn", c_numOfDiff_headerAndModuleName);
600 // }
601 // }
602
603 //TR: Generates integer limits instead of decimal
604 //TR: HL2715 -Solved
605 testcase tc_decimal_withMinMaxInclusive() runs on xmlTest_CT {
606 f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal_withMinMaxInclusive.xsd","",c_shell_successWithoutWarningAndError)
607
608 if(getverdict==pass) {
609 f_compareFiles(
610 "www_XmlTest_org_decimal_withMinMaxInclusive_e.ttcn",
611 "www_XmlTest_org_decimal_withMinMaxInclusive.ttcn", c_numOfDiff_headerAndModuleName);
612 }
613 }//tc_
614
615 //TR21266 -Solved
616 testcase tc_decimal_withMinMaxExclusive() runs on xmlTest_CT {
617 f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal_withMinMaxExclusive.xsd","",c_shell_successWithoutWarningAndError)
618
619 if(getverdict==pass) {
620 f_compareFiles(
621 "www_XmlTest_org_decimal_withMinMaxExclusive_e.ttcn",
622 "www_XmlTest_org_decimal_withMinMaxExclusive.ttcn", c_numOfDiff_headerAndModuleName);
623 }
624 }//tc_
625
626 //TR HL21296
627 testcase tc_decimal_withEnum() runs on xmlTest_CT {
628 f_shellCommandWithVerdict("xsd2ttcn XmlTest_decimal_withEnum.xsd","",c_shell_successWithoutWarningAndError)
629
630 if(getverdict==pass) {
631 f_compareFiles(
632 "www_XmlTest_org_decimal_withEnum_e.ttcn",
633 "www_XmlTest_org_decimal_withEnum.ttcn", c_numOfDiff_headerAndModuleName);
634 }
635 }
636}//DecimalTest
637
638//******************************
639// IntegerTest
640// Based on (XSD_2)/3.3.13 and (ETSI_9)/6.1/Table1
641//******************************
642group IntegerTest {
643
644 testcase tc_integer() runs on xmlTest_CT {
645 f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer.xsd","",c_shell_successWithoutWarningAndError)
646
647 if(getverdict==pass) {
648 f_compareFiles(
649 "www_XmlTest_org_integer_e.ttcn",
650 "www_XmlTest_org_integer.ttcn", c_numOfDiff_headerAndModuleName);
651 }
652
653 }//tc_
654
655 //negative test
656 testcase tc_integer_empty1() runs on xmlTest_CT {
657 f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_empty1.xsd","",c_shell_error)
658 }//tc_
659
660 //negative test
661 testcase tc_integer_withLength() runs on xmlTest_CT {
662 f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withLength.xsd","",c_shell_error)
663 }//tc_
664
665 //Ready, passed, TR:HL21694 -solved
666 testcase tc_integer_withEnum() runs on xmlTest_CT {
667 f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withEnum.xsd","",c_shell_successWithoutWarningAndError)
668
669 if(getverdict==pass) {
670 f_compareFiles(
671 "www_XmlTest_org_integer_withEnum_e.ttcn","www_XmlTest_org_integer_withEnum.ttcn", c_numOfDiff_headerAndModuleName);
672 }
673 }//tc_
674
675 //Passed
676 testcase tc_integer_withMinIncl() runs on xmlTest_CT {
677 f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withMinIncl.xsd","",c_shell_successWithoutWarningAndError)
678
679 if(getverdict==pass) {
680 f_compareFiles(
681 "www_XmlTest_org_integer_withMinIncl_e.ttcn",
682 "www_XmlTest_org_integer_withMinIncl.ttcn",c_numOfDiff_headerAndModuleName);
683 }
684 }//tc_
685
686 //Passed
687 testcase tc_integer_withMaxIncl() runs on xmlTest_CT {
688 f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withMaxIncl.xsd","",c_shell_successWithoutWarningAndError)
689
690 if(getverdict==pass) {
691 f_compareFiles(
692 "www_XmlTest_org_integer_withMaxIncl_e.ttcn","www_XmlTest_org_integer_withMaxIncl.ttcn", c_numOfDiff_headerAndModuleName);
693 }
694 }//tc_
695
696 //Passed
697 testcase tc_integer_withMinExcl() runs on xmlTest_CT {
698 f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withMinExcl.xsd","",c_shell_successWithoutWarningAndError)
699
700 if(getverdict==pass) {
701 f_compareFiles(
702 "www_XmlTest_org_integer_withMinExcl_e.ttcn",
703 "www_XmlTest_org_integer_withMinExcl.ttcn", c_numOfDiff_headerAndModuleName);
704 }
705 }//tc_
706
707 //Passed
708 testcase tc_integer_withMaxExcl() runs on xmlTest_CT {
709 f_shellCommandWithVerdict("xsd2ttcn XmlTest_integer_withMaxExcl.xsd","",c_shell_successWithoutWarningAndError)
710
711 if(getverdict==pass) {
712 f_compareFiles(
713 "www_XmlTest_org_integer_withMaxExcl_e.ttcn","www_XmlTest_org_integer_withMaxExcl.ttcn", c_numOfDiff_headerAndModuleName);
714 }
715 }//tc_
716
717
718}//IntegerTest
719
720 //
721 testcase tc_simpleType_enum() runs on xmlTest_CT {
722
723 f_shellCommandWithVerdict("xsd2ttcn XmlTest_simple_enum.xsd","",c_shell_successWithoutWarningAndError)
724
725 if(getverdict==pass) {
726 f_compareFiles(
727 "www_XmlTest_org_simple_enum_e.ttcn","www_XmlTest_org_simple_enum.ttcn", c_numOfDiff_headerAndModuleName);
728 }
729
730 }//tc_
731
732
733//******************************
734// TimeTest
735// Based on (XSD_2)/
736//******************************
737group TimeTest {
738
739 //Passed:
740 testcase tc_time() runs on xmlTest_CT {
741 f_shellCommandWithVerdict("xsd2ttcn XmlTest_time.xsd","",c_shell_successWithoutWarningAndError)
742
743 if(getverdict==pass) {
744 f_compareFiles(
745 "www_XmlTest_org_time_e.ttcn","www_XmlTest_org_time.ttcn", c_numOfDiff_headerAndModuleName);
746 }
747 }//tc_
748
749 //Passed TR HL22058
750 testcase tc_time_withEnum() runs on xmlTest_CT {
751 f_shellCommandWithVerdict("xsd2ttcn XmlTest_time_withEnum.xsd","",c_shell_successWithoutWarningAndError)
752
753 if(getverdict==pass) {
754 f_compareFiles(
755 "www_XmlTest_org_time_withEnum_e.ttcn","www_XmlTest_org_time_withEnum.ttcn", c_numOfDiff_headerAndModuleName);
756 }
757 }//tc_
758}//TimeTest
759
760group ListTest {
761 //converter
762 testcase tc_list_conv() runs on xmlTest_CT {
763
764 f_shellCommandWithVerdict("xsd2ttcn XmlTest_list.xsd","",c_shell_successWithoutWarningAndError)
765
766 if(getverdict==pass) {
767 f_compareFiles(
768 "www_XmlTest_org_list_e.ttcn","www_XmlTest_org_list.ttcn", c_numOfDiff_headerAndModuleName);
769 }
770
771 // restrictions:length, minLength, maxLength, pattern, and enumeration.
772 }//tc_
773
774 testcase tc_list_encDec() runs on xmlTest_CT {
775 f_encDecTest_StringList();
776 }//tc_
777
778 testcase tc_integerList() runs on xmlTest_CT {
779
780 f_shellCommandWithVerdict("xsd2ttcn XmlTest_list_integer.xsd","",c_shell_successWithoutWarningAndError)
781
782 if(getverdict==pass) {
783 f_compareFiles(
784 "www_XmlTest_org_list_integer_e.ttcn","www_XmlTest_org_list_integer.ttcn", c_numOfDiff_headerAndModuleName);
785 }
786
787 }//tc_
788}//ListTest
789
790group UnionTest {
791 //TR:HL23577
792 testcase tc_union() runs on xmlTest_CT {
793
794 f_shellCommandWithVerdict("xsd2ttcn XmlTest_union.xsd","",c_shell_successWithoutWarningAndError)
795
796 if(getverdict==pass) {
797 f_compareFiles(
798 "www_XmlTest_org_union_e.ttcn","www_XmlTest_org_union.ttcn", c_numOfDiff_headerAndModuleName);
799 }
800 }//tc_
801
802 testcase tc_union_optional() runs on xmlTest_CT {
803
804 f_shellCommandWithVerdict("xsd2ttcn ETSI_CR5852_union.xsd","",c_shell_successWithoutWarningAndError)
805
806 if(getverdict==pass) {
807 f_compareFiles(
808 "ETSI_CR5852_union_e.ttcn","ETSI_CR5852_union.ttcn", c_numOfDiff_headerAndModuleName);
809 }
810 }
811
812}//UnionTest
813
814
815
816group ComplexType {
817
818 testcase tc_complex1() runs on xmlTest_CT {
819
820 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex1.xsd","",c_shell_successWithoutWarningAndError)
821
822 if(getverdict==pass) {
823 f_compareFiles(
824 "www_XmlTest_org_complex1_e.ttcn","www_XmlTest_org_complex1.ttcn", c_numOfDiff_headerModNameAndNamespace);
825 f_encDecTest_InternationalPrice();
826 }
827 }//tc_
828
829 //TR: HL24977 -Solved
830 testcase tc_complex2() runs on xmlTest_CT {
831
832 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex2.xsd","",c_shell_successWithoutWarningAndError)
833
834 if(getverdict==pass) {
835 f_compareFiles(
836 "www_XmlTest_org_complex2_e.ttcn","www_XmlTest_org_complex2.ttcn", c_numOfDiff_headerModNameAndNamespace);
837 }
838 f_encDecTest_InternationalPrice2(); //TR: HL24977 -solved -Primer, 2.5.3 Empty Content
839 f_encDecTest_InternationalPrice3();
840 f_encDecTest_InternationalPrice4();
841 }//tc_
842
843 testcase tc_complex_simpleContent() runs on xmlTest_CT {
844
845 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_simpleContent.xsd","",c_shell_successWithoutWarningAndError)
846
847 if(getverdict==pass) {
848 f_compareFiles(
849 "www_XmlTest_org_complex_simpleContent_e.ttcn","www_XmlTest_org_complex_simpleContent.ttcn", c_numOfDiff_headerModNameAndNamespace);
850 f_encDecTest_ComplexTypeWithSimpleContent1();
851 f_encDecTest_ComplexTypeWithSimpleContent2();
852 f_encDecTest_ComplexTypeWithSimpleContent2_neg();
853 }
854 }//tc_
855
856 testcase tc_complex_mixed_conv() runs on xmlTest_CT {
857
858 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_mixed.xsd","",c_shell_successWithoutWarningAndError)
859
860 if(getverdict==pass) {
861 f_compareFiles(
862 "www_XmlTest_org_complex_mixed_e.ttcn","www_XmlTest_org_complex_mixed.ttcn", c_numOfDiff_headerAndModuleName);
863 }
864 }//tc_
865
866 //TR:HL29258
867 testcase tc_complex_mixed_encDec() runs on xmlTest_CT {
868 f_encDecTest_ComplexTypeWithMixed();
869 }//tc_
870
871
872 testcase tc_complex_choice_converter() runs on xmlTest_CT {
873
874 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_choice.xsd","",c_shell_successWithoutWarningAndError)
875
876 if(getverdict==pass) {
877 f_compareFiles(
878 "www_XmlTest_org_complex_choice_e.ttcn","www_XmlTest_org_complex_choice.ttcn", c_numOfDiff_headerAndModuleName);
879 }
880 }//tc_
881
882 //
883 testcase tc_complex_choice_encDec() runs on xmlTest_CT {
884 f_encDecTest_ComplexTypeWithChoice_1();
885 f_encDecTest_ComplexTypeWithChoice_2();
886 f_encDecTest_ComplexTypeWithChoice_3();
887 f_encDecTest_ComplexTypeWithChoice_4();
888 f_encDecTest_ComplexTypeWithChoice_5();
889 f_encDecTest_ComplexTypeWithChoice_6();
890 f_encDecTest_ComplexTypeWithChoice_7();
891 f_encDecTest_ComplexTypeWithChoice_8();
892 f_encDecTest_ComplexTypeWithChoice_9();
893 f_encDecTest_ComplexTypeWithChoice_10();
894 }//tc_
895
896 //Passed, TR: HL30830 -solved
897 testcase tc_complex_all_converter() runs on xmlTest_CT {
898 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_all.xsd","",c_shell_successWithoutWarningAndError)
899
900 if(getverdict==pass) {
901 f_compareFiles(
902 "www_XmlTest_org_complex_all_e.ttcn","www_XmlTest_org_complex_all.ttcn", c_numOfDiff_headerAndModuleName);
903 }
904 }//tc_
905
906 //HL29679
907 testcase tc_complex_all_emptySet_encDec() runs on xmlTest_CT {
908 var MySubjects1 vl_pdu:= {
909 order:={},
910 year:="2009",
911 english:=omit,
912 math:=omit,
913 physics:=omit,
914 chemistry:=omit
915 }
916 var charstring vl_expectedEncodedPdu:="<MySubjects1 Year='2009'/>\n\n";
917 f_encDecTest_ComplexTypeWithAll_MySubject1(vl_pdu,vl_expectedEncodedPdu,vl_pdu);
918 }//tc_
919
920 testcase tc_complex_all_fullSet_encDec() runs on xmlTest_CT {
921 var MySubjects1 vl_pdu:= {
922 order:={math,english,chemistry, physics},
923 year:="2009",
924 english:="Advanced Group 1",
925 math:="Beginners 1",
926 physics:="Mechanics 1",
927 chemistry:="CH2"
928 }
929 var charstring vl_expectedEncodedPdu:=
930 "<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"
931 f_encDecTest_ComplexTypeWithAll_MySubject1(vl_pdu,vl_expectedEncodedPdu,vl_pdu);
932 }//tc_
933
934 testcase tc_complex_all_subSet_encDec() runs on xmlTest_CT {
935 var MySubjects1 vl_pdu:= {
936 order:={math,english,chemistry},
937 year:="2009",
938 english:="Advanced Group 1",
939 math:="Beginners 1",
940 physics:=omit,
941 chemistry:="CH2"
942 },
943 vl_expectedPdu:={
944 order:={math,english},
945 year:="2009",
946 english:="Advanced Group 1",
947 math:="Beginners 1",
948 physics:=omit,
949 chemistry:=omit
950 };
951 var charstring vl_expectedEncodedPdu:=
952 "<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"
953 f_encDecTest_ComplexTypeWithAll_MySubject1(vl_pdu,vl_expectedEncodedPdu,vl_pdu);
954 }//tc_
955
956 testcase tc_complex_all_inconsistentSet_encDec() runs on xmlTest_CT {
957 f_encDecTest_ComplexTypeWithAll_inconsistentSet();
958 }//tc_
959
960 //positive testcase for group "all". The type has no optional field (element).The input is correct
961 testcase tc_complex_all_noOptional_pos_encDec() runs on xmlTest_CT {
962 var MySubjects2 vl_pdu:= {
963 year:="2009",
964 subject:= {
965 order:={math,english,chemistry, physics,history},
966
967 english:="Advanced Group 1",
968 math:="Beginners 1",
969 physics:="Mechanics 1",
970 chemistry:="CH2",
971 history:="H1"
972 }
973 }
974 var charstring vl_expectedEncodedPdu:=
975 "<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";
976 f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_pdu,0);
977 }//tc_
978
979 //Negative testcase for group "all". The type has no optional field (element).
980 //The input is not correct: value of one field (history) is missing
981 //Passed, TR: HL32978
982 testcase tc_complex_all_noOptional_neg1_encDec() runs on xmlTest_CT {
983 var MySubjects2 vl_pdu:= {
984 year:="2009",
985 subject:= {
986 order:={math,english,chemistry, physics,history},
987 english:="Advanced Group 1",
988 math:="Beginners 1",
989 physics:="Mechanics 1",
990 chemistry:="CH2"
991 //history:="H1"
992 }
993 }
994 var MySubjects2 vl_expectedDecodedPdu:= {
995 year:="2009",
996 subject:= {
997 order:={math,english,chemistry, physics,history},
998 english:="Advanced Group 1",
999 math:="Beginners 1",
1000 physics:="Mechanics 1",
1001 chemistry:="CH2",
1002 history:=""
1003 }
1004 }
1005 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"
1006 f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_expectedDecodedPdu,0);
1007 }//tc_
1008
1009 //Negative testcase for group "all". The type has no optional field (element).
1010 //The input is not correct: value of one field (history) and its place in order-list is missing.
1011 // ***Less elements of record of order than required***
1012 //expectation: error report at encoding, returning 1 at decoding
1013 //Passed, TR: HL32978
1014 testcase tc_complex_all_noOptional_neg2_encDec() runs on xmlTest_CT {
1015 var MySubjects2 vl_pdu:= {
1016 year:="2009",
1017 subject:= {
1018 order:={math,english,chemistry, physics},
1019 english:="Advanced Group 1",
1020 math:="Beginners 1",
1021 physics:="Mechanics 1",
1022 chemistry:="CH2"
1023 //history:="H1"
1024 }
1025 }
1026 var MySubjects2 vl_expectedDecodedPdu:= {
1027 year:="2009",
1028 subject:= {
1029 order:={math,english,chemistry, physics},
1030 english:="Advanced Group 1",
1031 math:="Beginners 1",
1032 physics:="Mechanics 1",
1033 chemistry:="CH2",
1034 history:=""
1035 }
1036 }
1037 var charstring vl_expectedEncodedPdu:="<MySubjects2 Year='2009'/>\n\n"; //expecting error report!!!
1038 //"<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"
1039 f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_expectedDecodedPdu,1);
1040 }//tc_
1041
1042 //Negative testcase for group "all". The type has no optional field (element).
1043 //The input is not correct: order three times contains "math", Physics and history are missing.
1044 //expectation: error report at encoding, returning 1 at decoding
1045 //Passed, TR: HL32978
1046 testcase tc_complex_all_noOptional_neg3_encDec() runs on xmlTest_CT {
1047 var MySubjects2 vl_pdu:= {
1048 year:="2009",
1049 subject:= {
1050 order:={math,english,chemistry,math,math},
1051 english:="Advanced Group 1",
1052 math:="Beginners 1",
1053 physics:="Mechanics 1",
1054 chemistry:="CH2"
1055 //history:="H1"
1056 }
1057 }
1058 var charstring vl_expectedEncodedPdu:="<MySubjects2 Year='2009'/>\n\n"; //expecting error report!!!
1059 //"<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"
1060 f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_pdu,1);
1061 }//tc_
1062
1063
1064 //=========================================================================
1065 // tc_complex_all_noOptional_empty_encDec
1066 //=========================================================================
1067 //Negative testcase for group "all". The type has no optional field (element).
1068 //The input is not correct: value of all the fields and their place in order-list is missing
1069 //expectation: error report at encoding
1070 //Passed, TR: HL32978
1071 testcase tc_complex_all_noOptional_empty_encDec() runs on xmlTest_CT {
1072 var MySubjects2 vl_pdu:= {
1073 year:="2009",
1074 subject:= {
1075 order:={ }
1076 //english:="Advanced Group 1",
1077 //math:="Beginners 1",
1078 //physics:="Mechanics 1",
1079 //chemistry:="CH2"
1080 //history:="H1"
1081 }
1082 }
1083 var charstring vl_expectedEncodedPdu:="<MySubjects2 Year='2009'/>\n\n"; //expecting error report!!!
1084 f_encDecTest_ComplexTypeWithAll_MySubject2(vl_pdu,vl_expectedEncodedPdu,vl_pdu,1);
1085 }//tc_
1086
1087 //=========================================================================
1088 // tc_complex_minOccursMaxOccurs
1089 //=========================================================================
1090 //Old name: tc_XmlTest_minOccursMaxOccurs
1091 ////TR (ethgry): HL10386
1092 testcase tc_complex_minOccursMaxOccurs() runs on xmlTest_CT
1093 {
1094 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_minOccursMaxOccurs.xsd","",c_shell_successWithoutWarningAndError);
1095 if(getverdict==pass) {
1096 f_compareFiles(
1097 "www_XmlTest_org_complex_minOccursMaxOccurs_e.ttcn","www_XmlTest_org_complex_minOccursMaxOccurs.ttcn", c_numOfDiff_headerAndModuleName);
1098 }
1099 }
1100
1101
1102 testcase tc_complex_extension_converter() runs on xmlTest_CT {
1103 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_extension.xsd","",c_shell_successWithoutWarningAndError)
1104
1105 if(getverdict==pass) {
1106 f_compareFiles(
1107 "www_XmlTest_org_complex_extension_e.ttcn","www_XmlTest_org_complex_extension.ttcn", c_numOfDiff_headerAndModuleName);
1108 }
1109 }//tc_
1110
1111 testcase tc_complex_extension_encDec() runs on xmlTest_CT
1112 {
1113 var MySubjects3Extension vl_pdu:={
1114 semester:="Autumn",
1115 year:="2009",
1116 english:="B1",
1117 math:=omit,
1118 physics:="Optics",
1119 chemistry:=omit,
1120 arts:="Impressionism"
1121 }
1122 var charstring vl_expectedEncodedPdu:=
1123 "<MySubjects3Extension Semester='Autumn' Year='2009'>\n\t<English>B1</English>\n\t<Physics>Optics</Physics>\n\t<Arts>Impressionism</Arts>\n</MySubjects3Extension>\n\n";
1124 f_encDecTest_ComplexTypeWithExtension_MySubject3(vl_pdu,vl_expectedEncodedPdu, vl_pdu);
1125 }
1126
1127 testcase tc_complex_restriction_converter() runs on xmlTest_CT {
1128 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_restriction.xsd","",c_shell_successWithoutWarningAndError)
1129
1130 if(getverdict==pass) {
1131 f_compareFiles(
1132 "www_XmlTest_org_complex_restriction_e.ttcn","www_XmlTest_org_complex_restriction.ttcn", c_numOfDiff_headerAndModuleName);
1133 }
1134 }//tc_
1135
1136 testcase tc_complex_restriction_encDec() runs on xmlTest_CT
1137 {
1138 var MySubjects4Restriction vl_pdu:={
1139 year:="2009",
1140 english:="B1",
1141 math:="Combinatorics 1"
1142 }
1143 var charstring vl_expectedEncodedPdu:= "<MySubjects4Restriction Year='2009'>\n\t<English>B1</English>\n\t<Math>Combinatorics 1</Math>\n</MySubjects4Restriction>\n\n";
1144 f_encDecTest_ComplexTypeWithExtension_MySubject4(vl_pdu,vl_expectedEncodedPdu, vl_pdu);
1145 }
1146 //TR: HL32948, Solved
1147 testcase tc_complex_restriction_neg1_converter() runs on xmlTest_CT {
1148 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_restriction_neg1.xsd","",c_shell_error);
1149 }//tc_
1150
1151 //TR: HL32948, Solved
1152 testcase tc_complex_restriction_neg2_converter() runs on xmlTest_CT {
1153 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_restriction_neg2.xsd","",c_shell_error);
1154 }//tc_
1155
1156 //not supported:
1157 testcase tc_complex_unique_converter() runs on xmlTest_CT {
1158 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_unique.xsd","",c_shell_successWithWarning);
1159 }//tc_
1160
1161 //Positive test: The including and the included schema are in the same namespace
1162 testcase tc_complex_include_converter() runs on xmlTest_CT {
1163 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_include.xsd XmlTest_complex_include1.xsd","",c_shell_successWithoutWarningAndError);
1164
1165 if(getverdict==pass) {
1166 f_compareFiles(
1167 "www_XmlTest_org_complex_include1_e.ttcn","www_XmlTest_org_complex_include.ttcn", c_numOfDiff_headerAndModuleName);
1168 }
1169 }//tc_
1170
1171 //=========================================================================
1172 // tc_complex_include_neg1_converter
1173 //=========================================================================
1174 //Negative test: The including and the included schema are not in the same namespace
1175 testcase tc_complex_include_neg1_converter() runs on xmlTest_CT {
1176 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_include.xsd XmlTest_complex_include2.xsd","",c_shell_error);
1177 }//tc_
1178
1179 //=========================================================================
1180 // tc_complex_import_pos1_converter
1181 //=========================================================================
1182 //Positive test: The including and the included schema are in different namespaces (import and include)
1183 testcase tc_complex_import_pos1_converter() runs on xmlTest_CT {
1184 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_pos.xsd XmlTest_complex_include1.xsd","",c_shell_successWithoutWarningAndError);
1185
1186 if(getverdict==pass) {
1187 f_compareFiles(
1188 "www_XmlTest_org_complex_import_e.ttcn","www_XmlTest_org_complex_import.ttcn", c_numOfDiff_headerModNameAndImport);
1189
1190 f_compareFiles(
1191 "www_XmlTest_org_complex_include2_e.ttcn","www_XmlTest_org_complex_include.ttcn", c_numOfDiff_headerModNameAndImport);
1192 }
1193 }//tc_
1194
1195 //=========================================================================
1196 // tc_complex_import_pos2_converter
1197 //=========================================================================
1198 //Pos test: Checks if the converter can choose the file having the correct namespace
1199 //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
1200 testcase tc_complex_import_pos2_converter() runs on xmlTest_CT {
1201 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_pos.xsd XmlTest_complex_include2.xsd XmlTest_complex_include1.xsd","",c_shell_successWithoutWarningAndError);
1202
1203 if(getverdict==pass) {
1204 f_compareFiles(
1205 "www_XmlTest_org_complex_import_e.ttcn","www_XmlTest_org_complex_import.ttcn", c_numOfDiff_headerModNameAndNamespace);
1206
1207 f_compareFiles(
1208 "www_XmlTest_org_complex_include2_e.ttcn","www_XmlTest_org_complex_include.ttcn", c_numOfDiff_headerModNameAndNamespace);
1209 }
1210 }//tc_
1211
1212 //=========================================================================
1213 // tc_complex_import_neg1_converter
1214 //=========================================================================
1215 //Negative test: The importing and the imported schema are in different namespaces, but the first file contains unknown type
1216 //If the type checking is switched off the testcase fails.
1217 testcase tc_complex_import_neg1_converter() runs on xmlTest_CT {
1218 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_neg1.xsd XmlTest_complex_include1.xsd","",c_shell_error);
1219 }//tc_
1220
1221 //=========================================================================
1222 // tc_complex_import_withSL_converter
1223 //=========================================================================
1224 //Positive test: The importing schema contains the namespace and the schema location of the imported schema.
1225 testcase tc_complex_import_withSL_converter() runs on xmlTest_CT {
1226 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_withSchemaLocation.xsd XmlTest_complex_include1.xsd","",c_shell_successWithoutWarningAndError);
1227
1228 if(getverdict==pass) {
1229 f_compareFiles(
1230 "www_XmlTest_org_complex_import_e.ttcn","www_XmlTest_org_complex_import.ttcn", c_numOfDiff_headerModNameAndNamespace+4);
1231 }
1232 }//tc_
1233
1234 //=========================================================================
1235 // tc_complex_import_withSL_encDec
1236 //=========================================================================
1237 // TODO: fix HR88527
1238 testcase tc_complex_import_withSL_encDec() runs on xmlTest_CT {
1239 var PurchaseReportImport pl_pdu:= {
1240 period :="P3M",
1241 periodEnding :="1999-12-31",
1242 regions:= {
1243 zip_list :={
1244 {
1245 code:=95819,
1246 part_list:= {
1247 {
1248 number:="872-AA",
1249 quantity:=1
1250 },
1251 {
1252 number:="926-AA",
1253 quantity:=2
1254 }
1255 }
1256 }
1257 }
1258 },
1259 parts :={
1260 part_list:= {
1261 {
1262 number:="872-AA",
1263 base:="Lawnmower"
1264 },
1265 {
1266 number:="926-AA",
1267 base:="Baby Monitor"
1268 }
1269 }
1270 }
1271 }
1272 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";
1273 //see http://www.w3.org/TR/xmlschema-0/#quartelyReport !
1274 f_encDecTest_PurchaseReportImport(pl_pdu,pl_expectedEncodedPdu,pl_pdu);
1275 }//tc_
1276
1277 //=========================================================================
1278 // tc_complex_import_nameCollision_converter
1279 //=========================================================================
1280 //imports the same type from different namespaces
1281 testcase tc_complex_import_nameCollision_converter() runs on xmlTest_CT {
1282 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_AB.xsd XmlTest_complex_import_A.xsd XmlTest_complex_import_B.xsd","",c_shell_successWithoutWarningAndError);
1283
1284 if(getverdict==pass) {
1285 f_compareFiles(
1286 "www_XmlTest_org_complex_import_A_e.ttcn","www_XmlTest_org_complex_import_A.ttcn", c_numOfDiff_headerAndModuleName);
1287 f_compareFiles(
1288 "www_XmlTest_org_complex_import_B_e.ttcn","www_XmlTest_org_complex_import_B.ttcn", c_numOfDiff_headerAndModuleName);
1289 f_compareFiles(
1290 "www_XmlTest_org_complex_import_AB_e.ttcn","www_XmlTest_org_complex_import_AB.ttcn", 10+c_numOfDiff_headerModNameAndImport);
1291 }
1292 }//tc_
1293
1294 //=========================================================================
1295 // tc_complex_import_nameCollision2_converter
1296 //=========================================================================
1297 //imports the same type from different namespaces
1298 testcase tc_complex_import_nameCollision2_converter() runs on xmlTest_CT {
1299 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_import_AB.xsd XmlTest_complex_import_B.xsd XmlTest_complex_import_A.xsd","",c_shell_successWithoutWarningAndError);
1300 }//tc_
1301
1302 //=========================================================================
1303 // tc_complex_any_pos_converter
1304 //=========================================================================
1305 testcase tc_complex_any_pos_converter() runs on xmlTest_CT {
1306 f_shellCommandWithVerdict("xsd2ttcn XmlTest_complex_any.xsd","",c_shell_successWithoutWarningAndError);
1307
1308 if(getverdict==pass) {
1309 f_compareFiles(
1310 "www_XmlTest_org_complex_any_e.ttcn","www_XmlTest_org_complex_any.ttcn", c_numOfDiff_headerAndModuleName);
1311 }
1312 }//tc_
1313
1314
1315 //=========================================================================
1316 // tc_complex_any_pos1_encDec
1317 // Failed, TR: HL37887
1318 //=========================================================================
1319 testcase tc_complex_any_pos1_encDec() runs on xmlTest_CT {
1320
1321 var ElementContainingXhtml_1 vl_pdu := {
1322 firstField:="1st field",
1323 elem_list:= {
1324 "<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>"
1325 },
1326 thirdField:="3rd field"
1327 }
1328 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";
1329 f_encDecTest_ElementContainingXhtml_1(vl_pdu,vl_expectedEncodedPdu, vl_pdu);
1330 }//tc_
1331
1332 //=========================================================================
1333 // tc_complex_any_pos2_encDec
1334 //=========================================================================
1335 testcase tc_complex_any_pos2_encDec() runs on xmlTest_CT {
1336
1337 var ElementContainingXhtml_2 vl_pdu := {
1338 elem_list:= {
1339 "<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>"
1340 }
1341 }
1342 var charstring vl_expectedEncodedPdu:=
1343 "<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";
1344 f_encDecTest_ElementContainingXhtml_2(vl_pdu,vl_expectedEncodedPdu, vl_pdu);
1345 }//tc_
1346
1347 //=========================================================================
1348 // tc_complex_any_pos3_encDec
1349 // Failed, TR: HL37887
1350 //=========================================================================
1351 testcase tc_complex_any_pos3_encDec() runs on xmlTest_CT {
1352
1353 var ElementContainingXhtml_1 vl_pdu :=
1354 {
1355 firstField := "1st field",
1356 elem_list := {
1357 "<table xmlns=\"http://www.w3.org/1999/xhtml\" border=\"0\" width=\"100%\">\n <tr><td>95819</td><td> </td><td> </td></tr>\n </table>",
1358 "<second xmlns=\"http://www.w3.org/1999/xhtml\" element=\"rabbit\"/>" },
1359 thirdField := "3rd field"
1360 }
1361
1362 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";
1363 f_encDecTest_ElementContainingXhtml_1(vl_pdu,vl_expectedEncodedPdu, vl_pdu);
1364 }//tc_
1365
1366}//complexTypes
1367
1368//=========================================================================
1369// group Elements
1370//=========================================================================
1371group Elements{
1372
1373 //Passed
1374 testcase tc_element_anyType_converter() runs on xmlTest_CT {
1375
1376 f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_anyType.xsd","",c_shell_successWithoutWarningAndError)
1377
1378 if(getverdict==pass) {
1379 f_compareFiles(
1380 "www_XmlTest_org_element_anyType_e.ttcn","www_XmlTest_org_element_anyType.ttcn", c_numOfDiff_headerAndModuleName);
1381 }
1382 }//tc_
1383
1384 //Passed TR: Hl29679
1385 testcase tc_element_anyType_empty_encDec() runs on xmlTest_CT {
1386 var Anything1 vl_pdu:= { attr:={},elem_list:={}};
1387 var charstring vl_expectedEncodedPdu:="<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType'/>\n\n"
1388 f_encDecTest_Anything1(vl_pdu, vl_expectedEncodedPdu,vl_pdu);
1389 }//tc_
1390
1391 //Passed
1392 testcase tc_element_anyType_attrOnly_encDec() runs on xmlTest_CT {
1393 var Anything1 vl_pdu:= { attr:={"name=\"First\""},elem_list:={}};
1394 var charstring vl_expectedEncodedPdu:=
1395 "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType' name=\"First\"/>\n\n";
1396 f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_pdu);
1397 }//tc_
1398
1399 testcase tc_element_anyType_2attrOnly_encDec() runs on xmlTest_CT {
1400 var Anything1 vl_pdu:= { attr:={"name=\"Hunor\"","nationality=\"HU\""},elem_list:={}};
1401 var charstring vl_expectedEncodedPdu:=
1402 "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType' name=\"Hunor\" nationality=\"HU\"/>\n\n";
1403 f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_pdu);
1404 }//tc_
1405
1406 //Passed, TR: HL29711
1407 testcase tc_element_anyType_elemOnly_encDec() runs on xmlTest_CT {
1408 var Anything1 vl_pdu:= { attr:={ }, elem_list:={"<MyElement1/>", "<MyElement2></MyElement2>"} };
1409 var charstring vl_expectedEncodedPdu:=
1410 "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType'>\n\t<MyElement1/>\n\t<MyElement2></MyElement2>\n</ns31:anything1>\n\n"
1411 var Anything1 vl_expectedDecodedPdu:= { attr:={ }, elem_list:={"<MyElement1/>", "<MyElement2/>"} };
1412 f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_expectedDecodedPdu);
1413 }//tc_
1414
1415 testcase tc_element_anyType_encDec() runs on xmlTest_CT {
1416 var Anything1 vl_pdu:= {
1417 attr:={"name=\"Hunor\"","nationality=\"HU\""},
1418 elem_list:={"<MyElement1/>", "<MyElement2></MyElement2>"} };
1419 var charstring vl_expectedEncodedPdu:=
1420 "<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";
1421 var Anything1 vl_expectedDecodedPdu:= {
1422 attr:={"name=\"Hunor\"","nationality=\"HU\""},
1423 elem_list:={"<MyElement1/>", "<MyElement2/>"}
1424 };
1425 f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_expectedDecodedPdu);
1426 }//tc_
1427
1428 //===============================================================
1429 // tc_element_anyType_deeper_encDec
1430 //===============================================================
1431 testcase tc_element_anyType_deeper_encDec() runs on xmlTest_CT {
1432 var Anything1 vl_pdu:= {
1433 attr:={"name=\"Hunor\"","nationality=\"HU\""},
1434 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>"} };
1435
1436 var charstring vl_expectedEncodedPdu:=
1437 "<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"
1438 f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_pdu);
1439 }//tc_
1440
1441
1442 type record of charstring charstringList;
1443
1444 //===============================================================
1445 // tc_element_anyType_longer_encDec
1446 //===============================================================
1447 testcase tc_element_anyType_longer_encDec() runs on xmlTest_CT {
1448 var charstringList vl_elementList:= {
1449 "<MyElement1>\n\t<Level2>\n\t<Level3_1>Great</Level3_1>\n\t<Level3_2>Britain</Level3_2>\n\t</Level2>\n</MyElement1>",
1450 "<MyElement2><Level2>Goddag</Level2>\n</MyElement2>",
1451 "<MyElement3><Level2>Goddag</Level2>\n</MyElement3>",
1452 "<MyElement4><Level2>Goddag</Level2>\n</MyElement4>"
1453 };
1454 var Anything1 vl_pdu:= {
1455 attr:={
1456 "name=\"Hunor\"",
1457 "nationality=\"HU\""
1458 },
1459 elem_list:={ }
1460 };
1461
1462 var charstring vl_expectedEncodedPdu:=
1463 "<ns31:anything1 xmlns:ns31='www.XmlTest.org/element_anyType' name=\"Hunor\" nationality=\"HU\">\n";
1464
1465 for(var integer i:=0;i<sizeof(vl_elementList);i:=i+1){
1466 vl_pdu.elem_list[i]:=vl_elementList[i];
1467 vl_expectedEncodedPdu:=vl_expectedEncodedPdu & "\t" & vl_elementList[i] & "\n";
1468 }
1469 vl_expectedEncodedPdu:=vl_expectedEncodedPdu & "</ns31:anything1>\n\n"
1470
1471 f_encDecTest_Anything1(vl_pdu,vl_expectedEncodedPdu,vl_pdu);
1472 }//tc_
1473
1474
1475 //===============================================================
1476 // tc_element_recOfElements_converter
1477 //===============================================================
1478 //Passed: TR: HL27438, Old name:tc_element_recOfElements_defaultAttr_converter
1479 testcase tc_element_recOfElements_converter() runs on xmlTest_CT {
1480
1481 f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements.xsd","",c_shell_successWithoutWarningAndError)
1482
1483 if(getverdict==pass) {
1484 f_compareFiles(
1485 "www_XmlTest_org_element_recordOfElements_e.ttcn","www_XmlTest_org_element_recordOfElements.ttcn", c_numOfDiff_headerModNameAndNamespace);
1486 }
1487 }//tc_
1488
1489 //Passed, old name: tc_element_recOfElements
1490 testcase tc_element_recOfElements_encDec() runs on xmlTest_CT {
1491 f_encDecTest_PersonInfo1();
1492 f_encDecTest_PersonInfo2();
1493 f_encDecTest_PersonInfo2_omitOptionals();
1494// }
1495 }//tc_
1496
1497 //Passed, TR HL27452
1498 testcase tc_element_recOfElements_defaultAttr_encDec() runs on xmlTest_CT {
1499 f_encDecTest_PersonInfo2_defaultAttribute();
1500 }//tc_
1501
1502 //Passed: TR:27484
1503 testcase tc_element_recOfElements_defaultElement() runs on xmlTest_CT {
1504
1505 f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements.xsd","",c_shell_successWithoutWarningAndError)
1506
1507 if(getverdict==pass) {
1508 f_compareFiles(
1509 "www_XmlTest_org_element_recordOfElements_e.ttcn","www_XmlTest_org_element_recordOfElements.ttcn", c_numOfDiff_headerModNameAndNamespace);
1510 f_encDecTest_PersonInfo1_defaultElement();
1511 }
1512 }//tc_
1513
1514 //Passed
1515 testcase tc_element_recOfElements_minMaxOccurs() runs on xmlTest_CT {
1516
1517 f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements4.xsd","",c_shell_successWithoutWarningAndError)
1518
1519 if(getverdict==pass) {
1520 f_compareFiles(
1521 "www_XmlTest_org_element_recordOfElements4_e.ttcn","www_XmlTest_org_element_recordOfElements4.ttcn", c_numOfDiff_headerModNameAndNamespace);
1522 f_encDecTest_PersonInfo4();
1523 }
1524 }//tc_
1525
1526 //Passed, TR:HL28010
1527 testcase tc_element_recOfElements_maxOccursInfinity_converter() runs on xmlTest_CT {
1528
1529 f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements3.xsd","",c_shell_successWithoutWarningAndError)
1530
1531 if(getverdict==pass) {
1532 f_compareFiles(
1533 "www_XmlTest_org_element_recordOfElements3_e.ttcn","www_XmlTest_org_element_recordOfElements3.ttcn", c_numOfDiff_headerModNameAndNamespace);
1534 }
1535
1536 }//tc_
1537
1538 //Passed, TR: HL28024
1539 testcase tc_element_recOfElements_maxOccursInfinity_encoderDecoder() runs on xmlTest_CT {
1540
1541 f_encDecTest_PersonInfo3();
1542 }//tc_
1543
1544 testcase tc_element_recOfElements_anonymousType_conv() runs on xmlTest_CT {
1545
1546 f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_recordOfElements5.xsd","",c_shell_successWithoutWarningAndError)
1547
1548 if(getverdict==pass) {
1549 f_compareFiles(
1550 "www_XmlTest_org_element_recordOfElements5_e.ttcn","www_XmlTest_org_element_recordOfElements5.ttcn", c_numOfDiff_headerModNameAndNamespace);
1551 }
1552
1553 }//tc_
1554
1555 testcase tc_element_recOfElements_anonymousType_encDec() runs on xmlTest_CT {
1556 f_encDecTest_PersonInfo5();
1557 }//tc_
1558
1559
1560 //========================================================
1561 // tc_element_nameInheritance_conv
1562 // Checks if name of named (aliased) type is not inherited
1563 //========================================================
1564 testcase tc_element_nameInheritance_conv() runs on xmlTest_CT {
1565 f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_nameInheritance.xsd","",c_shell_successWithoutWarningAndError);
1566 }//tc_
1567
1568 //========================================
1569 // tc_element_nameInheritance_encDec
1570 // Checks if name of named (aliased) type is not inherited
1571 //========================================
1572 //TR HL49978
1573 testcase tc_element_nameInheritance_encDec() runs on xmlTest_CT {
1574 f_encDecTest_nameInheritance();
1575 }//tc_
1576
1577 //========================================
1578 // tc_element_Tgc_encDec
1579 // Checks if name of named (aliased) type is not inherited
1580 //========================================
1581 //TR HL49978
1582 testcase tc_element_Tgc_encDec() runs on xmlTest_CT {
1583 f_encDecTest_Tgc();
1584 }//tc_
1585
1586 //"Abstract" and "substitutionGroup" are not supported. Therefore converter sends WARNINGs
1587 testcase tc_element_abstract_conv() runs on xmlTest_CT {
1588 f_shellCommandWithVerdict("xsd2ttcn XmlTest_element_abstract.xsd","",c_shell_successWithWarning);
1589 }//tc_
1590
1591 testcase tc_element_nillable_converter() runs on xmlTest_CT {
1592 f_shellCommandWithVerdict("xsd2ttcn -z XmlTest_imsike.xsd","",c_shell_successWithoutWarningAndError );
1593
1594 if(getverdict==pass) {
1595 f_compareFiles(
1596 "XmlTest_imsike_e.ttcn","XmlTest_imsike.ttcn", c_numOfDiff_headerAndModuleName);
1597 }
1598 }//tc_
1599
1600 //IndividualTrigger, nile="false"
1601 testcase tc_element_nillable_IndividualTrigger_nilFalse_encDec() runs on xmlTest_CT {
1602 f_encDecTest_IndividualTrigger1();
1603 }//tc_
1604
1605 //IndividualTrigger, nil="true"
1606 testcase tc_element_nillable_IndividualTrigger_nilTrue_encDec() runs on xmlTest_CT {
1607 f_encDecTest_IndividualTrigger2(); //empty record
1608 }//tc_
1609
1610 //Isp, nil="false"
1611 testcase tc_element_nillable_Isp_nilFalse_encDec() runs on xmlTest_CT {
1612 f_encDecTest_Isp1();
1613 }//tc_
1614
1615 //Isp, nil="true"
1616 testcase tc_element_nillable_Isp_nilTrue_encDec() runs on xmlTest_CT {
1617 f_encDecTest_Isp2();
1618 }//tc_
1619
1620 //RemarkNillable, nil="false"
1621 testcase tc_element_nillable_RemarkNillable_nilFalse_encDec() runs on xmlTest_CT {
1622 f_encDecTest_RemarkNillable1();
1623 }//tc_
1624
1625 //RemarkNillable, nil="true"
1626 testcase tc_element_nillable_RemarkNillable_nilTrue_encDec() runs on xmlTest_CT {
1627 f_encDecTest_RemarkNillable2();
1628 }//tc_
1629
1630}//Element
1631
1632//=========================================================================
1633// Control
1634//=========================================================================
1635
1636control {
1637 execute(tc_versionTest());//Passed
1638 execute(tc_xsd2ttcn_versionTest());//Passed
1639 //====My tcs====
1640 execute(tc_firstTrial());//Passed
1641 execute(tc_secondTrial());//Passed
1642 execute(tc_empty()); //Passed, TR:
1643 //appended to increase coverage:
1644
1645 execute(tc_annotation());
1646 execute(tc_annotation1());
1647 execute(tc_annotation2());
1648 //option tests:
1649 execute(tc_version());
1650 execute(tc_options_c());
1651 execute(tc_options_e());
1652 execute(tc_options_f());
1653 execute(tc_options_p());
1654 execute(tc_options_s());
1655 execute(tc_options_t());
1656 execute(tc_options_v());
1657 execute(tc_options_V());
1658 execute(tc_options_w());
1659 execute(tc_options_x());
1660 execute(tc_options_wrong());
1661 execute(tc_options_missing());
1662 //===LABEL and DEFINITION - unknown but used tags
1663
1664 //===ttcn standard===
1665 execute(tc_XmlTest_all());//Passed
1666 execute(tc_XmlTest_any_anyAttribute());//Passed
1667 execute(tc_XmlTest_HQ73011());//Passed
1668 execute(tc_XmlTest_attributeGroup());//Passed
1669 execute(tc_XmlTest_attribute_use_noTNS());//Passed
1670
1671 //===W3C standard===
1672
1673 //===String===
1674 execute(tc_string()); //passed
1675 execute(tc_string_withWhitespace());//Check it once again if encoder or decoder transform "content" !!!
1676 execute(tc_string_withEnum());//Passed, TR: HL26227
1677 execute(tc_string_withPosLength());//TR: HL21257,
1678 execute(tc_string_withEmptyLength()); //TR: HL20441, Solved
1679 execute(tc_string_withNegativeLength());//Passed
1680 execute(tc_string_withFixedLength()); //Passed
1681 execute(tc_string_withFloatLength()); //passed ???
1682 execute(tc_string_withPosMinLength()); //Passed, TR: HL21690
1683 execute(tc_string_withEmptyMin());//Passed
1684 execute(tc_string_withNegativeMin());//Passed
1685 execute(tc_string_withPosMax())//Passed
1686 execute(tc_string_withEmptyMax());//Passed
1687 execute(tc_string_withNegativeMax());//Passed
1688 execute(tc_string_withFaultyMinMaxLength());//Passed, TR: TODO
1689 execute(tc_string_withOverDefinition()); //TR: HL25948, Solved
1690 execute(tc_string_withTypeAndBase());//Passed
1691 //===Boolean===
1692 execute(tc_boolean());//Passed
1693 //===Decimal===
1694 execute(tc_decimal());//Passed
1695 //execute(tc_decimal_withLength()); length not supported
1696 execute(tc_decimal_withMinMaxInclusive());//TR: HL20715
1697 execute(tc_decimal_withMinMaxExclusive());//Passed TR: HL21166 -solved
1698 execute(tc_decimal_withEnum()); //Passed,TR HL21196 -solved
1699 //===Integer===
1700 execute(tc_integer());//Passed
1701 execute(tc_integer_empty1());//Passed
1702 execute(tc_integer_withEnum()); //Passed, TR:HL21694 -solved
1703 execute(tc_integer_withMinIncl());//Passed
1704 execute(tc_integer_withMaxIncl());//Passed
1705 execute(tc_integer_withMinExcl());//Passed
1706 execute(tc_integer_withMaxExcl());//Passed
1707 //===Time===
1708 execute(tc_time());//passed
1709 execute(tc_time_withEnum());//Passed TR HL22058
1710 //==list===
1711 execute(tc_list_conv()); //Passed
1712 execute(tc_list_encDec());//Passed
1713 execute(tc_integerList());//Passed
1714
1715 //===simpleType enum====
1716 execute(tc_simpleType_enum());//Passed
1717 //===union===
1718 execute(tc_union());//TR:HL23577
1719 execute(tc_union_optional());//CR_TR18883
1720 //===complex===
1721 execute(tc_complex1()); //Passed
1722 execute(tc_complex2());//TR: HL24977
1723 execute(tc_complex_simpleContent());
1724 execute(tc_complex_mixed_conv()); //Passed
1725 execute(tc_complex_mixed_encDec()); //TR:HL29258 - Rejected. Reason: Not supported feature, TODO:Write CR!!
1726
1727 execute(tc_complex_choice_converter());//Passed
1728 execute(tc_complex_choice_encDec());//Passed
1729
1730 execute(tc_complex_all_converter());//Passed
1731 execute(tc_complex_all_emptySet_encDec());//Passed
1732 execute(tc_complex_all_fullSet_encDec());//Passed
1733 execute(tc_complex_all_subSet_encDec());//Passed
1734 execute(tc_complex_all_inconsistentSet_encDec());//Passed
1735 execute(tc_complex_all_noOptional_pos_encDec()); //Passed
1736 execute(tc_complex_all_noOptional_neg1_encDec()); //Error, TR: HL32978
1737 execute(tc_complex_all_noOptional_neg2_encDec()); //Failed, TR: HL32978
1738 execute(tc_complex_all_noOptional_neg3_encDec()); //Failed, TR: HL32978
1739 execute(tc_complex_all_noOptional_empty_encDec()); //Failed, TR: HL32978
1740 execute(tc_complex_minOccursMaxOccurs()); //Passed, TR (ethgry): HL10386
1741 execute(tc_complex_extension_converter()); //TR HL32505
1742 execute(tc_complex_extension_encDec()); //Passed
1743 execute(tc_complex_restriction_converter()); //Failed, TR HL32896
1744
1745
1746
1747
1748// execute(tc_complex_restriction_encDec());
1749
1750
1751
1752
1753 execute(tc_complex_restriction_neg1_converter());//TR: HL32948
1754 execute(tc_complex_restriction_neg2_converter());//TR: HL32948
1755 execute(tc_complex_unique_converter());
1756 execute(tc_complex_include_converter());
1757 execute(tc_complex_include_neg1_converter());
1758 execute(tc_complex_import_pos1_converter());
1759 execute(tc_complex_import_pos2_converter());
1760 execute(tc_complex_import_neg1_converter());
1761 execute(tc_complex_import_withSL_converter());//SchemaLocation
1762 //execute(tc_complex_import_withSL_encDec());
1763 execute(tc_complex_import_nameCollision_converter());
1764 execute(tc_complex_import_nameCollision2_converter());
1765 execute(tc_complex_any_pos_converter());
1766 execute(tc_complex_any_pos1_encDec()); //Failed, TR: HL37887
1767 execute(tc_complex_any_pos2_encDec());
1768 execute(tc_complex_any_pos3_encDec());//failed, TR:
1769 //===element===
1770 execute(tc_element_anyType_converter());//Passed
1771 execute(tc_element_anyType_empty_encDec());//Passed TR: HL29679
1772 execute(tc_element_anyType_attrOnly_encDec());//Passed
1773 execute(tc_element_anyType_2attrOnly_encDec());//Passed
1774 execute(tc_element_anyType_elemOnly_encDec());//Passed, TR: HL29711
1775 execute(tc_element_anyType_encDec());//Passed, HL29711
1776 execute(tc_element_anyType_deeper_encDec());
1777 execute(tc_element_anyType_longer_encDec());
1778 execute(tc_element_recOfElements_converter()); //Passed: TR: HL27438
1779 execute(tc_element_recOfElements_encDec());//Passed
1780 execute(tc_element_recOfElements_defaultAttr_encDec());//Passed, TR HL27452
1781 execute(tc_element_recOfElements_defaultElement());//Passed: TR:27484
1782 execute(tc_element_recOfElements_maxOccursInfinity_converter());//Passed, TR:HL28010
1783 execute(tc_element_recOfElements_maxOccursInfinity_encoderDecoder());//Passed, TR: HL2802
1784 execute(tc_element_recOfElements_anonymousType_conv());
1785 execute(tc_element_recOfElements_anonymousType_encDec());
1786
1787 execute(tc_element_nameInheritance_conv());
1788 execute(tc_element_nameInheritance_encDec());//TR HL49978
1789 execute(tc_element_Tgc_encDec());//TR HL49978
1790 execute(tc_element_abstract_conv()); //Not supported features
1791 execute(tc_element_nillable_converter());
1792 execute(tc_element_nillable_IndividualTrigger_nilFalse_encDec());
1793 execute(tc_element_nillable_IndividualTrigger_nilTrue_encDec());
1794 execute(tc_element_nillable_Isp_nilFalse_encDec());
1795 execute(tc_element_nillable_Isp_nilTrue_encDec());
1796 execute(tc_element_nillable_RemarkNillable_nilFalse_encDec());
1797 execute(tc_element_nillable_RemarkNillable_nilTrue_encDec());
1798}
1799
1800} with {
1801 extension "version R1A02"; // a prerelease version
1802 extension "requiresTITAN R1C01";
1803} // end of module
This page took 0.154691 seconds and 5 git commands to generate.