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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/ISO19136-AnxE/test-016.xq@8406
Revision 8191, 1.8 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:    016
4Description:    Asserts the package with the stereotype ï¿œLeafï¿œ shall not
5                                contain another package.
6Reference:             
7~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:)
8
9import module namespace mod-fr = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:framework"
10at "h#{ROOT_URL}ISO19136-AnxE/modules/module-framework-functions.xq";
11
12declare namespace UML   = "omg.org/UML1.3";
13declare namespace cr    = "http://ndg.service.newmoon.conftest-result/1.0";
14
15(: Declare local variables, particular to this test :)
16declare variable $test-num as xs:integer := 16;
17declare variable $pass-msg as xs:string := "A package with the stereotype <<Leaf>> DOES NOT contain another package.";
18declare variable $fail-msg as xs:string := "Package with the stereotype <<Leaf>> DOES contain another package as follow:";
19
20(: Declare the local assert function which defines a postive condition for pass :)
21declare function local:assert($doc-root as node()?) as node()?
22{
23        let
24                $fail := (
25                        for $pck in $doc-root//UML:Package[UML:ModelElement.taggedValue/UML:TaggedValue[@tag eq "stereotype" and @value = ("Leaf", "leaf")]]
26                        return
27                                for $child in $pck/descendant::UML:Package
28                                return
29                                        <cr:message>
30                                        {
31                                                concat("The stereotype &lt;&lt;Leaf&gt;&gt; package &quot;", $pck/@name, "&quot; DOES have another descendant package &quot;", $child/@name, "&quot;.")
32                                        }
33                                        </cr:message>
34                )
35        return
36                if (empty($fail)) then ()
37                else
38                        <cr:fail>
39                                <cr:messages>{ $fail }</cr:messages>
40                        </cr:fail>
41};
42
43(: Create a new result element :)
44mod-fr:new-result($test-num, $pass-msg, $fail-msg, local:assert(/))
Note: See TracBrowser for help on using the repository browser.