Hi,
In Moose 4.6 I load a simple MSE for my tests in the following way:
loadIntoMoose: methodName
| model |
model := (MooseModel root entityNamed: methodName).
(model) notNil ifTrue: [^ model].
model := MooseModel new.
model name: methodName.
model importFromMSEStream: (ReadStream on: (self perform: methodName)).
model install.
^ model
Where self perfom: methodName returns the MSE as String.
This fails in Moose 4.7 in cacheMooseGroups here:
allPrimitiveTypes
<navigation: 'All primitive types'>
^(self allWithType: FAMIXPrimitiveType) sorted: [:a :b | a name < b name]; yourself
There are three primitive types, but their names are nil.
The peculiar thing is, if I load the MSE file in the Moose Panel manually it works (same content in the file and in the string!) and I can explore the three primitive types. They are (in the MSE):
(FAMIX.PrimitiveType (id: 38)
(name "_unknown_file.void")
)
(FAMIX.PrimitiveType (id: 101)
(name "_unknown_file.int")
)
(FAMIX.PrimitiveType (id: 121)
(name "_unknown_file.boolean")
)
The only difference between the MSE file and the String I return is that in the File ' are used and in the String " are used.
So in the MSE file:
(FAMIX.PrimitiveType (id: 38)
(name '_unknown_file.void')
)
The String that I return in the method:
^
'
...
(FAMIX.PrimitiveType (id: 38)
(name "_unknown_file.void")
)
...
'
Is this a problem? Does anyone have an explanation for this behavior? Is there maybe a better way to load moose models for tests?
If anyone wants to look at the code, it is available here:
Cheers,
Dennis