Commit 766f2f1d authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ updated manifest

+ temporary copies of ocl constraints
parent bc76dd2b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4,5 +4,6 @@
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="epsilon"/>
	<classpathentry kind="src" path="ocl"/>
	<classpathentry kind="output" path="bin"/>
</classpath>
+2 −1
Original line number Diff line number Diff line
@@ -18,5 +18,6 @@ Require-Bundle: org.eclipse.emf.common,
 org.eclipse.emf.ecore.xmi,
 org.etsi.mts.tdl.model,
 org.eclipse.xtext,
 org.eclipse.epsilon.common.dt
 org.eclipse.epsilon.common.dt,
 org.eclipse.ocl.xtext.completeocl
Export-Package: org.etsi.mts.tdl.constraints.evl
+29 −0
Original line number Diff line number Diff line
import 'http://www.etsi.org/spec/TDL/1.4.1'
import 'http://www.etsi.org/spec/TDL/1.3.1/configurations'

package extendedconfigurations

context ComponentMerge
  -- No self-merging
  inv NoSelfMerge ('A \'ComponentInstance\' shall not be merged with itself, i.e. the source and target \'ComponentInstance\'s specified by means of the \'ComponentReference\'s shall be different. ' + self.toString()):
        not (self.component.component = self.target.component and
               self.component.configuration = self.target.configuration)
  

  -- Conforming 'ComponentType's
  inv ComponentMergeType ('The \'ComponentInstance\' specified by means of the target \'ComponentReference\'s shall have a \'ComponentType\' which conforms to the \'ComponentType\' of the source \'ComponentReference\'. ' + self.toString()):
        self.target.component.type.conformsTo(self.component.component.type)
  



context ComponentAlias
  -- Mandatory name
  inv AliasMandatoryName ('The \'name\' property of the \'ComponentAlias\' shall be set and it shall not be an empty String.' + self.toString()):
        not self.name.oclIsUndefined() and self.name.size() > 0
  




endpackage
+1153 −0

File added.

Preview size limit exceeded, changes collapsed.

+134 −0
Original line number Diff line number Diff line
import 'http://www.etsi.org/spec/TDL/1.4.1'
import 'http://www.etsi.org/spec/TDL/1.3.1/structured'

package structuredobjectives

context PICSReference
  -- Combining Multiple 'PICSReference's 
  inv MultiplePICS ('A \'Comment\' with body containing an \'and\' or \'or\' shall be attached to the \'PICSReference\' as a Boolean operand if there are two or more \'PICSReference\'s and it is not the first \'PICSReference\'.' + self.toString()):
    self.getTestObjective().picsReference->size() < 2 
      or self.getTestObjective().picsReference->forAll(p | 
        self.getTestObjective().picsReference->at(0) = p
        or (not p.comment->isEmpty()
            and (p.comment->first()._'body' = 'and'
                or p.comment->first()._'body' = 'or')))
  



context RepeatedEventSequence
  -- Either 'repetitions', or 'interval' or neither shall be specified
  inv RepetitionOrInterval ('At most one of the optional properties \'repetitions\' or \'interval\' shall be defined.' + self.toString()):
        self.repetitions.oclIsUndefined() or self.interval.oclIsUndefined()
  

  -- The 'repetitions' 'Value' shall be countable and positive
  inv RepetitionCount ('The expression assigned to the \'repetitions\' property shall evaluate to a positive and countable \'Value\'.' + self.toString()):
        true --This constraint cannot be expressed in OCL
  

  -- The 'interval' 'Value' shall be countable and positive
  inv RepetitionInterval ('The expression assigned to the \'repetitions\' property shall evaluate to a positive and countable \'Value\'' + self.toString()):
        true --This constraint cannot be expressed in OCL
  



--context EventOccurrence
--  -- Combining Multiple 'EventOccurrence's
--  inv MultipleEventOccurrences ('A \'Comment\' with body containing an \'and\' or \'or\' shall be attached to the \'EventOccurrence\' as an operand if there are two or more \'EventOccurrence\'s and it is not the first \'EventOccurrence\'.' + self.toString()):
--    self.container().oclIsTypeOf(EventSpecificationTemplate)
--      or self.container().events->size() < 2 
--      or self.container().events->forAll(o | 
--      self.container().events->at(0) = o
--      or (not o.comment->isEmpty()
--      and (o.comment->first()._'body' = 'and'
--      or o.comment->first()._'body' = 'or')))
  



