Use LTTngUSTLogger logger plugin in logtest regression test
[deliverable/titan.core.git] / function_test / XER_EncDec / XER_EncDec_TD.script
1 .******************************************************************************
2 .* Copyright (c) 2000-2016 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 .* Contributors:
9 .* Balasko, Jeno
10 .* Baranyi, Botond
11 .*
12 .******************************************************************************/
13 :text.
14 :lang eng.
15 .*
16 :docname.Test Description
17 :docno.9/152 91-CRL 113 200/5 Uen
18 :rev.A
19 :date.2015-04-27
20 .*
21 :prep.ETH/XZ Botond Baranyi
22 :appr.ETH/XZ (Elemer Lelik)
23 :checked.ETHBAAT
24 .*
25 :title.Test description - XER coder
26 :contents level=3.
27 .*---------------------------------------------------------------------*
28 :h1.PREREQUISITES AND PREPARATIONS
29 .*---------------------------------------------------------------------*
30 .*---------------------------------------------------------------------*
31 :h2.Scope of the Test Object
32 .*---------------------------------------------------------------------*
33 :xmp tab=1 nokeep.
34
35 This TD contains test cases related to TTCN3 Executor's XER coder function.
36 For now, only "anyElement" variants are tested.
37
38 :exmp.
39
40 :p.:us.Revision Information:eus.
41
42 :xmp nokeep.
43 :us.History:eus.
44
45 REV DATE PREPARED CHANGE
46 === ========== ======== ======
47 A 2014-04-29 EBOTBAR New document
48
49 :exmp.
50
51 .*---------------------------------------------------------------------*
52 :h2.Test Tools
53 .*---------------------------------------------------------------------*
54 :p.:us.Software Tools:eus.
55 :xmp tab=2 nokeep.
56
57 SAtester
58
59 :exmp.
60 :np.
61 .*---------------------------------------------------------------------*
62 :h1.REQUIREMENT-BASED TESTS
63 .*---------------------------------------------------------------------*
64 .*---------------------------------------------------------------------*
65 :h2. Negative tests with encoding "anyElement from ..." variants
66 .*---------------------------------------------------------------------*
67 .*---------------------------------------------------------------------*
68 :h3. Encoding record with any element from unqualified namespace
69 .*---------------------------------------------------------------------*
70 :xmp tab=0.
71
72 <TC - Encoding record with any element from unqualified namespace>
73
74 <STATIC>
75
76 type component Test_CT{};
77
78 <TTCN_TC:PURE_EXEC>
79
80 type record any_elem_rec {
81 integer not_used,
82 universal charstring any_elem
83 } with {
84 encode "XML";
85 variant(any_elem) "anyElement from unqualified";
86 }
87
88 external function ef_xer_enc(in any_elem_rec par) return octetstring
89 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
90
91 testcase tc_any_elem() runs on Test_CT {
92 var octetstring os_enc;
93
94 var any_elem_rec v_good := { 3, "<something>not very important</something>" };
95 os_enc := ef_xer_enc(v_good);
96
97 var any_elem_rec v_bad := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
98 os_enc := ef_xer_enc(v_bad);
99 setverdict(pass);
100 }
101
102 control {
103 execute(tc_any_elem());
104 }
105
106 <RESULT>
107
108 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.somewhere.com" is not in the allowed namespace list.
109
110 <END_TC>
111
112 :exmp.
113
114 .*---------------------------------------------------------------------*
115 :h3. Encoding record with any element from specific namespace
116 .*---------------------------------------------------------------------*
117 :xmp tab=0.
118
119 <TC - Encoding record with any element from specific namespace>
120
121 <STATIC>
122
123 type component Test_CT{};
124
125 <TTCN_TC:PURE_EXEC>
126
127 type record any_elem_rec {
128 integer not_used,
129 universal charstring any_elem
130 } with {
131 encode "XML";
132 variant(any_elem) "anyElement from 'http://www.somewhere.com'";
133 }
134
135 external function ef_xer_enc(in any_elem_rec par) return octetstring
136 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
137
138 testcase tc_any_elem() runs on Test_CT {
139 var octetstring os_enc;
140
141 var any_elem_rec v_good := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
142 os_enc := ef_xer_enc(v_good);
143
144 var any_elem_rec v_bad := { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
145 os_enc := ef_xer_enc(v_bad);
146 setverdict(pass);
147 }
148
149 control {
150 execute(tc_any_elem());
151 }
152
153 <RESULT>
154
155 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.somewhereelse.com" is not in the allowed namespace list.
156
157 <END_TC>
158
159 :exmp.
160
161 .*---------------------------------------------------------------------*
162 :h3. Encoding record with any element from multiple namespaces
163 .*---------------------------------------------------------------------*
164 :xmp tab=0.
165
166 <TC - Encoding record with any element from multiple namespaces>
167
168 <STATIC>
169
170 type component Test_CT{};
171
172 <TTCN_TC:PURE_EXEC>
173
174 type record any_elem_rec {
175 integer not_used,
176 universal charstring any_elem
177 } with {
178 encode "XML";
179 variant(any_elem) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
180 }
181
182 external function ef_xer_enc(in any_elem_rec par) return octetstring
183 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
184
185 testcase tc_any_elem() runs on Test_CT {
186 var octetstring os_enc;
187
188 var any_elem_rec v_good1 := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
189 os_enc := ef_xer_enc(v_good1);
190
191 var any_elem_rec v_good2 := { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
192 os_enc := ef_xer_enc(v_good2);
193
194 var any_elem_rec v_good3 := { 3, "<something>not very important</something>" };
195 os_enc := ef_xer_enc(v_good3);
196
197 var any_elem_rec v_bad := { 0, "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
198 os_enc := ef_xer_enc(v_bad);
199
200 setverdict(pass);
201 }
202
203 control {
204 execute(tc_any_elem());
205 }
206
207 <RESULT>
208
209 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.someotherplace.com" is not in the allowed namespace list.
210
211 <END_TC>
212
213 :exmp.
214
215 .*---------------------------------------------------------------------*
216 :h3. Encoding record of with any element from unqualified namespace
217 .*---------------------------------------------------------------------*
218 :xmp tab=0.
219
220 <TC - Encoding record of with any element from unqualified namespace>
221
222 <STATIC>
223
224 type component Test_CT{};
225
226 <TTCN_TC:PURE_EXEC>
227
228 type record of universal charstring any_elem_rec_of with {
229 encode "XML";
230 variant([-]) "anyElement from unqualified";
231 }
232
233 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
234 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
235
236 testcase tc_any_elem() runs on Test_CT {
237 var octetstring os_enc;
238
239 var any_elem_rec_of v_good := { "<something>not very important</something>" };
240 os_enc := ef_xer_enc(v_good);
241
242 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
243 os_enc := ef_xer_enc(v_bad);
244 setverdict(pass);
245 }
246
247 control {
248 execute(tc_any_elem());
249 }
250
251 <RESULT>
252
253 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.somewhere.com" is not in the allowed namespace list.
254
255 <END_TC>
256
257 :exmp.
258
259 .*---------------------------------------------------------------------*
260 :h3. Encoding record of with any element from specific namespace
261 .*---------------------------------------------------------------------*
262 :xmp tab=0.
263
264 <TC - Encoding record of with any element from specific namespace>
265
266 <STATIC>
267
268 type component Test_CT{};
269
270 <TTCN_TC:PURE_EXEC>
271
272 type record of universal charstring any_elem_rec_of with {
273 encode "XML";
274 variant([-]) "anyElement from 'http://www.somewhere.com'";
275 }
276
277 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
278 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
279
280 testcase tc_any_elem() runs on Test_CT {
281 var octetstring os_enc;
282
283 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
284 os_enc := ef_xer_enc(v_good);
285
286 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
287 os_enc := ef_xer_enc(v_bad);
288 setverdict(pass);
289 }
290
291 control {
292 execute(tc_any_elem());
293 }
294
295 <RESULT>
296
297 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.somewhereelse.com" is not in the allowed namespace list.
298
299 <END_TC>
300
301 :exmp.
302
303 .*---------------------------------------------------------------------*
304 :h3. Encoding record of with any element from multiple namespaces
305 .*---------------------------------------------------------------------*
306 :xmp tab=0.
307
308 <TC - Encoding record of with any element from multiple namespaces>
309
310 <STATIC>
311
312 type component Test_CT{};
313
314 <TTCN_TC:PURE_EXEC>
315
316 type record of universal charstring any_elem_rec_of with {
317 encode "XML";
318 variant([-]) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
319 }
320
321 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
322 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
323
324 testcase tc_any_elem() runs on Test_CT {
325 var octetstring os_enc;
326
327 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>",
328 "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>",
329 "<something>not very important</something>" };
330 os_enc := ef_xer_enc(v_good);
331
332 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
333 os_enc := ef_xer_enc(v_bad);
334
335 setverdict(pass);
336 }
337
338 control {
339 execute(tc_any_elem());
340 }
341
342 <RESULT>
343
344 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.someotherplace.com" is not in the allowed namespace list.
345
346 <END_TC>
347
348 :exmp.
349
350 .*---------------------------------------------------------------------*
351 :h2. Negative tests with encoding "anyElement except ..." variants
352 .*---------------------------------------------------------------------*
353 .*---------------------------------------------------------------------*
354 :h3. Encoding record with any element except unqualified namespace
355 .*---------------------------------------------------------------------*
356 :xmp tab=0.
357
358 <TC - Encoding record with any element except unqualified namespace>
359
360 <STATIC>
361
362 type component Test_CT{};
363
364 <TTCN_TC:PURE_EXEC>
365
366 type record any_elem_rec {
367 integer not_used,
368 universal charstring any_elem
369 } with {
370 encode "XML";
371 variant(any_elem) "anyElement except unqualified";
372 }
373
374 external function ef_xer_enc(in any_elem_rec par) return octetstring
375 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
376
377 testcase tc_any_elem() runs on Test_CT {
378 var octetstring os_enc;
379
380 var any_elem_rec v_good := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
381 os_enc := ef_xer_enc(v_good);
382
383 var any_elem_rec v_bad := { 3, "<something>not very important</something>" };
384 os_enc := ef_xer_enc(v_bad);
385
386 setverdict(pass);
387 }
388
389 control {
390 execute(tc_any_elem());
391 }
392
393 <RESULT>
394
395 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: The unqualified XML namespace is in the excluded namespace list.
396
397 <END_TC>
398
399 :exmp.
400
401 .*---------------------------------------------------------------------*
402 :h3. Encoding record with any element except specific namespace
403 .*---------------------------------------------------------------------*
404 :xmp tab=0.
405
406 <TC - Encoding record with any element except specific namespace>
407
408 <STATIC>
409
410 type component Test_CT{};
411
412 <TTCN_TC:PURE_EXEC>
413
414 type record any_elem_rec {
415 integer not_used,
416 universal charstring any_elem
417 } with {
418 encode "XML";
419 variant(any_elem) "anyElement except 'http://www.somewhere.com'";
420 }
421
422 external function ef_xer_enc(in any_elem_rec par) return octetstring
423 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
424
425 testcase tc_any_elem() runs on Test_CT {
426 var octetstring os_enc;
427
428 var any_elem_rec v_good1 := { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
429 os_enc := ef_xer_enc(v_good1);
430
431 var any_elem_rec v_good2 := { 3, "<something>not very important</something>" };
432 os_enc := ef_xer_enc(v_good2);
433
434 var any_elem_rec v_bad := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
435 os_enc := ef_xer_enc(v_bad);
436
437 setverdict(pass);
438 }
439
440 control {
441 execute(tc_any_elem());
442 }
443
444 <RESULT>
445
446 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.somewhere.com" is in the excluded namespace list.
447
448 <END_TC>
449
450 :exmp.
451
452 .*---------------------------------------------------------------------*
453 :h3. Encoding record with any element except multiple namespaces
454 .*---------------------------------------------------------------------*
455 :xmp tab=0.
456
457 <TC - Encoding record with any element except multiple namespaces>
458
459 <STATIC>
460
461 type component Test_CT{};
462
463 <TTCN_TC:PURE_EXEC>
464
465 type record any_elem_rec {
466 integer not_used,
467 universal charstring any_elem
468 } with {
469 encode "XML";
470 variant(any_elem) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
471 }
472
473 external function ef_xer_enc(in any_elem_rec par) return octetstring
474 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
475
476 testcase tc_any_elem() runs on Test_CT {
477 var octetstring os_enc;
478
479 var any_elem_rec v_good := { 0, "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
480 os_enc := ef_xer_enc(v_good);
481
482 var any_elem_rec v_bad := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
483 os_enc := ef_xer_enc(v_bad);
484
485 setverdict(pass);
486 }
487
488 control {
489 execute(tc_any_elem());
490 }
491
492 <RESULT>
493
494 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.somewhere.com" is in the excluded namespace list.
495
496 <END_TC>
497
498 :exmp.
499
500 .*---------------------------------------------------------------------*
501 :h3. Encoding record of with any element except unqualified namespace
502 .*---------------------------------------------------------------------*
503 :xmp tab=0.
504
505 <TC - Encoding record of with any element except unqualified namespace>
506
507 <STATIC>
508
509 type component Test_CT{};
510
511 <TTCN_TC:PURE_EXEC>
512
513 type record of universal charstring any_elem_rec_of with {
514 encode "XML";
515 variant([-]) "anyElement except unqualified";
516 }
517
518 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
519 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
520
521 testcase tc_any_elem() runs on Test_CT {
522 var octetstring os_enc;
523
524 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
525 os_enc := ef_xer_enc(v_good);
526
527 var any_elem_rec_of v_bad := { "<something>not very important</something>" };
528 os_enc := ef_xer_enc(v_bad);
529
530 setverdict(pass);
531 }
532
533 control {
534 execute(tc_any_elem());
535 }
536
537 <RESULT>
538
539 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: The unqualified XML namespace is in the excluded namespace list.
540
541 <END_TC>
542
543 :exmp.
544
545 .*---------------------------------------------------------------------*
546 :h3. Encoding record of with any element except specific namespace
547 .*---------------------------------------------------------------------*
548 :xmp tab=0.
549
550 <TC - Encoding record of with any element except specific namespace>
551
552 <STATIC>
553
554 type component Test_CT{};
555
556 <TTCN_TC:PURE_EXEC>
557
558 type record of universal charstring any_elem_rec_of with {
559 encode "XML";
560 variant([-]) "anyElement except 'http://www.somewhere.com'";
561 }
562
563 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
564 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
565
566 testcase tc_any_elem() runs on Test_CT {
567 var octetstring os_enc;
568
569 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
570 os_enc := ef_xer_enc(v_good);
571
572 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
573 os_enc := ef_xer_enc(v_bad);
574
575 setverdict(pass);
576 }
577
578 control {
579 execute(tc_any_elem());
580 }
581
582 <RESULT>
583
584 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.somewhere.com" is in the excluded namespace list.
585
586 <END_TC>
587
588 :exmp.
589
590 .*---------------------------------------------------------------------*
591 :h3. Encoding record of with any element except multiple namespaces
592 .*---------------------------------------------------------------------*
593 :xmp tab=0.
594
595 <TC - Encoding record of with any element except multiple namespaces>
596
597 <STATIC>
598
599 type component Test_CT{};
600
601 <TTCN_TC:PURE_EXEC>
602
603 type record of universal charstring any_elem_rec_of with {
604 encode "XML";
605 variant([-]) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
606 }
607
608 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
609 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
610
611 testcase tc_any_elem() runs on Test_CT {
612 var octetstring os_enc;
613
614 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
615 os_enc := ef_xer_enc(v_good);
616
617 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
618 os_enc := ef_xer_enc(v_bad);
619
620 setverdict(pass);
621 }
622
623 control {
624 execute(tc_any_elem());
625 }
626
627 <RESULT>
628 Dynamic test case error: While XER-encoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.somewhere.com" is in the excluded namespace list.
629
630 <END_TC>
631
632 :exmp.
633
634 .*---------------------------------------------------------------------*
635 :h2. Negative tests with decoding "anyElement from ..." variants
636 .*---------------------------------------------------------------------*
637 .*---------------------------------------------------------------------*
638 :h3. Decoding record with any element from unqualified namespace
639 .*---------------------------------------------------------------------*
640 :xmp tab=0.
641
642 <TC - Decoding record with any element from unqualified namespace>
643
644 <STATIC>
645
646 type component Test_CT{};
647
648 <TTCN_TC:PURE_EXEC>
649
650 type record any_elem_rec {
651 integer not_used,
652 universal charstring any_elem
653 } with {
654 encode "XML";
655 variant(any_elem) "anyElement from unqualified";
656 }
657
658 external function ef_xer_dec(in octetstring par) return any_elem_rec
659 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
660
661 testcase tc_any_elem() runs on Test_CT {
662 var any_elem_rec v_res;
663
664 // encoded { 3, "<something>not very important</something>" };
665 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
666 v_res := ef_xer_dec(v_good);
667
668 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
669 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
670 v_res := ef_xer_dec(v_bad);
671
672 setverdict(pass);
673 }
674
675 control {
676 execute(tc_any_elem());
677 }
678
679 <RESULT>
680
681 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.somewhere.com" is not in the allowed namespace list.
682
683 <END_TC>
684
685 :exmp.
686
687 .*---------------------------------------------------------------------*
688 :h3. Decoding record with any element from specific namespace
689 .*---------------------------------------------------------------------*
690 :xmp tab=0.
691
692 <TC - Decoding record with any element from specific namespace>
693
694 <STATIC>
695
696 type component Test_CT{};
697
698 <TTCN_TC:PURE_EXEC>
699
700 type record any_elem_rec {
701 integer not_used,
702 universal charstring any_elem
703 } with {
704 encode "XML";
705 variant(any_elem) "anyElement from 'http://www.somewhere.com'";
706 }
707
708 external function ef_xer_dec(in octetstring par) return any_elem_rec
709 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
710
711 testcase tc_any_elem() runs on Test_CT {
712 var any_elem_rec v_res;
713
714 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
715 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
716 v_res := ef_xer_dec(v_good);
717
718 // encoded { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
719 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E36313C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
720 v_res := ef_xer_dec(v_bad);
721
722 setverdict(pass);
723 }
724
725 control {
726 execute(tc_any_elem());
727 }
728
729 <RESULT>
730
731 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.somewhereelse.com" is not in the allowed namespace list.
732
733 <END_TC>
734
735 :exmp.
736
737 .*---------------------------------------------------------------------*
738 :h3. Decoding record with any element from multiple namespaces
739 .*---------------------------------------------------------------------*
740 :xmp tab=0.
741
742 <TC - Decoding record with any element from multiple namespaces>
743
744 <STATIC>
745
746 type component Test_CT{};
747
748 <TTCN_TC:PURE_EXEC>
749
750 type record any_elem_rec {
751 integer not_used,
752 universal charstring any_elem
753 } with {
754 encode "XML";
755 variant(any_elem) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
756 }
757
758 external function ef_xer_dec(in octetstring par) return any_elem_rec
759 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
760
761 testcase tc_any_elem() runs on Test_CT {
762 var any_elem_rec v_res;
763
764 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
765 var octetstring v_good1 := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
766 v_res := ef_xer_dec(v_good1);
767
768 // encoded { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
769 var octetstring v_good2 := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E36313C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
770 v_res := ef_xer_dec(v_good2);
771
772 // encoded { 3, "<something>not very important</something>" };
773 var octetstring v_good3 := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
774 v_res := ef_xer_dec(v_good3);
775
776 // encoded { 0, "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
777 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E303C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D656F74686572706C6163652E636F6D223E677265656E3C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
778 v_res := ef_xer_dec(v_bad);
779
780 setverdict(pass);
781 }
782
783 control {
784 execute(tc_any_elem());
785 }
786
787 <RESULT>
788
789 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.someotherplace.com" is not in the allowed namespace list.
790
791 <END_TC>
792
793 :exmp.
794
795 .*---------------------------------------------------------------------*
796 :h3. Decoding record of with any element from unqualified namespace
797 .*---------------------------------------------------------------------*
798 :xmp tab=0.
799
800 <TC - Decoding record of with any element from unqualified namespace>
801
802 <STATIC>
803
804 type component Test_CT{};
805
806 <TTCN_TC:PURE_EXEC>
807
808 type record of universal charstring any_elem_rec_of with {
809 encode "XML";
810 variant([-]) "anyElement from unqualified";
811 }
812
813 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
814 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
815
816 testcase tc_any_elem() runs on Test_CT {
817 var any_elem_rec_of v_res;
818
819 // encoded { "<something>not very important</something>" };
820 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
821 v_res := ef_xer_dec(v_good);
822
823 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
824 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
825 v_res := ef_xer_dec(v_bad);
826
827 setverdict(pass);
828 }
829
830 control {
831 execute(tc_any_elem());
832 }
833
834 <RESULT>
835
836 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.somewhere.com" is not in the allowed namespace list.
837
838 <END_TC>
839
840 :exmp.
841
842 .*---------------------------------------------------------------------*
843 :h3. Decoding record of with any element from specific namespace
844 .*---------------------------------------------------------------------*
845 :xmp tab=0.
846
847 <TC - Decoding record of with any element from specific namespace>
848
849 <STATIC>
850
851 type component Test_CT{};
852
853 <TTCN_TC:PURE_EXEC>
854
855 type record of universal charstring any_elem_rec_of with {
856 encode "XML";
857 variant([-]) "anyElement from 'http://www.somewhere.com'";
858 }
859
860 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
861 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
862
863 testcase tc_any_elem() runs on Test_CT {
864 var any_elem_rec_of v_res;
865
866 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
867 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
868 v_res := ef_xer_dec(v_good);
869
870 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
871 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
872 v_res := ef_xer_dec(v_bad);
873
874 setverdict(pass);
875 }
876
877 control {
878 execute(tc_any_elem());
879 }
880
881 <RESULT>
882
883 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.somewhereelse.com" is not in the allowed namespace list.
884
885 <END_TC>
886
887 :exmp.
888
889 .*---------------------------------------------------------------------*
890 :h3. Decoding record of with any element from multiple namespaces
891 .*---------------------------------------------------------------------*
892 :xmp tab=0.
893
894 <TC - Decoding record of with any element from multiple namespaces>
895
896 <STATIC>
897
898 type component Test_CT{};
899
900 <TTCN_TC:PURE_EXEC>
901
902 type record of universal charstring any_elem_rec_of with {
903 encode "XML";
904 variant([-]) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
905 }
906
907 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
908 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
909
910 testcase tc_any_elem() runs on Test_CT {
911 var any_elem_rec_of v_res;
912
913 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>",
914 // "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>",
915 // "<something>not very important</something>" };
916 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
917 v_res := ef_xer_dec(v_good);
918
919 // encoded { "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
920 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D656F74686572706C6163652E636F6D223E677265656E3C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
921 v_res := ef_xer_dec(v_bad);
922
923 setverdict(pass);
924 }
925
926 control {
927 execute(tc_any_elem());
928 }
929
930 <RESULT>
931
932 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.someotherplace.com" is not in the allowed namespace list.
933
934 <END_TC>
935
936 :exmp.
937
938 .*---------------------------------------------------------------------*
939 :h2. Negative tests with decoding "anyElement except ..." variants
940 .*---------------------------------------------------------------------*
941 .*---------------------------------------------------------------------*
942 :h3. Decoding record with any element except unqualified namespace
943 .*---------------------------------------------------------------------*
944 :xmp tab=0.
945
946 <TC - Decoding record with any element except unqualified namespace>
947
948 <STATIC>
949
950 type component Test_CT{};
951
952 <TTCN_TC:PURE_EXEC>
953
954 type record any_elem_rec {
955 integer not_used,
956 universal charstring any_elem
957 } with {
958 encode "XML";
959 variant(any_elem) "anyElement except unqualified";
960 }
961
962 external function ef_xer_dec(in octetstring par) return any_elem_rec
963 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
964
965 testcase tc_any_elem() runs on Test_CT {
966 var any_elem_rec v_res;
967
968 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
969 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
970 v_res := ef_xer_dec(v_good);
971
972 // encoded { 3, "<something>not very important</something>" };
973 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
974 v_res := ef_xer_dec(v_bad);
975
976 setverdict(pass);
977 }
978
979 control {
980 execute(tc_any_elem());
981 }
982
983 <RESULT>
984
985 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: The unqualified XML namespace is in the excluded namespace list.
986
987 <END_TC>
988
989 :exmp.
990
991 .*---------------------------------------------------------------------*
992 :h3. Decoding record with any element except specific namespace
993 .*---------------------------------------------------------------------*
994 :xmp tab=0.
995
996 <TC - Decoding record with any element except specific namespace>
997
998 <STATIC>
999
1000 type component Test_CT{};
1001
1002 <TTCN_TC:PURE_EXEC>
1003
1004 type record any_elem_rec {
1005 integer not_used,
1006 universal charstring any_elem
1007 } with {
1008 encode "XML";
1009 variant(any_elem) "anyElement except 'http://www.somewhere.com'";
1010 }
1011
1012 external function ef_xer_dec(in octetstring par) return any_elem_rec
1013 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1014
1015 testcase tc_any_elem() runs on Test_CT {
1016 var any_elem_rec v_res;
1017
1018 // encoded { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
1019 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E36313C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
1020 v_res := ef_xer_dec(v_good);
1021
1022 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
1023 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
1024 v_res := ef_xer_dec(v_bad);
1025
1026 setverdict(pass);
1027 }
1028
1029 control {
1030 execute(tc_any_elem());
1031 }
1032
1033 <RESULT>
1034
1035 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.somewhere.com" is in the excluded namespace list.
1036
1037 <END_TC>
1038
1039 :exmp.
1040
1041 .*---------------------------------------------------------------------*
1042 :h3. Decoding record with any element except multiple namespaces
1043 .*---------------------------------------------------------------------*
1044 :xmp tab=0.
1045
1046 <TC - Decoding record with any element except multiple namespaces>
1047
1048 <STATIC>
1049
1050 type component Test_CT{};
1051
1052 <TTCN_TC:PURE_EXEC>
1053
1054 type record any_elem_rec {
1055 integer not_used,
1056 universal charstring any_elem
1057 } with {
1058 encode "XML";
1059 variant(any_elem) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
1060 }
1061
1062 external function ef_xer_dec(in octetstring par) return any_elem_rec
1063 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1064
1065 testcase tc_any_elem() runs on Test_CT {
1066 var any_elem_rec v_res;
1067
1068 // encoded { 0, "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
1069 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E303C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D656F74686572706C6163652E636F6D223E677265656E3C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
1070 v_res := ef_xer_dec(v_good);
1071
1072 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
1073 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
1074 v_res := ef_xer_dec(v_bad);
1075
1076 setverdict(pass);
1077 }
1078
1079 control {
1080 execute(tc_any_elem());
1081 }
1082
1083 <RESULT>
1084
1085 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec': Component 'any_elem': While checking anyElement: XML namespace "http://www.somewhere.com" is in the excluded namespace list.
1086
1087 <END_TC>
1088
1089 :exmp.
1090
1091 .*---------------------------------------------------------------------*
1092 :h3. Decoding record of with any element except unqualified namespace
1093 .*---------------------------------------------------------------------*
1094 :xmp tab=0.
1095
1096 <TC - Decoding record of with any element except unqualified namespace>
1097
1098 <STATIC>
1099
1100 type component Test_CT{};
1101
1102 <TTCN_TC:PURE_EXEC>
1103
1104 type record of universal charstring any_elem_rec_of with {
1105 encode "XML";
1106 variant([-]) "anyElement except unqualified";
1107 }
1108
1109 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
1110 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1111
1112 testcase tc_any_elem() runs on Test_CT {
1113 var any_elem_rec_of v_res;
1114
1115 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
1116 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1117 v_res := ef_xer_dec(v_good);
1118
1119 // encoded { "<something>not very important</something>" };
1120 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1121 v_res := ef_xer_dec(v_bad);
1122
1123 setverdict(pass);
1124 }
1125
1126 control {
1127 execute(tc_any_elem());
1128 }
1129
1130 <RESULT>
1131
1132 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: The unqualified XML namespace is in the excluded namespace list.
1133
1134 <END_TC>
1135
1136 :exmp.
1137
1138 .*---------------------------------------------------------------------*
1139 :h3. Decoding record of with any element except specific namespace
1140 .*---------------------------------------------------------------------*
1141 :xmp tab=0.
1142
1143 <TC - Decoding record of with any element except specific namespace>
1144
1145 <STATIC>
1146
1147 type component Test_CT{};
1148
1149 <TTCN_TC:PURE_EXEC>
1150
1151 type record of universal charstring any_elem_rec_of with {
1152 encode "XML";
1153 variant([-]) "anyElement except 'http://www.somewhere.com'";
1154 }
1155
1156 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
1157 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1158
1159 testcase tc_any_elem() runs on Test_CT {
1160 var any_elem_rec_of v_res;
1161
1162 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
1163 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1164 v_res := ef_xer_dec(v_good);
1165
1166 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
1167 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1168 v_res := ef_xer_dec(v_bad);
1169
1170 setverdict(pass);
1171 }
1172
1173 control {
1174 execute(tc_any_elem());
1175 }
1176
1177 <RESULT>
1178
1179 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.somewhere.com" is in the excluded namespace list.
1180
1181 <END_TC>
1182
1183 :exmp.
1184
1185 .*---------------------------------------------------------------------*
1186 :h3. Decoding record of with any element except multiple namespaces
1187 .*---------------------------------------------------------------------*
1188 :xmp tab=0.
1189
1190 <TC - Decoding record of with any element except multiple namespaces>
1191
1192 <STATIC>
1193
1194 type component Test_CT{};
1195
1196 <TTCN_TC:PURE_EXEC>
1197
1198 type record of universal charstring any_elem_rec_of with {
1199 encode "XML";
1200 variant([-]) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
1201 }
1202
1203 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
1204 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1205
1206 testcase tc_any_elem() runs on Test_CT {
1207 var any_elem_rec_of v_res;
1208
1209 // encoded { "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
1210 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D656F74686572706C6163652E636F6D223E677265656E3C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1211 v_res := ef_xer_dec(v_good);
1212
1213 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
1214 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1215 v_res := ef_xer_dec(v_bad);
1216
1217 setverdict(pass);
1218 }
1219
1220 control {
1221 execute(tc_any_elem());
1222 }
1223
1224 <RESULT>
1225
1226 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': Index 0: While checking anyElement: XML namespace "http://www.somewhereelse.com" is in the excluded namespace list.
1227
1228 <END_TC>
1229
1230 :exmp.
1231
1232 .*---------------------------------------------------------------------*
1233 :h1.REFERENCES
1234 .*---------------------------------------------------------------------*
1235 :nl. Requirement specification(s):
1236 :nl.-------------------------------
1237 :list.
1238 :li. 8/ETH/RUS-2003:0087 Uen - Requirement Specification for TITAN's encoder/decoder functions
1239 :elist.
1240
1241 :etext.
This page took 0.057613 seconds and 5 git commands to generate.