[Moose-dev] Re: Unitary Test with Moose don't work

Menanteau Jannick jannick.menanteau at free.fr
Fri Jul 25 09:32:58 MEST 2008


Hi,

I've not published my code for the moment.

My code is : (for testing)
---
	| model l importer i r d |
	model := MooseModel new name: 'model'.
	importer := NameSpaceImporter new importingContext:  
(NameSpaceImporter new importingContext mergeClassAndMetaclass).
	importer model: model; add: Smalltalk.Pack1; run.
	i := (model entityNamed:#'ModelForQualixoTest') definedClasses .
	l :=  (model entityNamed:#'Root::Smalltalk::Pack1::Class1Pack1')  
invokedClasses.
	d :=  (model entityNamed:#'Root::Smalltalk::Pack1::Class2Pack1')  
invokingClasses.
	r :=  (model entityNamed:#'Root::Smalltalk::Pack1::Class3Pack1')  
invokingClasses.
---
Results are :

i = Set (a SCG.Moose.FAMIXClass #'Root::Smalltalk::Pack1::Class1Pack1'  
a SCG.Moose.FAMIXClass #'Root::Smalltalk::Pack1::Class4Pack1' a  
SCG.Moose.FAMIXClass #'Root::Smalltalk::Pack1::Class3Pack1' a  
SCG.Moose.FAMIXClass #'Root::Smalltalk::Pack1::Class2Pack1')

l = OrderedCollection (a SCG.Moose.FAMIXClass  
#'Root::Smalltalk::Pack1::Class4Pack1')
d = OrderedCollection (a SCG.Moose.FAMIXClass  
#'Root::Smalltalk::Pack1::Class1Pack1')
r = OrderedCollection (a SCG.Moose.FAMIXClass  
#'Root::Smalltalk::Pack1::Class1Pack1')

---

It's not logical : Class2Pack1 and Class3Pack1 are invoked by  
Class1Pack1 (variable d and r) whereas L show that Class1Pack1 invokes  
Class4Pack1.

For information, in Class1Pack1, there is just a "new" on the three  
others classes.
I also point out that the result is good in Moose.

Have I do an error in declaration of "importer" ?

Thanks for your help



Le 24 juil. 08 à 22:51, Tudor Girba a écrit :

> Hi,
>
> It is easier to answer if we can take a look at the actual code. Where
> can I load it from?
>
> Cheers,
> Doru
>
>
> On Jul 24, 2008, at 5:54 PM, Menanteau Jannick wrote:
>
>> Hi all,
>>
>> I would like to make unitary test for several Moose methods.
>> In this context, I don't use the Moose interface.
>>
>> I've done this in a method :
>> 	model := MooseModel new name: 'model'.
>> 	importer := NameSpaceImporter new importingContext:
>> (NameSpaceImporter new importingContext mergeClassAndMetaclass).
>> 	importer model: model; add: Pack1; run.
>> 	i := (model entityNamed:#'ModelForQualixoTest') definedClasses .
>> 	l :=  (model entityNamed:#'Root::Smalltalk::Pack1::Class1Pack1')
>> fanOut.
>> 	k :=  (model entityNamed:#'Root::Smalltalk::Pack1::Class2Pack1')
>> fanOut.
>>
>> Class1Pack1 create new object from Class2Pack1.
>> fanOut for Class1Pack1 must be 1.
>>
>> The result waited is :
>> 	i = OrderedCollection  --> ok
>> 	l = 1 --> it returns 0
>> 	k = 0 --> ok
>>
>> In Moose interface, the result is good.
>> I don't know what is the problem :(
>>
>> Thanks for helping
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev at iam.unibe.ch
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
> www.tudorgirba.com/blog
>
> "Beauty is where we see it."
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev at iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iam.unibe.ch/pipermail/moose-dev/attachments/20080725/76ae8677/attachment.html


More information about the Moose-dev mailing list