Commit 525589b4 authored by Martti Käärik's avatar Martti Käärik
Browse files

Reverted componentInstance -> scope.

parent d1d454f8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -223,11 +223,11 @@ Block returns tdl::Block:
	;

LocalExpression returns tdl::LocalExpression:
	expression=DataUse ('on' scope=[tdl::ComponentInstance|Identifier])? 
	expression=DataUse ('on' componentInstance=[tdl::ComponentInstance|Identifier])? 
	;

LocalLoopExpression returns tdl::LocalExpression:
	expression=DataUse 'times' ('on' scope=[tdl::ComponentInstance|Identifier])? 
	expression=DataUse 'times' ('on' componentInstance=[tdl::ComponentInstance|Identifier])? 
	;


+6 −6
Original line number Diff line number Diff line
@@ -929,7 +929,7 @@ context Block {
  //Guard for each participating tester in locally ordered test descriptions
  constraint GuardsForParticipatingComponents {
    check:     self.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.`guard`->exists(ex | ex.scope = c))
              ->forAll(c | self.`guard`->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
    message:   self.prefix() + 
               "If the 'Block' is contained in a locally ordered 'TestDescription' then a guard shall be specified for every participating 'ComponentInstance' in the associated 'TestConfiguration' that has the role 'Tester' or there shall be no guards at all. "
@@ -948,7 +948,7 @@ context LocalExpression {
  //Local expressions in locally ordered test descriptions have 'ComponentInstance' specified
  constraint LocalExpressionComponent {
    check:     self.getParentTestDescription().isLocallyOrdered 
          implies not self.scope.oclIsUndefined()
          implies not self.componentInstance.oclIsUndefined()
    message:   self.prefix() + 
               "If the 'LocalExpression' is contained in a locally ordered 'TestDescription' then the componentInstance shall be specified. "
  }
@@ -960,14 +960,14 @@ context LocalExpression {
              ->union(self.expression.argument)
              ->including(self.expression)
              ->select(du | du.oclIsKindOf(VariableUse))
              ->forAll(du | du.oclAsType(VariableUse).componentInstance = self.scope)
              ->forAll(du | du.oclAsType(VariableUse).componentInstance = self.componentInstance)
          and self.expression.argument
              ->closure(a | a.dataUse.argument)->collect(pb | pb.dataUse)
              ->union(self.expression.argument)
              ->including(self.expression)
              ->select(du | du.oclIsKindOf(TimeLabelUse))
              ->forAll(du | du.oclAsType(TimeLabelUse).timeLabel.container().oclAsType(Behaviour)
                  .getParticipatingComponents()->includes(self.scope))
                  .getParticipatingComponents()->includes(self.componentInstance))
    message:   self.prefix() + 
               "If the componentInstance is specified then all 'Variable's and 'TimeLabel's used in the expression shall be local to that 'ComponentInstance'."
  }
@@ -1004,7 +1004,7 @@ context BoundedLoopBehaviour {
  //Iteration count in locally ordered test descriptions
  constraint  IterationCountsForParticipatingComponents {
    check:     self.block.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.numIteration->exists(ex | ex.scope = c))
              ->forAll(c | self.numIteration->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
    message:   self.prefix() + 
               "If the 'BoundedLoopBehaviour' is contained in a locally ordered 'TestDescription' then a numIteration shall be specified for every participating 'ComponentInstance' that has the role 'Tester'."
@@ -1226,7 +1226,7 @@ context PeriodicBehaviour {
  //Period for each tester in locally ordered test descriptions
  constraint PeriodForParticipatingComponents {
    check:     self.block.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.period->exists(ex | ex.scope = c))
              ->forAll(c | self.period->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
    message:   self.prefix() + 
               "If the 'PeriodicBehaviour' is contained in a locally ordered 'TestDescription' then a period shall be specified for every 'ComponentInstance' that has the role 'Tester' and for which there is a behaviour in the contained 'Block'. "
+6 −6
Original line number Diff line number Diff line
@@ -595,7 +595,7 @@ context Block
  -- Guard for each participating tester in locally ordered test descriptions
  inv GuardsForParticipatingComponents ('If the \'Block\' is contained in a locally ordered \'TestDescription\' then a guard shall be specified for every participating \'ComponentInstance\' in the associated \'TestConfiguration\' that has the role \'Tester\' or there shall be no guards at all. ' + self.toString()):
        self.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.guard->exists(ex | ex.scope = c))
              ->forAll(c | self.guard->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
  

@@ -610,7 +610,7 @@ context LocalExpression
  -- Local expressions in locally ordered test descriptions have 'ComponentInstance' specified
  inv LocalExpressionComponent ('If the \'LocalExpression\' is contained in a locally ordered \'TestDescription\' then the componentInstance shall be specified. ' + self.toString()):
        self.getParentTestDescription().isLocallyOrdered 
          implies not self.scope.oclIsUndefined()
          implies not self.componentInstance.oclIsUndefined()
  

  -- Only local variables and time labels in case of locally ordered test description
@@ -620,14 +620,14 @@ context LocalExpression
              ->union(self.expression.argument)
              ->including(self.expression)
              ->select(du | du.oclIsKindOf(VariableUse))
              ->forAll(du | du.oclAsType(VariableUse).componentInstance = self.scope)
              ->forAll(du | du.oclAsType(VariableUse).componentInstance = self.componentInstance)
          and self.expression.argument
              ->closure(a | a.dataUse.argument)->collect(pb | pb.dataUse)
              ->union(self.expression.argument)
              ->including(self.expression)
              ->select(du | du.oclIsKindOf(TimeLabelUse))
              ->forAll(du | du.oclAsType(TimeLabelUse).timeLabel.container().oclAsType(Behaviour)
                  .getParticipatingComponents()->includes(self.scope))
                  .getParticipatingComponents()->includes(self.componentInstance))
  


@@ -646,7 +646,7 @@ context BoundedLoopBehaviour
  -- Iteration count in locally ordered test descriptions
  inv  IterationCountsForParticipatingComponents ('If the \'BoundedLoopBehaviour\' is contained in a locally ordered \'TestDescription\' then a numIteration shall be specified for every participating \'ComponentInstance\' that has the role \'Tester\'.' + self.toString()):
        self.block.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.numIteration->exists(ex | ex.scope = c))
              ->forAll(c | self.numIteration->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
  

@@ -829,7 +829,7 @@ context PeriodicBehaviour
  -- Period for each tester in locally ordered test descriptions
  inv PeriodForParticipatingComponents ('If the \'PeriodicBehaviour\' is contained in a locally ordered \'TestDescription\' then a period shall be specified for every \'ComponentInstance\' that has the role \'Tester\' and for which there is a behaviour in the contained \'Block\'. ' + self.toString()):
        self.block.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.period->exists(ex | ex.scope = c))
              ->forAll(c | self.period->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
  

+6 −6
Original line number Diff line number Diff line
@@ -976,7 +976,7 @@ context Block {
    //TODO: Enum::Literal not supported -> use Enum#Literal
    check:     (not self.`guard`.isEmpty() implies //TODO: constraint shall be relaxed when there are no guards
                self.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole#SUT)
              ->forAll(c | self.`guard`->exists(ex | ex.scope = c)) //TODO: renamed componentInstance to scope
              ->forAll(c | self.`guard`->exists(ex | ex.componentInstance = c)) //TODO: renamed componentInstance to scope
          )
          or not self.getParentTestDescription().isLocallyOrdered
    message:   self.prefix() + 
@@ -996,7 +996,7 @@ context LocalExpression {
  //Local expressions in locally ordered test descriptions have 'ComponentInstance' specified
  constraint LocalExpressionComponent {
    check:     self.getParentTestDescription().isLocallyOrdered 
          implies not self.scope.oclIsUndefined() //TODO: renamed componentInstance to scope
          implies not self.componentInstance.oclIsUndefined() //TODO: renamed componentInstance to scope
    message:   self.prefix() + 
               "If the 'LocalExpression' is contained in a locally ordered 'TestDescription' then the componentInstance shall be specified. "
  }
@@ -1008,14 +1008,14 @@ context LocalExpression {
              ->includingAll(self.expression.argument)  //TODO: remove extra parethesis; replace -> with . or union with includingAll
              ->including(self.expression) //TODO: remove extra parethesis
              ->select(du | du.oclIsKindOf(VariableUse)) //TODO: remove extra parethesis -> wrong, extra paren is on next line
              ->forAll(du | du.oclAsType(VariableUse).componentInstance = self.scope) //TODO: renamed componentInstance to scope;
              ->forAll(du | du.oclAsType(VariableUse).componentInstance = self.componentInstance) //TODO: renamed componentInstance to scope;
          and self.expression.argument
              ->closure(a | a.dataUse.argument)->collect(pb | pb.dataUse)
              ->includingAll(self.expression.argument) //TODO: remove extra parethesis;  replace -> with . or union with includingAll
              ->including(self.expression) //TODO: remove extra parethesis
              ->select(du | du.oclIsKindOf(TimeLabelUse))
              ->forAll(du | du.oclAsType(TimeLabelUse).timeLabel.container()
                  .getParticipatingComponents.includes(self.scope)) //TODO: renamed componentInstance to scope
                  .getParticipatingComponents.includes(self.componentInstance)) //TODO: renamed componentInstance to scope
    message:   self.prefix() + 
               "If the componentInstance is specified then all 'Variable's and 'TimeLabel's used in the expression shall be local to that 'ComponentInstance'."
  }
@@ -1053,7 +1053,7 @@ context BoundedLoopBehaviour {
  constraint  IterationCountsForParticipatingComponents {
    //TODO: Enum::Literal not supported -> use Enum#Literal
    check:     self.block.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole#SUT)
              ->forAll(c | self.numIteration->exists(ex | ex.scope = c))  //TODO: renamed componentInstance to scope
              ->forAll(c | self.numIteration->exists(ex | ex.componentInstance = c))  //TODO: renamed componentInstance to scope
          or not self.getParentTestDescription().isLocallyOrdered
    message:   self.prefix() + 
               "If the 'BoundedLoopBehaviour' is contained in a locally ordered 'TestDescription' then a numIteration shall be specified for every participating 'ComponentInstance' that has the role 'Tester'."
@@ -1328,7 +1328,7 @@ context PeriodicBehaviour {
  constraint PeriodForParticipatingComponents {
    //TODO: Enum::Literal not supported -> use Enum#Literal
    check:     self.block.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole#SUT)
              ->forAll(c | self.period->exists(ex | ex.scope = c)) //TODO: changed to scope, NOTE: specification still says componentInstance?! -> scope is outdated? => needs to be reverted!
              ->forAll(c | self.period->exists(ex | ex.componentInstance = c)) //TODO: changed to scope, NOTE: specification still says componentInstance?! -> scope is outdated? => needs to be reverted!
          or not self.getParentTestDescription().isLocallyOrdered
    message:   self.prefix() + 
               "If the 'PeriodicBehaviour' is contained in a locally ordered 'TestDescription' then a period shall be specified for every 'ComponentInstance' that has the role 'Tester' and for which there is a behaviour in the contained 'Block'. "
+6 −6
Original line number Diff line number Diff line
@@ -595,7 +595,7 @@ context Block
  -- Guard for each participating tester in locally ordered test descriptions
  inv GuardsForParticipatingComponents ('If the \'Block\' is contained in a locally ordered \'TestDescription\' then a guard shall be specified for every participating \'ComponentInstance\' in the associated \'TestConfiguration\' that has the role \'Tester\' or there shall be no guards at all. ' + self.toString()):
        self.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.guard->exists(ex | ex.scope = c))
              ->forAll(c | self.guard->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
  

@@ -610,7 +610,7 @@ context LocalExpression
  -- Local expressions in locally ordered test descriptions have 'ComponentInstance' specified
  inv LocalExpressionComponent ('If the \'LocalExpression\' is contained in a locally ordered \'TestDescription\' then the componentInstance shall be specified. ' + self.toString()):
        self.getParentTestDescription().isLocallyOrdered 
          implies not self.scope.oclIsUndefined()
          implies not self.componentInstance.oclIsUndefined()
  

  -- Only local variables and time labels in case of locally ordered test description
@@ -620,14 +620,14 @@ context LocalExpression
              ->union(self.expression.argument)
              ->including(self.expression)
              ->select(du | du.oclIsKindOf(VariableUse))
              ->forAll(du | du.oclAsType(VariableUse).componentInstance = self.scope)
              ->forAll(du | du.oclAsType(VariableUse).componentInstance = self.componentInstance)
          and self.expression.argument
              ->closure(a | a.dataUse.argument)->collect(pb | pb.dataUse)
              ->union(self.expression.argument)
              ->including(self.expression)
              ->select(du | du.oclIsKindOf(TimeLabelUse))
              ->forAll(du | du.oclAsType(TimeLabelUse).timeLabel.container().oclAsType(Behaviour)
                  .getParticipatingComponents()->includes(self.scope))
                  .getParticipatingComponents()->includes(self.componentInstance))
  


@@ -646,7 +646,7 @@ context BoundedLoopBehaviour
  -- Iteration count in locally ordered test descriptions
  inv  IterationCountsForParticipatingComponents ('If the \'BoundedLoopBehaviour\' is contained in a locally ordered \'TestDescription\' then a numIteration shall be specified for every participating \'ComponentInstance\' that has the role \'Tester\'.' + self.toString()):
        self.block.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.numIteration->exists(ex | ex.scope = c))
              ->forAll(c | self.numIteration->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
  

@@ -829,7 +829,7 @@ context PeriodicBehaviour
  -- Period for each tester in locally ordered test descriptions
  inv PeriodForParticipatingComponents ('If the \'PeriodicBehaviour\' is contained in a locally ordered \'TestDescription\' then a period shall be specified for every \'ComponentInstance\' that has the role \'Tester\' and for which there is a behaviour in the contained \'Block\'. ' + self.toString()):
        self.block.getParticipatingComponents()->reject(c | c.role = ComponentInstanceRole::SUT)
              ->forAll(c | self.period->exists(ex | ex.scope = c))
              ->forAll(c | self.period->exists(ex | ex.componentInstance = c))
          or not self.getParentTestDescription().isLocallyOrdered
  

Loading