Hi,
You can ask a Fame Property if it has a primitive type.
You could use this:
entity mooseDescription allPrimitiveAttributes
Cheers,
Doru
On 15 Jul 2011, at 17:36, Andre Hora wrote:
we wrote this test
testHasExactlySamePropertiesThan
"self debug: #testHasExactlySamePropertiesThan"
| cp |
"I should have the same entity than a copy of myself"
self assert: (self nodeClass hasExactlySamePropertiesThan: self nodeClass).
self assert: (self nodeClass hasExactlySamePropertiesThan: self nodeClass
veryDeepCopy).
the previous assertion does not work because the incoming references are indeed not
pointing to the copy so this is correct that it does not work.
cp := self model entityNamed: LANOutputServer mooseName.
self deny: (self nodeClass hasExactlySamePropertiesThan: cp).
cp := self nodeClass veryDeepCopy.
cp instVarNamed: 'state' put: (cp instVarNamed: 'state')
veryDeepCopy.
cp propertyNamed: #numberOfLinesOfCode put: 12000.
"This property is described as a fame property on the entity kind but not
existing on the copy
so two entities should have different properties"
self deny: (self nodeClass hasExactlySamePropertiesThan: cp).
cp := self nodeClass veryDeepCopy.
cp instVarNamed: 'state' put: (cp instVarNamed: 'state')
veryDeepCopy.
cp propertyNamed: #NOS ifAbsentPut: 12000.
"This property is described but it does not exist on the entity kind
so two entities should have different properties"
self deny: (self nodeClass hasExactlySamePropertiesThan: cp).
Now is there a way to only access the values that are stored in the properties?
Because right now we are using
allDeclaredProperties
and they include all the instance variable as well.
--
Andre Hora
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Not knowing how to do something is not an argument for how it cannot be done."