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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/ISO19136-AnxE/test-027.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:    027
4Description:    Assert byReference targeted association-end must have identity
5                                i.e. it must be stereotyped as either
6                                FeatureType, Type, Union, featureType, type, union or
7                                no-stereotype ("" or ()).
8Reference:             
9~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:)
10
11import module namespace mod-fr = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:framework"
12at "#{ROOT_URL}ISO19136-AnxE/modules/module-framework-functions.xq";
13
14declare namespace UML   = "omg.org/UML1.3";
15declare namespace cr    = "http://ndg.service.newmoon.conftest-result/1.0";
16
17(: Declare local variables, particular to this test :)
18declare variable $test-num as xs:integer := 27;
19declare variable $pass-msg as xs:string := "All byReference targeted association-ends have correct identity.";
20declare variable $fail-msg as xs:string := "The test has failed because:";
21
22(:
23        #Date:          2009-01-22
24        #Author:        Krupali Patel
25       
26        Declare the local assert function which defines a postive condition for pass.
27:)
28declare function local:assert($doc-root as node()?) as node()?
29{
30        let
31                $fail := (
32                for $asso-end in $doc-root//UML:AssociationEnd[descendant::UML:TaggedValue[@tag eq "inlineOrByReference" and @value ne "inline"] and ((following-sibling::UML:AssociationEnd | preceding-sibling::UML:AssociationEnd)/@aggregation ne "composite") and @type[not(. = "eaxmiid0") and not(. = //EAStub/@xmi.id) and (. = //UML:Class[not(UML:ModelElement.stereotype/UML:Stereotype/@name = ("FeatureType", "Type", "Union", "featureType", "type", "union", "", ()) )]/@xmi.id)]]
33                return
34                        <cr:message>{ concat("byReference targeted association-end &quot;", $asso-end/string(@name), "&quot; does not have correct identity.") }</cr:message>
35        )
36        return
37                if (empty($fail)) then ()
38                else
39                        <cr:fail>
40                                <cr:messages>{ $fail }</cr:messages>
41                        </cr:fail>     
42};
43
44(: Create a new result element :)
45mod-fr:new-result($test-num, $pass-msg, $fail-msg, local:assert(/))
Note: See TracBrowser for help on using the repository browser.