Commit 9af93b21 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ fixes for constraints issues #65

parent 91a4eeb0
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -401,8 +401,8 @@ context DataElementUse
  -- '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()):
        not (self.dataElement.oclIsUndefined() and self.argument->isEmpty() and self.item->isEmpty())
          and not (self.dataElement.oclIsKindOf(StructuredDataType) and self.argument->isEmpty())
          and not (self.dataElement.oclIsKindOf(CollectionDataType) and self.item->isEmpty())
          and (self.dataElement.oclIsKindOf(StructuredDataInstance) or not (self.resolveDataType().oclIsKindOf(StructuredDataType) and self.argument->isEmpty()))
          and (self.dataElement.oclIsKindOf(CollectionDataInstance) or not (self.resolveDataType().oclIsKindOf(CollectionDataType) and self.item->isEmpty()))
  

  -- Valid 'DataType' for items
@@ -584,7 +584,7 @@ context TestConfiguration
context Block
  -- Guard shall evaluate to Boolean
  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.
@@ -637,7 +637,7 @@ context LocalExpression
context BoundedLoopBehaviour
  -- No guard constraint
  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
@@ -750,7 +750,7 @@ context AlternativeBehaviour
context ConditionalBehaviour
  -- Guard for 'ConditionalBehaviour' with single block
  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
@@ -1091,7 +1091,8 @@ context TestDescriptionReference

  -- 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()):
        self.testDescription.testConfiguration.compatibleWith(
        self.componentInstanceBinding->isEmpty()
      or self.testDescription.testConfiguration.compatibleWith(
              self.getParentTestDescription().testConfiguration, self.componentInstanceBinding)