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:
MCHttpRepository
location: 'http://www.squeaksource.com/Softwarenaut' user: '' password: ''
Cheers, Dennis
Found the answer: The double quotes were actually the problem, I just forgot how to escape the single quotes (with additional single quotes):
(FAMIX.PrimitiveType (id: 101)
(name ''_unknown_file.int'') )
Now it works.
On Tue, Feb 28, 2012 at 10:23, Dennis Schenk d.schenk@students.unibe.chwrote:
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:
MCHttpRepository
location: 'http://www.squeaksource.com/Softwarenaut' user: '' password: ''
Cheers, Dennis
Thanks for letting us know. I was just about to look into it.
But, please keep the questions rolling :)
Cheers, Doru
On Tue, Feb 28, 2012 at 2:36 PM, Dennis Schenk d.schenk@students.unibe.ch wrote:
Found the answer: The double quotes were actually the problem, I just forgot how to escape the single quotes (with additional single quotes):
(FAMIX.PrimitiveType (id: 101) (name ''_unknown_file.int'') )
Now it works.
On Tue, Feb 28, 2012 at 10:23, Dennis Schenk d.schenk@students.unibe.ch wrote:
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:
MCHttpRepository location: 'http://www.squeaksource.com/Softwarenaut' user: '' password: ''
Cheers, Dennis
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev