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