Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
(self.replyTo.oclIsUndefined() and self.signature.parameter->select(p | p.kind = ParameterKind::In)
->forAll(p | self.argument.parameter->includes(p)))
or (not self.replyTo.oclIsUndefined() and self.signature.parameter->reject(p | p.kind = ParameterKind::In)
->forAll(p | self.argument.parameter->includes(p)))
-- Use of variables in the 'argument' specification
inv ProcedureCallVariableUse ('The use of \'Variable\'s in the \'DataUse\' specifications in \'ParameterBinding\'s shall be restricted to \'Variable\'s of \'ComponentInstance\'s that participate in this \'ProcedureCall\' via the provided \'GateReference\'s. ' + self.toString()):
self.argument
->closure(pb | pb.dataUse.argument)->union(self.argument)->collect(pb | pb.dataUse)
->select(du | du.oclIsKindOf(VariableUse))
->forAll(du | self.getParticipatingComponents()->includes(
du.oclAsType(VariableUse).componentInstance))
-- Reply not starting event of exceptional behaviour
inv ProcedureCallReplyNotInExceptional ('A \'ProcedureCall\' that specifies replyTo shall not be the first behaviour of a block in an \'ExceptionalBehaviour\'. ' + self.toString()):
self.replyTo.oclIsUndefined() or not self.container().container().oclIsKindOf(ExceptionalBehaviour)
context Target
-- Variable and target gate of the same component instance
inv TargetComponent ('The \'Variable\'s referenced by \'valueAssignment\' shall exist in the same \'ComponentType\' as the \'GateInstance\' that is referred to by the \'GateReference\' of the \'targetGate\'.' + self.toString()):
self.valueAssignment->isEmpty()
or self.targetGate.component.type.allVariables()->includesAll(self.valueAssignment.variable)
-- Variable of a tester component only
inv TargetVariableComponentRole ('If a \'ValueAssignment\' is specified, the \'ComponentInstance\' referenced by \'targetGate\' shall be in the role \'Tester\'.' + self.toString()):
self.valueAssignment->isEmpty () or self.targetGate.component.role = ComponentInstanceRole::Tester
context ValueAssignment
-- Conforming data type for 'parameter' and 'variable'
inv AssignedParamterType ('If the \'parameter\' is specified then its type shall conform to the type of the \'variable\'. ' + self.toString()):
self.parameter.oclIsUndefined() or self.parameter.dataType.conformsTo(self.variable.dataType)
-- Parameter of associated procedure signature
inv AssignedProcedureParameter ('If the \'parameter\' is specified then it shall be contained in the \'ProcedureSignature\' that is referred in the \'signature\' ot the \'ProcedureCall\' containing this \'ValueAssignment\'.' + self.toString()):
self.parameter.oclIsUndefined()
or (self.container().container().oclIsKindOf(ProcedureCall) and
self.container().container().oclAsType(ProcedureCall).signature.parameter->includes(self.parameter))
-- [Figure 9.6: Test description reference]
context TestDescriptionReference
-- All test description parameters bound
inv AllTestDescriptionParametersBound ('For each \'FormalParameter\' defined in \'formalParameter of\' the referenced \'TestDescription\' there shall be a \'ParameterBinding\' in \'argument\' that refers to that \'FormalParameter\' in \'parameter\'.' + self.toString()):
self.testDescription.formalParameter->forAll(p | self.argument->exists(a | a.parameter = p))
-- No use of variables in arguments
inv NoVariablesInLocallyOrderedTestDescriptionReference ('In locally ordered \'TestDescription\'s, \'DataUse\' expressions used to describe arguments shall not contain variables directly or indirectly in \'TestDescriptionReference\'s.' + self.toString()):
self.argument. dataUse->forAll(du |
not du.oclIsKindOf(VariableUse)
and du.argument->forAll(a | not a.dataUse.oclIsKindOf(VariableUse))
and du.argument->closure(a | a.dataUse.argument)->forAll(a |
not a.dataUse.oclIsKindOf(VariableUse)))
-- No use of time labels in arguments
inv NoTimeLabelsInLocallyOrderedTestDescriptionReference ('In locally ordered \'TestDescription\'s, \'DataUse\' expressions used to describe arguments shall not contain time labels directly or indirectly in \'TestDescriptionReference\'s.' + self.toString()):
self.argument.dataUse->forAll(du |
not du.oclIsKindOf(TimeLabelUse)
and du.argument->forAll(a | not a.dataUse.oclIsKindOf(TimeLabelUse))
and du.argument->closure(a | a.dataUse.argument)->forAll(a |
not a.dataUse.oclIsKindOf(TimeLabelUse)))
-- Restriction to 1:1 component instance bindings
inv UniqueComponentBindings ('If component instance bindings are provided, the component instances referred to in the bindings shall occur at most once for the given test description reference.' + self.toString()):
self.componentInstanceBinding->isEmpty()
or self.componentInstanceBinding->forAll(b |
self.componentInstanceBinding->one(c |
c.formalComponent = b.formalComponent or c.actualComponent = b.actualComponent))
-- 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.getParentTestDescription().testConfiguration, self.componentInstanceBinding)
-- No combining of local and total ordering
inv LocalAndTotalOrdering ('The referenced \'TestDescription\' shall have the same ordering assumption as the referencing \'TestDescription\'.' + self.toString()):
self.getParentTestDescription().isLocallyOrdered = self.testDescription.isLocallyOrdered
context ComponentInstanceBinding
-- Conforming component types
inv BindingComponentTypes ('The \'ComponentType\' of the actual \'ComponentInstance\' shall conform to \'ComponentType\' of the formal \'ComponentInstance.' + self.toString()):
self.actualComponent.type.conformsTo(self.formalComponent.type)
-- Matching component instance roles
inv BindingComponentRoles ('Both, the formal and the actual component instances, shall have the same \'ComponentInstanceRole\' assigned to.' + self.toString()):
self.formalComponent.role = self.actualComponent.role
-- [Figure 9.7: Action behaviour concepts]
context ActionBehaviour
-- 'ActionBehaviour' on 'Tester' components only
inv ActionBehaviourComponentRole ('The \'ComponentInstance\' that an \'ActionBehaviour\' refers to shall be of role \'Tester\'.' + self.toString()):
self.componentInstance.oclIsUndefined() or self.componentInstance.role = ComponentInstanceRole::Tester
-- Known 'componentInstance' with locally-ordered behaviour
inv ActionBehaviourComponentInstance ('The \'ComponentInstance\' that an \'ActionBehaviour\' refers to shall be specified if the \'ActionBehaviour\' is used within a locally-ordered \'TestDescription\'.' + self.toString()):
not self.componentInstance.oclIsUndefined() or not self.getParentTestDescription().isLocallyOrdered
context ActionReference
-- All action parameters bound
inv AllActionParametersBound ('For each \'FormalParameter\' defined in \'formalParameter of\' the referenced \'Action\' there shall be a \'ParameterBinding\' in \'argument\' that refers to that \'FormalParameter\' in \'parameter\'. ' + self.toString()):
self.action.formalParameter->forAll(p | self.argument.parameter->includes(p))
-- No 'Function's in 'ActionReference'
inv ActionReferenceFunction ('The referenced \'Action\' shall not be a \'Function\'.' + self.toString()):
not self.action.oclIsTypeOf(Function)
context Assignment
-- Conforming data type
inv AssignmentDataType ('The provided \'DataUse\' expression shall conform to the \'DataType\' of the referenced \'Variable\'.' + self.toString()):
self.expression.resolveDataType().conformsTo(self.variable.variable.dataType)
-- Empty 'argument' set for 'variable'
inv AssignmentVariableArgument ('The \'argument\' and \'reduction\' sets shall be empty.' + self.toString()):
self.variable.argument->isEmpty()
endpackage