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 .******************************************************************************/
11 :docname.Test Description
12 :docno.7/152 91-CRL 113 200/4 Uen
16 :prep.ETH/XZ Botond Baranyi
17 :appr.ETH/XZ (Jeno Balasko)
20 :title.Test description - XER coder
22 .*---------------------------------------------------------------------*
23 :h1.PREREQUISITES AND PREPARATIONS
24 .*---------------------------------------------------------------------*
25 .*---------------------------------------------------------------------*
26 :h2.Scope of the Test Object
27 .*---------------------------------------------------------------------*
30 This TD contains test cases related to TTCN3 Executor's XER coder function.
31 For now, only "anyElement" variants are tested.
35 :p.:us.Revision Information:eus.
40 REV DATE PREPARED CHANGE
41 === ========== ======== ======
42 A 2014-04-29 EBOTBAR New document
46 .*---------------------------------------------------------------------*
48 .*---------------------------------------------------------------------*
49 :p.:us.Software Tools:eus.
56 .*---------------------------------------------------------------------*
57 :h1.REQUIREMENT-BASED TESTS
58 .*---------------------------------------------------------------------*
59 .*---------------------------------------------------------------------*
60 :h2. Negative tests with encoding "anyElement from ..." variants
61 .*---------------------------------------------------------------------*
62 .*---------------------------------------------------------------------*
63 :h3. Encoding record with any element from unqualified namespace
64 .*---------------------------------------------------------------------*
67 <TC - Encoding record with any element from unqualified namespace>
71 type component Test_CT{};
75 type record any_elem_rec {
77 universal charstring any_elem
80 variant(any_elem) "anyElement from unqualified";
83 external function ef_xer_enc(in any_elem_rec par) return octetstring
84 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
86 testcase tc_any_elem() runs on Test_CT {
87 var octetstring os_enc;
89 var any_elem_rec v_good := { 3, "<something>not very important</something>" };
90 os_enc := ef_xer_enc(v_good);
92 var any_elem_rec v_bad := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
93 os_enc := ef_xer_enc(v_bad);
98 execute(tc_any_elem());
103 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 :h3. Encoding record with any element from specific namespace
111 .*---------------------------------------------------------------------*
114 <TC - Encoding record with any element from specific namespace>
118 type component Test_CT{};
122 type record any_elem_rec {
124 universal charstring any_elem
127 variant(any_elem) "anyElement from 'http://www.somewhere.com'";
130 external function ef_xer_enc(in any_elem_rec par) return octetstring
131 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
133 testcase tc_any_elem() runs on Test_CT {
134 var octetstring os_enc;
136 var any_elem_rec v_good := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
137 os_enc := ef_xer_enc(v_good);
139 var any_elem_rec v_bad := { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
140 os_enc := ef_xer_enc(v_bad);
145 execute(tc_any_elem());
150 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 :h3. Encoding record with any element from multiple namespaces
158 .*---------------------------------------------------------------------*
161 <TC - Encoding record with any element from multiple namespaces>
165 type component Test_CT{};
169 type record any_elem_rec {
171 universal charstring any_elem
174 variant(any_elem) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
177 external function ef_xer_enc(in any_elem_rec par) return octetstring
178 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
180 testcase tc_any_elem() runs on Test_CT {
181 var octetstring os_enc;
183 var any_elem_rec v_good1 := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
184 os_enc := ef_xer_enc(v_good1);
186 var any_elem_rec v_good2 := { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
187 os_enc := ef_xer_enc(v_good2);
189 var any_elem_rec v_good3 := { 3, "<something>not very important</something>" };
190 os_enc := ef_xer_enc(v_good3);
192 var any_elem_rec v_bad := { 0, "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
193 os_enc := ef_xer_enc(v_bad);
199 execute(tc_any_elem());
204 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 :h3. Encoding record of with any element from unqualified namespace
212 .*---------------------------------------------------------------------*
215 <TC - Encoding record of with any element from unqualified namespace>
219 type component Test_CT{};
223 type record of universal charstring any_elem_rec_of with {
225 variant([-]) "anyElement from unqualified";
228 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
229 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
231 testcase tc_any_elem() runs on Test_CT {
232 var octetstring os_enc;
234 var any_elem_rec_of v_good := { "<something>not very important</something>" };
235 os_enc := ef_xer_enc(v_good);
237 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
238 os_enc := ef_xer_enc(v_bad);
243 execute(tc_any_elem());
248 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 :h3. Encoding record of with any element from specific namespace
256 .*---------------------------------------------------------------------*
259 <TC - Encoding record of with any element from specific namespace>
263 type component Test_CT{};
267 type record of universal charstring any_elem_rec_of with {
269 variant([-]) "anyElement from 'http://www.somewhere.com'";
272 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
273 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
275 testcase tc_any_elem() runs on Test_CT {
276 var octetstring os_enc;
278 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
279 os_enc := ef_xer_enc(v_good);
281 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
282 os_enc := ef_xer_enc(v_bad);
287 execute(tc_any_elem());
292 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 :h3. Encoding record of with any element from multiple namespaces
300 .*---------------------------------------------------------------------*
303 <TC - Encoding record of with any element from multiple namespaces>
307 type component Test_CT{};
311 type record of universal charstring any_elem_rec_of with {
313 variant([-]) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
316 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
317 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
319 testcase tc_any_elem() runs on Test_CT {
320 var octetstring os_enc;
322 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>",
323 "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>",
324 "<something>not very important</something>" };
325 os_enc := ef_xer_enc(v_good);
327 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
328 os_enc := ef_xer_enc(v_bad);
334 execute(tc_any_elem());
339 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 :h2. Negative tests with encoding "anyElement except ..." variants
347 .*---------------------------------------------------------------------*
348 .*---------------------------------------------------------------------*
349 :h3. Encoding record with any element except unqualified namespace
350 .*---------------------------------------------------------------------*
353 <TC - Encoding record with any element except unqualified namespace>
357 type component Test_CT{};
361 type record any_elem_rec {
363 universal charstring any_elem
366 variant(any_elem) "anyElement except unqualified";
369 external function ef_xer_enc(in any_elem_rec par) return octetstring
370 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
372 testcase tc_any_elem() runs on Test_CT {
373 var octetstring os_enc;
375 var any_elem_rec v_good := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
376 os_enc := ef_xer_enc(v_good);
378 var any_elem_rec v_bad := { 3, "<something>not very important</something>" };
379 os_enc := ef_xer_enc(v_bad);
385 execute(tc_any_elem());
390 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 :h3. Encoding record with any element except specific namespace
398 .*---------------------------------------------------------------------*
401 <TC - Encoding record with any element except specific namespace>
405 type component Test_CT{};
409 type record any_elem_rec {
411 universal charstring any_elem
414 variant(any_elem) "anyElement except 'http://www.somewhere.com'";
417 external function ef_xer_enc(in any_elem_rec par) return octetstring
418 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
420 testcase tc_any_elem() runs on Test_CT {
421 var octetstring os_enc;
423 var any_elem_rec v_good1 := { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
424 os_enc := ef_xer_enc(v_good1);
426 var any_elem_rec v_good2 := { 3, "<something>not very important</something>" };
427 os_enc := ef_xer_enc(v_good2);
429 var any_elem_rec v_bad := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
430 os_enc := ef_xer_enc(v_bad);
436 execute(tc_any_elem());
441 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 :h3. Encoding record with any element except multiple namespaces
449 .*---------------------------------------------------------------------*
452 <TC - Encoding record with any element except multiple namespaces>
456 type component Test_CT{};
460 type record any_elem_rec {
462 universal charstring any_elem
465 variant(any_elem) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
468 external function ef_xer_enc(in any_elem_rec par) return octetstring
469 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
471 testcase tc_any_elem() runs on Test_CT {
472 var octetstring os_enc;
474 var any_elem_rec v_good := { 0, "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
475 os_enc := ef_xer_enc(v_good);
477 var any_elem_rec v_bad := { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
478 os_enc := ef_xer_enc(v_bad);
484 execute(tc_any_elem());
489 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 :h3. Encoding record of with any element except unqualified namespace
497 .*---------------------------------------------------------------------*
500 <TC - Encoding record of with any element except unqualified namespace>
504 type component Test_CT{};
508 type record of universal charstring any_elem_rec_of with {
510 variant([-]) "anyElement except unqualified";
513 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
514 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
516 testcase tc_any_elem() runs on Test_CT {
517 var octetstring os_enc;
519 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
520 os_enc := ef_xer_enc(v_good);
522 var any_elem_rec_of v_bad := { "<something>not very important</something>" };
523 os_enc := ef_xer_enc(v_bad);
529 execute(tc_any_elem());
534 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 :h3. Encoding record of with any element except specific namespace
542 .*---------------------------------------------------------------------*
545 <TC - Encoding record of with any element except specific namespace>
549 type component Test_CT{};
553 type record of universal charstring any_elem_rec_of with {
555 variant([-]) "anyElement except 'http://www.somewhere.com'";
558 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
559 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
561 testcase tc_any_elem() runs on Test_CT {
562 var octetstring os_enc;
564 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
565 os_enc := ef_xer_enc(v_good);
567 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
568 os_enc := ef_xer_enc(v_bad);
574 execute(tc_any_elem());
579 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 :h3. Encoding record of with any element except multiple namespaces
587 .*---------------------------------------------------------------------*
590 <TC - Encoding record of with any element except multiple namespaces>
594 type component Test_CT{};
598 type record of universal charstring any_elem_rec_of with {
600 variant([-]) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
603 external function ef_xer_enc(in any_elem_rec_of par) return octetstring
604 with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
606 testcase tc_any_elem() runs on Test_CT {
607 var octetstring os_enc;
609 var any_elem_rec_of v_good := { "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
610 os_enc := ef_xer_enc(v_good);
612 var any_elem_rec_of v_bad := { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
613 os_enc := ef_xer_enc(v_bad);
619 execute(tc_any_elem());
623 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 :h2. Negative tests with decoding "anyElement from ..." variants
631 .*---------------------------------------------------------------------*
632 .*---------------------------------------------------------------------*
633 :h3. Decoding record with any element from unqualified namespace
634 .*---------------------------------------------------------------------*
637 <TC - Decoding record with any element from unqualified namespace>
641 type component Test_CT{};
645 type record any_elem_rec {
647 universal charstring any_elem
650 variant(any_elem) "anyElement from unqualified";
653 external function ef_xer_dec(in octetstring par) return any_elem_rec
654 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
656 testcase tc_any_elem() runs on Test_CT {
657 var any_elem_rec v_res;
659 // encoded { 3, "<something>not very important</something>" };
660 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
661 v_res := ef_xer_dec(v_good);
663 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
664 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
665 v_res := ef_xer_dec(v_bad);
671 execute(tc_any_elem());
676 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 :h3. Decoding record with any element from specific namespace
684 .*---------------------------------------------------------------------*
687 <TC - Decoding record with any element from specific namespace>
691 type component Test_CT{};
695 type record any_elem_rec {
697 universal charstring any_elem
700 variant(any_elem) "anyElement from 'http://www.somewhere.com'";
703 external function ef_xer_dec(in octetstring par) return any_elem_rec
704 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
706 testcase tc_any_elem() runs on Test_CT {
707 var any_elem_rec v_res;
709 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
710 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
711 v_res := ef_xer_dec(v_good);
713 // encoded { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
714 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E36313C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
715 v_res := ef_xer_dec(v_bad);
721 execute(tc_any_elem());
726 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 :h3. Decoding record with any element from multiple namespaces
734 .*---------------------------------------------------------------------*
737 <TC - Decoding record with any element from multiple namespaces>
741 type component Test_CT{};
745 type record any_elem_rec {
747 universal charstring any_elem
750 variant(any_elem) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
753 external function ef_xer_dec(in octetstring par) return any_elem_rec
754 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
756 testcase tc_any_elem() runs on Test_CT {
757 var any_elem_rec v_res;
759 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
760 var octetstring v_good1 := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
761 v_res := ef_xer_dec(v_good1);
763 // encoded { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
764 var octetstring v_good2 := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E36313C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
765 v_res := ef_xer_dec(v_good2);
767 // encoded { 3, "<something>not very important</something>" };
768 var octetstring v_good3 := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
769 v_res := ef_xer_dec(v_good3);
771 // encoded { 0, "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
772 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E303C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D656F74686572706C6163652E636F6D223E677265656E3C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
773 v_res := ef_xer_dec(v_bad);
779 execute(tc_any_elem());
784 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 :h3. Decoding record of with any element from unqualified namespace
792 .*---------------------------------------------------------------------*
795 <TC - Decoding record of with any element from unqualified namespace>
799 type component Test_CT{};
803 type record of universal charstring any_elem_rec_of with {
805 variant([-]) "anyElement from unqualified";
808 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
809 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
811 testcase tc_any_elem() runs on Test_CT {
812 var any_elem_rec_of v_res;
814 // encoded { "<something>not very important</something>" };
815 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
816 v_res := ef_xer_dec(v_good);
818 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
819 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
820 v_res := ef_xer_dec(v_bad);
826 execute(tc_any_elem());
831 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': While checking anyElement: XML namespace "http://www.somewhere.com" is not in the allowed namespace list.
837 .*---------------------------------------------------------------------*
838 :h3. Decoding record of with any element from specific namespace
839 .*---------------------------------------------------------------------*
842 <TC - Decoding record of with any element from specific namespace>
846 type component Test_CT{};
850 type record of universal charstring any_elem_rec_of with {
852 variant([-]) "anyElement from 'http://www.somewhere.com'";
855 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
856 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
858 testcase tc_any_elem() runs on Test_CT {
859 var any_elem_rec_of v_res;
861 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
862 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
863 v_res := ef_xer_dec(v_good);
865 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
866 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
867 v_res := ef_xer_dec(v_bad);
873 execute(tc_any_elem());
878 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': While checking anyElement: XML namespace "http://www.somewhereelse.com" is not in the allowed namespace list.
884 .*---------------------------------------------------------------------*
885 :h3. Decoding record of with any element from multiple namespaces
886 .*---------------------------------------------------------------------*
889 <TC - Decoding record of with any element from multiple namespaces>
893 type component Test_CT{};
897 type record of universal charstring any_elem_rec_of with {
899 variant([-]) "anyElement from unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
902 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
903 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
905 testcase tc_any_elem() runs on Test_CT {
906 var any_elem_rec_of v_res;
908 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>",
909 // "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>",
910 // "<something>not very important</something>" };
911 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
912 v_res := ef_xer_dec(v_good);
914 // encoded { "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
915 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D656F74686572706C6163652E636F6D223E677265656E3C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
916 v_res := ef_xer_dec(v_bad);
922 execute(tc_any_elem());
927 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': While checking anyElement: XML namespace "http://www.someotherplace.com" is not in the allowed namespace list.
933 .*---------------------------------------------------------------------*
934 :h2. Negative tests with decoding "anyElement except ..." variants
935 .*---------------------------------------------------------------------*
936 .*---------------------------------------------------------------------*
937 :h3. Decoding record with any element except unqualified namespace
938 .*---------------------------------------------------------------------*
941 <TC - Decoding record with any element except unqualified namespace>
945 type component Test_CT{};
949 type record any_elem_rec {
951 universal charstring any_elem
954 variant(any_elem) "anyElement except unqualified";
957 external function ef_xer_dec(in octetstring par) return any_elem_rec
958 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
960 testcase tc_any_elem() runs on Test_CT {
961 var any_elem_rec v_res;
963 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
964 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
965 v_res := ef_xer_dec(v_good);
967 // encoded { 3, "<something>not very important</something>" };
968 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E333C2F6E6F745F757365643E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265633E0A0A'O;
969 v_res := ef_xer_dec(v_bad);
975 execute(tc_any_elem());
980 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 :h3. Decoding record with any element except specific namespace
988 .*---------------------------------------------------------------------*
991 <TC - Decoding record with any element except specific namespace>
995 type component Test_CT{};
999 type record any_elem_rec {
1001 universal charstring any_elem
1004 variant(any_elem) "anyElement except 'http://www.somewhere.com'";
1007 external function ef_xer_dec(in octetstring par) return any_elem_rec
1008 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1010 testcase tc_any_elem() runs on Test_CT {
1011 var any_elem_rec v_res;
1013 // encoded { 61, "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
1014 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E36313C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
1015 v_res := ef_xer_dec(v_good);
1017 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
1018 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
1019 v_res := ef_xer_dec(v_bad);
1025 execute(tc_any_elem());
1030 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 :h3. Decoding record with any element except multiple namespaces
1038 .*---------------------------------------------------------------------*
1041 <TC - Decoding record with any element except multiple namespaces>
1045 type component Test_CT{};
1049 type record any_elem_rec {
1051 universal charstring any_elem
1054 variant(any_elem) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
1057 external function ef_xer_dec(in octetstring par) return any_elem_rec
1058 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1060 testcase tc_any_elem() runs on Test_CT {
1061 var any_elem_rec v_res;
1063 // encoded { 0, "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
1064 var octetstring v_good := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E303C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D656F74686572706C6163652E636F6D223E677265656E3C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
1065 v_res := ef_xer_dec(v_good);
1067 // encoded { -5, "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
1068 var octetstring v_bad := '3C616E795F656C656D5F7265633E0A093C6E6F745F757365643E2D353C2F6E6F745F757365643E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265633E0A0A'O;
1069 v_res := ef_xer_dec(v_bad);
1075 execute(tc_any_elem());
1080 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 :h3. Decoding record of with any element except unqualified namespace
1088 .*---------------------------------------------------------------------*
1091 <TC - Decoding record of with any element except unqualified namespace>
1095 type component Test_CT{};
1099 type record of universal charstring any_elem_rec_of with {
1101 variant([-]) "anyElement except unqualified";
1104 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
1105 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1107 testcase tc_any_elem() runs on Test_CT {
1108 var any_elem_rec_of v_res;
1110 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
1111 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1112 v_res := ef_xer_dec(v_good);
1114 // encoded { "<something>not very important</something>" };
1115 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C736F6D657468696E673E6E6F74207665727920696D706F7274616E743C2F736F6D657468696E673E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1116 v_res := ef_xer_dec(v_bad);
1122 execute(tc_any_elem());
1127 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': While checking anyElement: The unqualified XML namespace is in the excluded namespace list.
1133 .*---------------------------------------------------------------------*
1134 :h3. Decoding record of with any element except specific namespace
1135 .*---------------------------------------------------------------------*
1138 <TC - Decoding record of with any element except specific namespace>
1142 type component Test_CT{};
1146 type record of universal charstring any_elem_rec_of with {
1148 variant([-]) "anyElement except 'http://www.somewhere.com'";
1151 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
1152 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1154 testcase tc_any_elem() runs on Test_CT {
1155 var any_elem_rec_of v_res;
1157 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
1158 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1159 v_res := ef_xer_dec(v_good);
1161 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhere.com"">red</xyz:color>" };
1162 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D6577686572652E636F6D223E7265643C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1163 v_res := ef_xer_dec(v_bad);
1169 execute(tc_any_elem());
1174 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': While checking anyElement: XML namespace "http://www.somewhere.com" is in the excluded namespace list.
1180 .*---------------------------------------------------------------------*
1181 :h3. Decoding record of with any element except multiple namespaces
1182 .*---------------------------------------------------------------------*
1185 <TC - Decoding record of with any element except multiple namespaces>
1189 type component Test_CT{};
1193 type record of universal charstring any_elem_rec_of with {
1195 variant([-]) "anyElement except unqualified, 'http://www.somewhere.com', 'http://www.somewhereelse.com'";
1198 external function ef_xer_dec(in octetstring par) return any_elem_rec_of
1199 with { extension "prototype(convert) decode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" }
1201 testcase tc_any_elem() runs on Test_CT {
1202 var any_elem_rec_of v_res;
1204 // encoded { "<xyz:color xmlns:xyz=""http://www.someotherplace.com"">green</xyz:color>" };
1205 var octetstring v_good := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D656F74686572706C6163652E636F6D223E677265656E3C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1206 v_res := ef_xer_dec(v_good);
1208 // encoded { "<xyz:color xmlns:xyz=""http://www.somewhereelse.com"">blue</xyz:color>" };
1209 var octetstring v_bad := '3C616E795F656C656D5F7265635F6F663E0A093C78797A3A636F6C6F7220786D6C6E733A78797A3D22687474703A2F2F7777772E736F6D657768657265656C73652E636F6D223E626C75653C2F78797A3A636F6C6F723E0A3C2F616E795F656C656D5F7265635F6F663E0A0A'O;
1210 v_res := ef_xer_dec(v_bad);
1216 execute(tc_any_elem());
1221 Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': While checking anyElement: XML namespace "http://www.somewhereelse.com" is in the excluded namespace list.
1227 .*---------------------------------------------------------------------*
1229 .*---------------------------------------------------------------------*
1230 :nl. Requirement specification(s):
1231 :nl.-------------------------------
1233 :li. 8/ETH/RUS-2003:0087 Uen - Requirement Specification for TITAN's encoder/decoder functions