source: mauRepo/ISO19136-AnxE/test-026.xq @ 8191

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/ISO19136-AnxE/test-026.xq@8406
Revision 8191, 2.0 KB checked in by mnagni, 8 years ago (diff)

#{ROOT_URL}ISO19136-AnxE parametrized the import URLs

Line 
1xquery version "1.0";
2(:~~~~~~~~~~~~~~~~~~~~~~~~~~ Conformance Test  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3Test Number:    026
4Description:    A composition association shall not be tagged
5                                inlineOrByReference="byReference" or
6                                inlineOrByReference="inlineOrByReference".
7Reference:             
8~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:)
9
10import module namespace mod-fr = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:framework"
11at "#{ROOT_URL}ISO19136-AnxE/modules/module-framework-functions.xq";
12
13import module namespace mod-xp = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:xmi-proc"
14at "#{ROOT_URL}ISO19136-AnxE/modules/module-xproc-functions.xq";
15
16declare namespace UML   = "omg.org/UML1.3";
17declare namespace cr    = "http://ndg.service.newmoon.conftest-result/1.0";
18
19(: Declare local variables, particular to this test :)
20declare variable $test-num as xs:integer := 26;
21declare variable $pass-msg as xs:string := "The inlineOrByReference tagged value have been used correctly on all composition associations.";
22declare variable $fail-msg as xs:string := "The test has failed because:";
23
24(:
25        #Date:          2009-01-15
26        #Author:        Pavel Golodoniuc
27       
28        Declare the local assert function which defines a postive condition for pass.
29:)
30declare function local:assert($doc-root as node()?) as node()?
31{
32        let
33                $fail := (
34                        for $end in $doc-root//UML:AssociationEnd[@aggregation eq "composite"]
35                        let $tag := ($end/following-sibling::UML:AssociationEnd | $end/preceding-sibling::UML:AssociationEnd)/UML:ModelElement.taggedValue/UML:TaggedValue[@tag eq "inlineOrByReference" and @value ne "inline"]
36                        where exists($tag)
37                        return <cr:message>{ concat("Composition ", mod-xp:verbose-association($tag/../../../..), " should not be tagged inlineOrByReference=&quot;", $tag/@value, "&quot;.") }</cr:message>
38                )
39        return
40                if (empty($fail)) then ()
41                else
42                        <cr:fail>
43                                <cr:messages>{ $fail }</cr:messages>
44                        </cr:fail>     
45};
46
47(: Create a new result element :)
48mod-fr:new-result($test-num, $pass-msg, $fail-msg, local:assert(/))
Note: See TracBrowser for help on using the repository browser.