context EntityReference
  -- An 'Entity' or a 'ComponentInstance' shall be referenced.
  inv EntityOrComponentInstance ('There shall be a reference to an \'Entity\' or a \'ComponentInstance\' but not both.' + self.toString()):
    (not self.entity.oclIsUndefined() and self.component.oclIsUndefined())
      or (self.entity.oclIsUndefined() and not self.component.oclIsUndefined())
  



context Content
  -- No nested 'Content's if 'Value' is provided 
  inv ContentOrValue ('Either nested \'Content\'s or \'Value\' may be specified within \'Content\', but not both.' + self.toString()):
        self.content->isEmpty() or self.value.oclIsUndefined()
  



context LiteralValueReference
  -- Referenced 'LiteralValue' visibility
  inv VisibleValue ('Only \'LiteralValue\'s defined within previous \'EventOccurrence\'s of the containing \'StructuredTestObjective\' may be referenced.' + self.toString()):
    self.getTestObjective().contains(self.content) 
      and self.getTestObjective().indexOf(self.content) < self.getTestObjective().indexOf(self)
  



context ContentReference
  -- Referenced 'Content' visibility
  inv VisibleContent ('Only \'Content\' defined within previous \'EventOccurrence\'s of the containing \'StructuredTestObjective\' may be referenced.' + self.toString()):
    self.getTestObjective().contains(self.content) 
      and self.getTestObjective().indexOf(self.content) < self.getTestObjective().indexOf(self)
  



context DataReference
  -- 'DataUse' restrictions within 'DataReference'
  inv DataReferenceContents ('Only \'StaticDataUse\' may be used directly or indirectly in \'ParameterBinding\'s of the \'StaticDataUse\' within a \'DataReference\'.' + self.toString()):
    self.content.oclIsTypeOf(StaticDataUse)
          and self.content.argument->forAll(a | a.dataUse.oclIsKindOf(StaticDataUse))
          and self.content.argument->closure(a | 
          a.dataUse.argument)->forAll(a|a.dataUse.oclIsKindOf(StaticDataUse))
  

  -- No 'reduction' within 'DataReference'
  inv DataReferenceReduction ('The \'reduction\' property of \'StaticDataUse\' inherited from \'DataUse\' shall not be used within a \'DataReference\'.' + self.toString()):
    self.content.reduction->isEmpty()
  



context EventTemplateOccurrence
  -- 'EntityReference' of referenced 'EventSpecificationTemplate'
  inv EntityTemplateOccurrenceConsistency ('If \'EntityBinding\'s are provided, the \'Entity\'s or \'ComponentInstance\'s referenced in the \'templateEntity\' properties shall also be referenced by one of the \'EntityReferences\' in the \'EventOccurrenceSpecification\' of the \'EventSpecificationTemplate\' referenced in the \'EventTemplateOccurrence\'.' + self.toString()):
        self.entityBinding->forAll(b | 
              (not b.templateEntity.entity.oclIsUndefined() 
           and (b.templateEntity.entity = 
                    self.eventTemplate.eventSpecification.entityReference.entity))
           or (not b.templateEntity.component.oclIsUndefined() 
           and (b.templateEntity.component = 
                    self.eventTemplate.eventSpecification.entityReference.component)
           or self.eventTemplate.eventSpecification.oppositeEntityReference->exists(e | 
                  (not b.templateEntity.entity.oclIsUndefined() 
               and (e.entity = b.templateEntity.entity))
               or (not b.templateEntity.component.oclIsUndefined() 
               and (e.component = b.templateEntity.component)))))
  



context VariantBinding
  -- Referenced 'Value' of 'VariantBinding'
  inv VariantBindingValues ('If the \'value\' property references a \'LiteralValue\' or \'Content\' element, the referenced element shall be contained in the \'StructuredTestObjective\' containing the \'VariantBinding\'.' + self.toString()):
        self.value.oclIsTypeOf(LiteralValueReference) implies
          self.value.oclAsType(LiteralValueReference).content.getTestObjective() = self.getTestObjective()
          and 
          self.value.oclIsKindOf(ContentReference) implies
          self.value.oclAsType(ContentReference).content.getTestObjective() = self.getTestObjective()
  




endpackage