Commit 5990e11c authored by Martti Käärik's avatar Martti Käärik
Browse files

Fixes to ExceptionalBehaviour and OptionalBehaviour constraints.

parent ee18a88c
Loading
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -700,9 +700,9 @@ context AlternativeBehaviour
  inv AlternativeBlocksComponent ('If the containing \'TestDescription\' is locally ordered then all \'Block\'s shall start with a tester-input event of the same \'ComponentInstance\'. ' + self.toString()):
        let initial = self.block.behaviour->first() in
          Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->size() = 1 or not self.getParentTestDescription().isLocallyOrdered
  

@@ -710,9 +710,9 @@ context AlternativeBehaviour
  inv AlternativeBehaviourParticipation ('If the \'AlternativeBehaviour\' is contained in a locally ordered \'TestDescription\' then no other tester \'ComponentInstance\' shall participate in any block than the target of the first tester-input event and \'ComponentInstance\'s participating in blocks of contained \'OptionalBehaviour\'s. ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance),
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance),
          nonOptionalBlocks = self.block->closure(
              b | b.behaviour->reject(oclIsKindOf(OptionalBehaviour))
                  ->select(oclIsKindOf(SingleCombinedBehaviour)).oclAsType(SingleCombinedBehaviour).block
@@ -729,9 +729,9 @@ context AlternativeBehaviour
  inv OptionalAlternativeBehaviour ('A block of an \'AlternativeBehaviour\' if the containing \'TestDescription\' is locally ordered, shall only contain \'OptionalBehaviour\'(s) whose source \'ComponentInstance\' is the same as the target of the first tester-input event of that \'Block\'. ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          in
          self.block.behaviour->select(oclIsKindOf(OptionalBehaviour)) .oclAsType(OptionalBehaviour).block
              ->first().oclAsType(Interaction).sourceGate.component->forAll(c | targetComponent->includes(c))
@@ -778,9 +778,9 @@ context ExceptionalBehaviour
  inv ExceptionalGuardedandTargetComponent ('If the containing \'TestDescription\' is locally ordered and guardedComponent is specified then the \'Block\'s shall start with tester-input event of the same \'ComponentInstance\' as specified in guardedComponent. ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          in
          guardedComponent->includesAll(targetComponent)
          or not self.getParentTestDescription().isLocallyOrdered
@@ -790,9 +790,9 @@ context ExceptionalBehaviour
  inv ExceptionalBehaviourParticipation ('If the \'ExceptionalBehaviour\' is contained in a locally ordered \'TestDescription\' then no other tester \'ComponentInstance\' shall participate in any block than the target of the first tester-input event and \'ComponentInstance\'s participating in blocks of contained \'OptionalBehaviour\'s . ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance),
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance),
          nonOptionalBlocks = self.block->closure(
              b | b.behaviour->reject(oclIsKindOf(OptionalBehaviour))
                  ->select(oclIsKindOf(SingleCombinedBehaviour)).oclAsType(SingleCombinedBehaviour).block
@@ -809,12 +809,12 @@ context ExceptionalBehaviour
  inv OptionalExceptionalBehaviour ('A block of an \'ExceptionalBehaviour\' if the containing \'TestDescription\' is locally ordered, shall only contain \'OptionalBehaviour\'(s) whose source \'ComponentInstance\' is the same as the target of the first tester-input event of that \'Block\'. ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          in
          self.block.behaviour->select(oclIsKindOf(OptionalBehaviour)).oclAsType(OptionalBehaviour).block
              ->first().oclAsType(Interaction).sourceGate.component->forAll(c | targetComponent->includes(c))
          self.block.behaviour->select(oclIsKindOf(OptionalBehaviour)).oclAsType(OptionalBehaviour)->forAll(op | op.block->asSequence()
              ->first().oclAsType(Interaction).sourceGate.component->forAll(c | targetComponent->includes(c)))
          or not self.getParentTestDescription().isLocallyOrdered
  

+20 −20
Original line number Diff line number Diff line
@@ -738,9 +738,9 @@ context AlternativeBehaviour
  inv AlternativeBlocksComponent ('If the containing \'TestDescription\' is locally ordered then all \'Block\'s shall start with a tester-input event of the same \'ComponentInstance\'. ' + self.toString()):
        let initial = self.block.behaviour->first() in
          Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->size() = 1 or not self.getParentTestDescription().isLocallyOrdered
  

@@ -748,9 +748,9 @@ context AlternativeBehaviour
  inv AlternativeBehaviourParticipation ('If the \'AlternativeBehaviour\' is contained in a locally ordered \'TestDescription\' then no other tester \'ComponentInstance\' shall participate in any block than the target of the first tester-input event and \'ComponentInstance\'s participating in blocks of contained \'OptionalBehaviour\'s. ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance),
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance),
          nonOptionalBlocks = self.block->closure(
              b | b.behaviour->reject(oclIsKindOf(OptionalBehaviour))
                  ->select(oclIsKindOf(SingleCombinedBehaviour)).oclAsType(SingleCombinedBehaviour).block
@@ -767,9 +767,9 @@ context AlternativeBehaviour
  inv OptionalAlternativeBehaviour ('A block of an \'AlternativeBehaviour\' if the containing \'TestDescription\' is locally ordered, shall only contain \'OptionalBehaviour\'(s) whose source \'ComponentInstance\' is the same as the target of the first tester-input event of that \'Block\'. ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          in
          self.block.behaviour->select(oclIsKindOf(OptionalBehaviour)) .oclAsType(OptionalBehaviour).block
              ->first().oclAsType(Interaction).sourceGate.component->forAll(c | targetComponent->includes(c))
@@ -816,9 +816,9 @@ context ExceptionalBehaviour
  inv ExceptionalGuardedandTargetComponent ('If the containing \'TestDescription\' is locally ordered and guardedComponent is specified then the \'Block\'s shall start with tester-input event of the same \'ComponentInstance\' as specified in guardedComponent. ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          in
          guardedComponent->includesAll(targetComponent)
          or not self.getParentTestDescription().isLocallyOrdered
@@ -828,9 +828,9 @@ context ExceptionalBehaviour
  inv ExceptionalBehaviourParticipation ('If the \'ExceptionalBehaviour\' is contained in a locally ordered \'TestDescription\' then no other tester \'ComponentInstance\' shall participate in any block than the target of the first tester-input event and \'ComponentInstance\'s participating in blocks of contained \'OptionalBehaviour\'s . ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance),
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance),
          nonOptionalBlocks = self.block->closure(
              b | b.behaviour->reject(oclIsKindOf(OptionalBehaviour))
                  ->select(oclIsKindOf(SingleCombinedBehaviour)).oclAsType(SingleCombinedBehaviour).block
@@ -847,12 +847,12 @@ context ExceptionalBehaviour
  inv OptionalExceptionalBehaviour ('A block of an \'ExceptionalBehaviour\' if the containing \'TestDescription\' is locally ordered, shall only contain \'OptionalBehaviour\'(s) whose source \'ComponentInstance\' is the same as the target of the first tester-input event of that \'Block\'. ' + self.toString()):
        let initial = self.block.behaviour->first(),
          targetComponent = Set{}
          ->including(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->including(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> including(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          ->includingAll(initial->select(oclIsKindOf(Interaction)).oclAsType(Interaction).target.targetGate.component)
          ->includingAll(initial->select(oclIsKindOf(Quiescence)).oclAsType(Quiescence).componentInstance)
          -> includingAll(initial->select(oclIsKindOf(TimeOut)).oclAsType(TimeOut).componentInstance)
          in
          self.block.behaviour->select(oclIsKindOf(OptionalBehaviour)).oclAsType(OptionalBehaviour).block
              ->first().oclAsType(Interaction).sourceGate.component->forAll(c | targetComponent->includes(c))
          self.block.behaviour->select(oclIsKindOf(OptionalBehaviour)).oclAsType(OptionalBehaviour)->forAll(op | op.block->asSequence()
              ->first().oclAsType(Interaction).sourceGate.component->forAll(c | targetComponent->includes(c)))
          or not self.getParentTestDescription().isLocallyOrdered