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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/ISO19136-AnxE/test-001.xq@8406
Revision 8191, 1.5 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:    001
4Description:    Asserts the existence of at least one outermost UML:Package with the
5                                stereotype <<Application Schema>>.
6Reference:             
7~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:)
8
9import module namespace mod-fr = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:framework"
10at "#{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 := 1;
17declare variable $pass-msg as xs:string := "A package with the stereotype &lt;&lt;Application Schema&gt;&gt; is present.";
18declare variable $fail-msg as xs:string := "A package with the stereotype &lt;&lt;Application Schema&gt;&gt; is NOT present.";
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        if (exists($doc-root//UML:Package[UML:ModelElement.taggedValue/UML:TaggedValue/@tag = "stereotype" and UML:ModelElement.taggedValue/UML:TaggedValue/@value = ("Application Schema", "applicationSchema") and empty(ancestor::UML:Package)])) then ()
24        else <cr:fail />
25};
26
27(: Create a new result element :)
28mod-fr:new-result($test-num, $pass-msg, $fail-msg, local:assert(/))
Note: See TracBrowser for help on using the repository browser.