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
12 .******************************************************************************/
16 :docname.Test Description
17 :docno.9/152 91-CRL 113 200/5 Uen
21 :prep.ETH/XZ Botond Baranyi
22 :appr.ETH/XZ (Elemer Lelik)
25 :title.Test description - XER coder
27 .*---------------------------------------------------------------------*
28 :h1.PREREQUISITES AND PREPARATIONS
29 .*---------------------------------------------------------------------*
30 .*---------------------------------------------------------------------*
31 :h2.Scope of the Test Object
32 .*---------------------------------------------------------------------*
35 This TD contains test cases related to TTCN3 Executor's XER coder function.
36 For now, only "anyElement" variants are tested.
40 :p.:us.Revision Information:eus.
45 REV DATE PREPARED CHANGE
46 === ========== ======== ======
47 A 2014-04-29 EBOTBAR New document
51 .*---------------------------------------------------------------------*
53 .*---------------------------------------------------------------------*
54 :p.:us.Software Tools:eus.
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 .*---------------------------------------------------------------------*
72 <TC - Encoding record with any element from unqualified namespace>
76 type component Test_CT{};
80 type record any_elem_rec {
82 universal charstring any_elem
85 variant(any_elem) "anyElement from unqualified";
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)" }
91 testcase tc_any_elem() runs on Test_CT {
92 var octetstring os_enc;
94 var any_elem_rec v_good := { 3, "<something>not very important</something>" };
95 os_enc := ef_xer_enc(v_good);
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);
103 execute(tc_any_elem());
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.
114 .*---------------------------------------------------------------------*
115 :h3. Encoding record with any element from specific namespace
116 .*---------------------------------------------------------------------*
119 <TC - Encoding record with any element from specific namespace>
123 type component Test_CT{};
127 type record any_elem_rec {
129 universal charstring any_elem
132 variant(any_elem) "anyElement from 'http://www.somewhere.com'";
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)" }
138 testcase tc_any_elem() runs on Test_CT {
139 var octetstring os_enc;
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);
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);
150 execute(tc_any_elem());
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.
161 .*---------------------------------------------------------------------*
162 :h3. Encoding record with any element from multiple namespaces
163 .*---------------------------------------------------------------------*
166 <TC - Encoding record with any element from multiple namespaces>
170 type component Test_CT{};
174 type record any_elem_rec {
176 universal charstring any_elem
179 variant(any_elem) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
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)" }
185 testcase tc_any_elem() runs on Test_CT {
186 var octetstring os_enc;
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);
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);
194 var any_elem_rec v_good3 := { 3, "<something>not very important</something>" };
195 os_enc := ef_xer_enc(v_good3);
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);
204 execute(tc_any_elem());
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.
215 .*---------------------------------------------------------------------*
216 :h3. Encoding record of with any element from unqualified namespace
217 .*---------------------------------------------------------------------*
220 <TC - Encoding record of with any element from unqualified namespace>
224 type component Test_CT{};
228 type record of universal charstring any_elem_rec_of with {
230 variant([-]) "anyElement from unqualified";
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)" }
236 testcase tc_any_elem() runs on Test_CT {
237 var octetstring os_enc;
239 var any_elem_rec_of v_good := { "<something>not very important</something>" };
240 os_enc := ef_xer_enc(v_good);
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);
248 execute(tc_any_elem());
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.
259 .*---------------------------------------------------------------------*
260 :h3. Encoding record of with any element from specific namespace
261 .*---------------------------------------------------------------------*
264 <TC - Encoding record of with any element from specific namespace>
268 type component Test_CT{};
272 type record of universal charstring any_elem_rec_of with {
274 variant([-]) "anyElement from 'http://www.somewhere.com'";
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)" }
280 testcase tc_any_elem() runs on Test_CT {
281 var octetstring os_enc;
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);
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);
292 execute(tc_any_elem());
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.
303 .*---------------------------------------------------------------------*
304 :h3. Encoding record of with any element from multiple namespaces
305 .*---------------------------------------------------------------------*
308 <TC - Encoding record of with any element from multiple namespaces>
312 type component Test_CT{};
316 type record of universal charstring any_elem_rec_of with {
318 variant([-]) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
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)" }
324 testcase tc_any_elem() runs on Test_CT {
325 var octetstring os_enc;
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);
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);
339 execute(tc_any_elem());
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.
350 .*---------------------------------------------------------------------*
351 :h2. Negative tests with encoding "anyElement except ..." variants
352 .*---------------------------------------------------------------------*
353 .*---------------------------------------------------------------------*
354 :h3. Encoding record with any element except unqualified namespace
355 .*---------------------------------------------------------------------*
358 <TC - Encoding record with any element except unqualified namespace>
362 type component Test_CT{};
366 type record any_elem_rec {
368 universal charstring any_elem
371 variant(any_elem) "anyElement except unqualified";
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)" }
377 testcase tc_any_elem() runs on Test_CT {
378 var octetstring os_enc;
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);
383 var any_elem_rec v_bad := { 3, "<something>not very important</something>" };
384 os_enc := ef_xer_enc(v_bad);
390 execute(tc_any_elem());
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.
401 .*---------------------------------------------------------------------*
402 :h3. Encoding record with any element except specific namespace
403 .*---------------------------------------------------------------------*
406 <TC - Encoding record with any element except specific namespace>
410 type component Test_CT{};
414 type record any_elem_rec {
416 universal charstring any_elem
419 variant(any_elem) "anyElement except 'http://www.somewhere.com'";
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)" }
425 testcase tc_any_elem() runs on Test_CT {
426 var octetstring os_enc;
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);
431 var any_elem_rec v_good2 := { 3, "<something>not very important</something>" };
432 os_enc := ef_xer_enc(v_good2);
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);
441 execute(tc_any_elem());
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.
452 .*---------------------------------------------------------------------*
453 :h3. Encoding record with any element except multiple namespaces
454 .*---------------------------------------------------------------------*
457 <TC - Encoding record with any element except multiple namespaces>
461 type component Test_CT{};
465 type record any_elem_rec {
467 universal charstring any_elem
470 variant(any_elem) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
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)" }
476 testcase tc_any_elem() runs on Test_CT {
477 var octetstring os_enc;
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);
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);
489 execute(tc_any_elem());
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.
500 .*---------------------------------------------------------------------*
501 :h3. Encoding record of with any element except unqualified namespace
502 .*---------------------------------------------------------------------*
505 <TC - Encoding record of with any element except unqualified namespace>
509 type component Test_CT{};
513 type record of universal charstring any_elem_rec_of with {
515 variant([-]) "anyElement except unqualified";
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)" }
521 testcase tc_any_elem() runs on Test_CT {
522 var octetstring os_enc;
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);
527 var any_elem_rec_of v_bad := { "<something>not very important</something>" };
528 os_enc := ef_xer_enc(v_bad);
534 execute(tc_any_elem());
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.
545 .*---------------------------------------------------------------------*
546 :h3. Encoding record of with any element except specific namespace
547 .*---------------------------------------------------------------------*
550 <TC - Encoding record of with any element except specific namespace>
554 type component Test_CT{};
558 type record of universal charstring any_elem_rec_of with {
560 variant([-]) "anyElement except 'http://www.somewhere.com'";
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)" }
566 testcase tc_any_elem() runs on Test_CT {
567 var octetstring os_enc;
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);
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);
579 execute(tc_any_elem());
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.
590 .*---------------------------------------------------------------------*
591 :h3. Encoding record of with any element except multiple namespaces
592 .*---------------------------------------------------------------------*
595 <TC - Encoding record of with any element except multiple namespaces>
599 type component Test_CT{};
603 type record of universal charstring any_elem_rec_of with {
605 variant([-]) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
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)" }
611 testcase tc_any_elem() runs on Test_CT {
612 var octetstring os_enc;
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);
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);
624 execute(tc_any_elem());
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.
634 .*---------------------------------------------------------------------*
635 :h2. Negative tests with decoding "anyElement from ..." variants
636 .*---------------------------------------------------------------------*
637 .*---------------------------------------------------------------------*
638 :h3. Decoding record with any element from unqualified namespace
639 .*---------------------------------------------------------------------*
642 <TC - Decoding record with any element from unqualified namespace>
646 type component Test_CT{};
650 type record any_elem_rec {
652 universal charstring any_elem
655 variant(any_elem) "anyElement from unqualified";
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)" }
661 testcase tc_any_elem() runs on Test_CT {
662 var any_elem_rec v_res;
664 // encoded { 3, "<something>not very important</something>" };
665 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
666 v_res := ef_xer_dec(v_good);
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);
676 execute(tc_any_elem());
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.
687 .*---------------------------------------------------------------------*
688 :h3. Decoding record with any element from specific namespace
689 .*---------------------------------------------------------------------*
692 <TC - Decoding record with any element from specific namespace>
696 type component Test_CT{};
700 type record any_elem_rec {
702 universal charstring any_elem
705 variant(any_elem) "anyElement from 'http://www.somewhere.com'";
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)" }
711 testcase tc_any_elem() runs on Test_CT {
712 var any_elem_rec v_res;
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);
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);
726 execute(tc_any_elem());
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.
737 .*---------------------------------------------------------------------*
738 :h3. Decoding record with any element from multiple namespaces
739 .*---------------------------------------------------------------------*
742 <TC - Decoding record with any element from multiple namespaces>
746 type component Test_CT{};
750 type record any_elem_rec {
752 universal charstring any_elem
755 variant(any_elem) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
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)" }
761 testcase tc_any_elem() runs on Test_CT {
762 var any_elem_rec v_res;
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);
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);
772 // encoded { 3, "<something>not very important</something>" };
773 var octetstring v_good3 := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
774 v_res := ef_xer_dec(v_good3);
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);
784 execute(tc_any_elem());
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.
795 .*---------------------------------------------------------------------*
796 :h3. Decoding record of with any element from unqualified namespace
797 .*---------------------------------------------------------------------*
800 <TC - Decoding record of with any element from unqualified namespace>
804 type component Test_CT{};
808 type record of universal charstring any_elem_rec_of with {
810 variant([-]) "anyElement from unqualified";
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)" }
816 testcase tc_any_elem() runs on Test_CT {
817 var any_elem_rec_of v_res;
819 // encoded { "<something>not very important</something>" };
820 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
821 v_res := ef_xer_dec(v_good);
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);
831 execute(tc_any_elem());
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.
842 .*---------------------------------------------------------------------*
843 :h3. Decoding record of with any element from specific namespace
844 .*---------------------------------------------------------------------*
847 <TC - Decoding record of with any element from specific namespace>
851 type component Test_CT{};
855 type record of universal charstring any_elem_rec_of with {
857 variant([-]) "anyElement from 'http://www.somewhere.com'";
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)" }
863 testcase tc_any_elem() runs on Test_CT {
864 var any_elem_rec_of v_res;
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);
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);
878 execute(tc_any_elem());
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.
889 .*---------------------------------------------------------------------*
890 :h3. Decoding record of with any element from multiple namespaces
891 .*---------------------------------------------------------------------*
894 <TC - Decoding record of with any element from multiple namespaces>
898 type component Test_CT{};
902 type record of universal charstring any_elem_rec_of with {
904 variant([-]) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
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)" }
910 testcase tc_any_elem() runs on Test_CT {
911 var any_elem_rec_of v_res;
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);
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);
927 execute(tc_any_elem());
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.
938 .*---------------------------------------------------------------------*
939 :h2. Negative tests with decoding "anyElement except ..." variants
940 .*---------------------------------------------------------------------*
941 .*---------------------------------------------------------------------*
942 :h3. Decoding record with any element except unqualified namespace
943 .*---------------------------------------------------------------------*
946 <TC - Decoding record with any element except unqualified namespace>
950 type component Test_CT{};
954 type record any_elem_rec {
956 universal charstring any_elem
959 variant(any_elem) "anyElement except unqualified";
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)" }
965 testcase tc_any_elem() runs on Test_CT {
966 var any_elem_rec v_res;
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);
972 // encoded { 3, "<something>not very important</something>" };
973 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
974 v_res := ef_xer_dec(v_bad);
980 execute(tc_any_elem());
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.
991 .*---------------------------------------------------------------------*
992 :h3. Decoding record with any element except specific namespace
993 .*---------------------------------------------------------------------*
996 <TC - Decoding record with any element except specific namespace>
1000 type component Test_CT{};
1004 type record any_elem_rec {
1006 universal charstring any_elem
1009 variant(any_elem) "anyElement except 'http://www.somewhere.com'";
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)" }
1015 testcase tc_any_elem() runs on Test_CT {
1016 var any_elem_rec v_res;
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);
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);
1030 execute(tc_any_elem());
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.
1041 .*---------------------------------------------------------------------*
1042 :h3. Decoding record with any element except multiple namespaces
1043 .*---------------------------------------------------------------------*
1046 <TC - Decoding record with any element except multiple namespaces>
1050 type component Test_CT{};
1054 type record any_elem_rec {
1056 universal charstring any_elem
1059 variant(any_elem) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
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)" }
1065 testcase tc_any_elem() runs on Test_CT {
1066 var any_elem_rec v_res;
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);
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);
1080 execute(tc_any_elem());
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.
1091 .*---------------------------------------------------------------------*
1092 :h3. Decoding record of with any element except unqualified namespace
1093 .*---------------------------------------------------------------------*
1096 <TC - Decoding record of with any element except unqualified namespace>
1100 type component Test_CT{};
1104 type record of universal charstring any_elem_rec_of with {
1106 variant([-]) "anyElement except unqualified";
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)" }
1112 testcase tc_any_elem() runs on Test_CT {
1113 var any_elem_rec_of v_res;
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);
1119 // encoded { "<something>not very important</something>" };
1120 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1121 v_res := ef_xer_dec(v_bad);
1127 execute(tc_any_elem());
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.
1138 .*---------------------------------------------------------------------*
1139 :h3. Decoding record of with any element except specific namespace
1140 .*---------------------------------------------------------------------*
1143 <TC - Decoding record of with any element except specific namespace>
1147 type component Test_CT{};
1151 type record of universal charstring any_elem_rec_of with {
1153 variant([-]) "anyElement except 'http://www.somewhere.com'";
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)" }
1159 testcase tc_any_elem() runs on Test_CT {
1160 var any_elem_rec_of v_res;
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);
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);
1174 execute(tc_any_elem());
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.
1185 .*---------------------------------------------------------------------*
1186 :h3. Decoding record of with any element except multiple namespaces
1187 .*---------------------------------------------------------------------*
1190 <TC - Decoding record of with any element except multiple namespaces>
1194 type component Test_CT{};
1198 type record of universal charstring any_elem_rec_of with {
1200 variant([-]) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
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)" }
1206 testcase tc_any_elem() runs on Test_CT {
1207 var any_elem_rec_of v_res;
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);
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);
1221 execute(tc_any_elem());
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.
1232 .*---------------------------------------------------------------------*
1234 .*---------------------------------------------------------------------*
1235 :nl. Requirement specification(s):
1236 :nl.-------------------------------
1238 :li. 8/ETH/RUS-2003:0087 Uen - Requirement Specification for TITAN's encoder/decoder functions