/** * @description An example of a test library * @author Joanna Chimiak-Opoka */ library querylib metamodel uml require ocl.deflib require ocl.conflib public queries context Class /** * @description * Checks if a number of the context class' attributes is higher than * the maximal allowed number */ query numberOfAttributes: severity 1 let queryresult : Integer = self.numberOfAttributes() condition queryresult > maxNumberOfAttributes message 'The number of attributes of class' + self.name + ' is higher than maximal allowed number ' + '(' + queryresult + '>' + maxNumberOfAttributes + ')' endmessage endqueries endlibrary