Re: [Pharo-project] Problem with Traits, Ring, RPcakage and Obsoletes
Hi Mariano, we should be able to "silently" create temporal classes, without notifying the system. Have you tried something like this: default := RPackage organizer. [ default unregister. SystemChangeNotifier uniqueInstance doSilently: [ Object subclass: #TemporalClassForFuel instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'FuelTests']. ] ensure:[ (Smalltalk globals classNamed: 'TemporalClassForFuel' ) removeFromSystem:false. default register]. Saludos, Fernando On Wed, Apr 18, 2012 at 11:49 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi guys. I am running some tests with Fuel. In such test I create classes and traits. The problem is that I get a: "MessageNotUnderstood: receiver of "isProvided" is nil" Everything starts (it seems) when I do #addToComposition:  and I receive a MethodRecategorized event and RPackage calls #systemMethodRecategorizedActionFrom: There, the problem is with  ->  method isProvidedByATrait the class of the method is 'AnObsoleteClassForTestToBeDeleted1' And the error finally arrives to #providedLocatedMethod where it does "each method isProvided"  the problem is that "each" is a RGMethodDefinition with everything in nil except 'name'  and 'annotations'. I attach PharoDebug.log. Any help is really appreaciated.
Thanks,
-- Mariano http://marianopeck.wordpress.com
On Thu, Apr 19, 2012 at 12:21 AM, Fernando Olivero <fernando.olivero@usi.ch>wrote:
Hi Mariano, we should be able to "silently" create temporal classes, without notifying the system.
Have you tried something like this:
default := RPackage organizer. [ default unregister. SystemChangeNotifier uniqueInstance doSilently: [ Object subclass: #TemporalClassForFuel instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'FuelTests'].
] ensure:[ (Smalltalk globals classNamed: 'TemporalClassForFuel' ) removeFromSystem:false. default register].
Hi Fernando. Thanks, but it doesn't seem to work. I put a halt in SystemChangeNotifier >> classAdded: aClass inCategory: aCategoryName Then I modfified ClassFactoryForTestCase: newSubclassOf: aClass instanceVariableNames: ivNamesString classVariableNames: classVarsString category: category | newClass default | default := RPackage organizer. [ default unregister. SystemChangeNotifier uniqueInstance doSilently: [ newClass := aClass subclass: self newName instanceVariableNames: ivNamesString classVariableNames: classVarsString poolDictionaries: '' category: (self packageName, '-', category) asSymbol. ]. ] ensure:[ default register]. self createdClasses add: newClass. ^newClass And when creating a class, it still halts on #classAdded: aClass inCategory: aCategoryName Look attached screenshot. Thanks
Saludos, Fernando
On Wed, Apr 18, 2012 at 11:49 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi guys. I am running some tests with Fuel. In such test I create classes and traits. The problem is that I get a: "MessageNotUnderstood: receiver of "isProvided" is nil" Everything starts (it seems) when I do #addToComposition: and I receive a MethodRecategorized event and RPackage calls #systemMethodRecategorizedActionFrom: There, the problem is with -> method isProvidedByATrait the class of the method is 'AnObsoleteClassForTestToBeDeleted1' And the error finally arrives to #providedLocatedMethod where it does "each method isProvided" the problem is that "each" is a RGMethodDefinition with everything in nil except 'name' and 'annotations'. I attach PharoDebug.log. Any help is really appreaciated.
Thanks,
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
On Thu, Apr 19, 2012 at 3:07 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Thu, Apr 19, 2012 at 12:21 AM, Fernando Olivero < fernando.olivero@usi.ch> wrote:
Hi Mariano, we should be able to "silently" create temporal classes, without notifying the system.
Have you tried something like this:
default := RPackage organizer. [ default unregister. SystemChangeNotifier uniqueInstance doSilently: [ Object subclass: #TemporalClassForFuel instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'FuelTests'].
] ensure:[ (Smalltalk globals classNamed: 'TemporalClassForFuel' ) removeFromSystem:false. default register].
Hi Fernando. Thanks, but it doesn't seem to work. I put a halt in SystemChangeNotifier >> classAdded: aClass inCategory: aCategoryName Then I modfified ClassFactoryForTestCase:
newSubclassOf: aClass instanceVariableNames: ivNamesString classVariableNames: classVarsString category: category | newClass default |
default := RPackage organizer. [ default unregister. SystemChangeNotifier uniqueInstance doSilently: [ newClass := aClass subclass: self newName instanceVariableNames: ivNamesString classVariableNames: classVarsString poolDictionaries: '' category: (self packageName, '-', category) asSymbol. ]. ] ensure:[ default register].
self createdClasses add: newClass. ^newClass
And when creating a class, it still halts on #classAdded: aClass inCategory: aCategoryName
If I proceed the halt it continues up to RPackage >> systemClassAddedActionFrom: and it fails trying to import an OBSOLETE class.
Look attached screenshot.
Thanks
Saludos, Fernando
On Wed, Apr 18, 2012 at 11:49 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi guys. I am running some tests with Fuel. In such test I create classes and traits. The problem is that I get a: "MessageNotUnderstood: receiver of "isProvided" is nil" Everything starts (it seems) when I do #addToComposition: and I receive a MethodRecategorized event and RPackage calls #systemMethodRecategorizedActionFrom: There, the problem is with -> method isProvidedByATrait the class of the method is 'AnObsoleteClassForTestToBeDeleted1' And the error finally arrives to #providedLocatedMethod where it does "each method isProvided" the problem is that "each" is a RGMethodDefinition with everything in nil except 'name' and 'annotations'. I attach PharoDebug.log. Any help is really appreaciated.
Thanks,
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
Incredible.....if I run this from a workspace: | default newClass | SystemChangeNotifier uniqueInstance doSilently: [ newClass := Object subclass: #TemporalClassForFuel instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: #FOO]. It does not halt in SystemChangeNotifier. But if I do EXACTLY the same but from ClassFactoryForTestCase: newSubclassOf: aClass instanceVariableNames: ivNamesString classVariableNames: classVarsString category: category | default newClass | SystemChangeNotifier uniqueInstance doSilently: [ newClass := Object subclass: #TemporalClassForFuel instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: #FOO]. It DOES HALT. :( any idea what can be happening ? thanks On Thu, Apr 19, 2012 at 3:09 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Thu, Apr 19, 2012 at 3:07 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Thu, Apr 19, 2012 at 12:21 AM, Fernando Olivero < fernando.olivero@usi.ch> wrote:
Hi Mariano, we should be able to "silently" create temporal classes, without notifying the system.
Have you tried something like this:
default := RPackage organizer. [ default unregister. SystemChangeNotifier uniqueInstance doSilently: [ Object subclass: #TemporalClassForFuel instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'FuelTests'].
] ensure:[ (Smalltalk globals classNamed: 'TemporalClassForFuel' ) removeFromSystem:false. default register].
Hi Fernando. Thanks, but it doesn't seem to work. I put a halt in SystemChangeNotifier >> classAdded: aClass inCategory: aCategoryName Then I modfified ClassFactoryForTestCase:
newSubclassOf: aClass instanceVariableNames: ivNamesString classVariableNames: classVarsString category: category | newClass default |
default := RPackage organizer. [ default unregister. SystemChangeNotifier uniqueInstance doSilently: [ newClass := aClass subclass: self newName instanceVariableNames: ivNamesString classVariableNames: classVarsString poolDictionaries: '' category: (self packageName, '-', category) asSymbol. ]. ] ensure:[ default register].
self createdClasses add: newClass. ^newClass
And when creating a class, it still halts on #classAdded: aClass inCategory: aCategoryName
If I proceed the halt it continues up to RPackage >> systemClassAddedActionFrom: and it fails trying to import an OBSOLETE class.
Look attached screenshot.
Thanks
Saludos, Fernando
On Wed, Apr 18, 2012 at 11:49 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi guys. I am running some tests with Fuel. In such test I create classes and traits. The problem is that I get a: "MessageNotUnderstood: receiver of "isProvided" is nil" Everything starts (it seems) when I do #addToComposition: and I receive a MethodRecategorized event and RPackage calls #systemMethodRecategorizedActionFrom: There, the problem is with -> method isProvidedByATrait the class of the method is 'AnObsoleteClassForTestToBeDeleted1' And the error finally arrives to #providedLocatedMethod where it does "each method isProvided" the problem is that "each" is a RGMethodDefinition with everything in nil except 'name' and 'annotations'. I attach PharoDebug.log. Any help is really appreaciated.
Thanks,
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
Please please please pay attention! RPackageOrganizer needs another pass because - not because of RPackageOrganizer but because of the state of the system Then notice that RPackageOrganizer has been designed in a way that the tests are ***NOT*** run against the default RPackageOrganizer to make sure that if you write a bad tests you do not break the system. Have a look at RPackageOrganize API and how we use it in RPackageOrganizer tests Now if may happen that you keep a debugger open when you debug a test of RPackageOrganizer and it may confuse you because you will see propagation of events handled in the RPackageOrganizer instance and not the default one. So pay attention to close the debugger so that notification are passed to the default organizer. Now I need somebody good and with time to have a look at the integration of RPackage into the system. But right now I do not have 3 hours to me to get concentrated. Stef
participants (3)
-
Fernando Olivero -
Mariano Martinez Peck -
Stéphane Ducasse