Skip to content
Snippets Groups Projects
Commit 9af93b21 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ fixes for constraints issues #65

parent 91a4eeb0
No related branches found
No related tags found
No related merge requests found
...@@ -401,8 +401,8 @@ context DataElementUse ...@@ -401,8 +401,8 @@ context DataElementUse
-- 'DataElement' reference or non-empty 'argument' or non-empty 'item' -- 'DataElement' reference or non-empty 'argument' or non-empty 'item'
inv DataInstanceOrArgumentsOrItemsInDataElementUse ('If a \'dataElement\' is not specified, or if the \'dataElement\' is resolved to a \'StructuredDataType\' or a \'CollectionDataType\', either a non-empty \'argument\' set or a non-empty \'item\' set shall be specified.' + self.toString()): inv DataInstanceOrArgumentsOrItemsInDataElementUse ('If a \'dataElement\' is not specified, or if the \'dataElement\' is resolved to a \'StructuredDataType\' or a \'CollectionDataType\', either a non-empty \'argument\' set or a non-empty \'item\' set shall be specified.' + self.toString()):
not (self.dataElement.oclIsUndefined() and self.argument->isEmpty() and self.item->isEmpty()) not (self.dataElement.oclIsUndefined() and self.argument->isEmpty() and self.item->isEmpty())
and not (self.dataElement.oclIsKindOf(StructuredDataType) and self.argument->isEmpty()) and (self.dataElement.oclIsKindOf(StructuredDataInstance) or not (self.resolveDataType().oclIsKindOf(StructuredDataType) and self.argument->isEmpty()))
and not (self.dataElement.oclIsKindOf(CollectionDataType) and self.item->isEmpty()) and (self.dataElement.oclIsKindOf(CollectionDataInstance) or not (self.resolveDataType().oclIsKindOf(CollectionDataType) and self.item->isEmpty()))
-- Valid 'DataType' for items -- Valid 'DataType' for items
...@@ -584,7 +584,7 @@ context TestConfiguration ...@@ -584,7 +584,7 @@ context TestConfiguration
context Block context Block
-- Guard shall evaluate to Boolean -- Guard shall evaluate to Boolean
inv GuardType ('The type of \'guard\' shall be \'Boolean\'.' + self.toString()): inv GuardType ('The type of \'guard\' shall be \'Boolean\'.' + self.toString()):
self.guard ->forAll(g | g.expression.resolveDataType().name = 'Boolean') self.guard ->forAll(g | g.expression.resolveDataType().conformsTo('Boolean'))
-- No directly contained 'ExceptionalBehaviour's and 'PeriodicBehaviour's. -- No directly contained 'ExceptionalBehaviour's and 'PeriodicBehaviour's.
...@@ -637,7 +637,7 @@ context LocalExpression ...@@ -637,7 +637,7 @@ context LocalExpression
context BoundedLoopBehaviour context BoundedLoopBehaviour
-- No guard constraint -- No guard constraint
inv BoundedGuard ('The \'Block\' of a \'BoundedLoopBehaviour\' shall not have a \'guard\'.' + self.toString()): inv BoundedGuard ('The \'Block\' of a \'BoundedLoopBehaviour\' shall not have a \'guard\'.' + self.toString()):
self.block->forAll(b | b.guard.oclIsUndefined()) self.block.guard->isEmpty()
-- Iteration number shall be countable and positive -- Iteration number shall be countable and positive
...@@ -750,7 +750,7 @@ context AlternativeBehaviour ...@@ -750,7 +750,7 @@ context AlternativeBehaviour
context ConditionalBehaviour context ConditionalBehaviour
-- Guard for 'ConditionalBehaviour' with single block -- Guard for 'ConditionalBehaviour' with single block
inv ConditionalFirstGuard ('If there is only one \'Block\' specified, it shall have a \'guard\'.' + self.toString()): inv ConditionalFirstGuard ('If there is only one \'Block\' specified, it shall have a \'guard\'.' + self.toString()):
self.block->size() > 1 or self.block->first().guard->size() > 1 self.block->size() > 1 or self.block->first().guard->size() > 0
-- Possible else block for 'ConditionalBehaviour' with multiple blocks -- Possible else block for 'ConditionalBehaviour' with multiple blocks
...@@ -1091,7 +1091,8 @@ context TestDescriptionReference ...@@ -1091,7 +1091,8 @@ context TestDescriptionReference
-- Compatible test configurations -- Compatible test configurations
inv CompatibleConfiguration ('The \'TestConfiguration\' of the referenced (invoked) \'TestDescription\' shall be compatible with the \'TestConfiguration\' of the referencing (invoking) \'TestDescription\' under the provided \'ComponentInstanceBinding\'s between the \'ComponentInstance\'s of the \'TestConfiguration\'s of referenced and referencing \'TestDescription\'s. ' + self.toString()): inv CompatibleConfiguration ('The \'TestConfiguration\' of the referenced (invoked) \'TestDescription\' shall be compatible with the \'TestConfiguration\' of the referencing (invoking) \'TestDescription\' under the provided \'ComponentInstanceBinding\'s between the \'ComponentInstance\'s of the \'TestConfiguration\'s of referenced and referencing \'TestDescription\'s. ' + self.toString()):
self.testDescription.testConfiguration.compatibleWith( self.componentInstanceBinding->isEmpty()
or self.testDescription.testConfiguration.compatibleWith(
self.getParentTestDescription().testConfiguration, self.componentInstanceBinding) self.getParentTestDescription().testConfiguration, self.componentInstanceBinding)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment