[8190] | 1 | xquery version "1.0"; |
---|
| 2 | (:~~~~~~~~~~~~~~~~~~~~~~~~~~ Conformance Test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 3 | Test Number: 026 |
---|
| 4 | Description: A composition association shall not be tagged |
---|
| 5 | inlineOrByReference="byReference" or |
---|
| 6 | inlineOrByReference="inlineOrByReference". |
---|
| 7 | Reference: |
---|
| 8 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:) |
---|
| 9 | |
---|
| 10 | import module namespace mod-fr = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:framework" |
---|
[8191] | 11 | at "#{ROOT_URL}ISO19136-AnxE/modules/module-framework-functions.xq"; |
---|
[8190] | 12 | |
---|
| 13 | import module namespace mod-xp = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:xmi-proc" |
---|
[8191] | 14 | at "#{ROOT_URL}ISO19136-AnxE/modules/module-xproc-functions.xq"; |
---|
[8190] | 15 | |
---|
| 16 | declare namespace UML = "omg.org/UML1.3"; |
---|
| 17 | declare namespace cr = "http://ndg.service.newmoon.conftest-result/1.0"; |
---|
| 18 | |
---|
| 19 | (: Declare local variables, particular to this test :) |
---|
| 20 | declare variable $test-num as xs:integer := 26; |
---|
| 21 | declare variable $pass-msg as xs:string := "The inlineOrByReference tagged value have been used correctly on all composition associations."; |
---|
| 22 | declare 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 | :) |
---|
| 30 | declare 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="", $tag/@value, "".") }</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 :) |
---|
| 48 | mod-fr:new-result($test-num, $pass-msg, $fail-msg, local:assert(/)) |
---|