Issue 6016 in pharo: privateAnnouncer is not used and this is not good

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo
Status: Accepted
Owner: [hidden email]
Labels: Type-Bug

New issue 6016 by [hidden email]: privateAnnouncer is not used and  
this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

PackageOrganizer should register to the private Announcer of  
SystemAnnoucement.
Now we recently changed it to register to the public one

See

announcer
        "PRIVATE - Do not use this announcer to register to receive events. Use  
SystemAnnouncer instead"
        ^ SystemAnnouncer announcer

Now it should be

announcer
        "PRIVATE - Do not use this announcer to register to receive events. Use  
SystemAnnouncer instead"
        ^ SystemAnnouncer privateAnnouncer

It measn that some tests should adapt their setup and teardown


RPackageTestCase>>initializeAnnouncers
        oldMCAnnouncer := SystemAnnouncer announcer.
        SystemAnnouncer announcer: SystemAnnouncer new.
        oldPrivateAnnouncer := SystemAnnouncer privateAnnouncer.
        SystemAnnouncer privateAnnouncer: SystemAnnouncer new.


RPackageTestCase>>restoreAnnouncers
        SystemAnnouncer announcer: oldMCAnnouncer.
        SystemAnnouncer privateAnnouncer: oldPrivateAnnouncer.


SystemNavigationTestsetUp>>
        super setUp.
       
        oldMonticelloAnnouncer := SystemAnnouncer announcer.
        SystemAnnouncer announcer: nil.
        oldPrivateAnnouncer := SystemAnnouncer announcer.
        SystemAnnouncer privateAnnouncer: nil.
       
        navigator := self createSystemNavigationToTest.
        classFactory := self createClassFactory.


RPackageTestCase>>tearDown
        super tearDown.
        self classFactory cleanUp.
        SystemAnnouncer announcer: oldMonticelloAnnouncer.
        SystemAnnouncer privateAnnouncer: oldPrivateAnnouncer
       

TraitsResource>>setUp
        "Please note, that most tests rely on this setup of traits and
        classes - and that especially the order of the definitions matters."
        "SetUpCount := SetUpCount + 1."

        dirty := false.
        oldAnnouncer := SystemAnnouncer announcer.
        oldPrivateAnnouncer := SystemAnnouncer privateAnnouncer.
        SystemAnnouncer announcer: nil.
        SystemAnnouncer privateAnnouncer: nil.
        SystemChangeNotifier uniqueInstance doSilently:
                        [self t1: (self createTraitNamed: #T1
                                                uses: { }).
                        self t1 comment: 'I am the trait T1'.
                       
                        self t2: (self createTraitNamed: #T2
                                                uses: { }).
                        self t2 compile: 'm21 ^21' classified: #cat1.
                        self t2 compile: 'm22 ^22' classified: #cat2.
                        self t2 classSide compile: 'm2ClassSide: a ^a'.
                       
                        self t3: (self createTraitNamed: #T3
                                                uses: { }).
                        self t3 compile: 'm31 ^31' classified: #cat1.
                        self t3 compile: 'm32 ^32' classified: #cat2.
                        self t3 compile: 'm33 ^33' classified: #cat3.
                       
                        self t4: (self createTraitNamed: #T4
                                                uses: { (self t1). (self t2) }).
                        self t4 compile: 'm11 ^41' classified: #catX. "overrides T1>>m11"
                        self t4 compile: 'm42 ^42' classified: #cat2.
                       
                        self t5: (self createTraitNamed: #T5 uses: self t1 + self t2).
                        self t5 compile: 'm51 ^super foo' classified: #cat1.
                        self t5 compile: 'm52 ^ self class bar' classified: #cat1.
                        self t5 compile: 'm53 ^ self class bar' classified: #cat1.
                       
                        self t6: (self createTraitNamed: #T6
                                                uses: (self t1 + self t2) @ { (#m22Alias -> #m22) }).
                        self c1: (self
                                                createClassNamed: #C1
                                                superclass: Object
                                                uses: { }).
                        self c1 compile: 'foo ^true' classified: #accessing.
                        self t1 compile: 'm11 ^11' classified: #cat1.
                        self t1 compile: 'm12 ^12' classified: #cat2.
                        self t1 compile: 'm13 ^self m12' classified: #cat3.
                        self c2: (self
                                                createClassNamed: #C2
                                                superclass: self c1
                                                uses: self t5 - { #m11 }).
                        self c2 compile: 'foo ^false' classified: #private.
                        self c2 compile: 'bar ^self foo' classified: #private.
                        self setUpTrivialRequiresFixture.
                        self setUpTwoLevelRequiresFixture.
                        self setUpTranslatingRequiresFixture].
        SystemChangeNotifier uniqueInstance notify: self ofAllSystemChangesUsing:  
#codeChangedEvent:






_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo
Updates:
        Labels: Milestone-2.0

Comment #1 on issue 6016 by [hidden email]: privateAnnouncer is not  
used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

tearDown
        SystemChangeNotifier uniqueInstance noMoreNotificationsFor: self.
        self createdClassesAndTraits
                do: [ :aClassOrTrait |
                        | behaviorName |
                        behaviorName := aClassOrTrait name.
                        Smalltalk globals at: behaviorName ifPresent: [ :classOrTrait |  
classOrTrait removeFromSystem ].
                        ChangeSet current removeClassChanges: behaviorName ].
        createdClassesAndTraits := self
                t1:
                        (self
                                t2:
                                        (self
                                                t3:
                                                        (self
                                                                t4:
                                                                        (self t5: (self t6: (self c1: (self c2: (self c3: (self c4: (self  
c5: (self c6: (self c7: (self c8: nil))))))))))))).
        SystemAnnouncer announcer: oldAnnouncer.
        SystemAnnouncer privateAnnouncer: oldPrivateAnnouncer.


and

TraitsTestCase>>setUp

      super setUp.
     oldAnnouncer := SystemAnnouncer announcer.
        oldPrivateAnnouncer := SystemAnnouncer privateAnnouncer.
        SystemAnnouncer announcer: nil.
        SystemAnnouncer privateAnnouncer: nil.


TraisTestCase>>tearDown
      TraitsResource resetIfDirty.
      self createdClassesAndTraits
           do: [ :aClassOrTrait |
                | behaviorName |
                behaviorName := aClassOrTrait name.
                Smalltalk globals at: behaviorName ifPresent:  
[ :classOrTrait | classOrTrait removeFromSystem ].
                ChangeSet current removeClassChanges: behaviorName ].
      createdClassesAndTraits := nil.
      SystemAnnouncer announcer: oldAnnouncer.
         SystemAnnouncer privateAnnouncer: oldPrivateAnnouncer.


Now I do not understand but when I do that I get a lot of error in the  
teardown of MCSynchronisationTest
because the category is already removed. and I do not understand why....


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo

Comment #2 on issue 6016 by [hidden email]: privateAnnouncer is  
not used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

I'll have a look.  Now, I think we should find a real solution for Silent  
Tests.  Because we will have to add those 10 lines of code to the tearDown  
and setUp of every test creating a class.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo

Comment #3 on issue 6016 by [hidden email]: privateAnnouncer is not  
used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

I found the problem this was another mistake.
So I will integrate these changes



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo

Comment #4 on issue 6016 by [hidden email]: privateAnnouncer is  
not used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

Steph, restoring the privateAnnouncer thingy + modifying this method (prior  
downloading slice for issue 5977 for traits ;)).

RpackageMCSynchronizationTests>>restoreAnnouncers
        super restoreAnnouncers.
        MCWorkingCopy announcer: oldAnnouncer.

gives me no errors, just one failure on testInvariant

Now I'm running the whole tests of the image to look for any other side  
effects


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo

Comment #5 on issue 6016 by [hidden email]: privateAnnouncer is not  
used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

in 20107

Attachments:
        FixingPrivateAnnouncer.2.cs  2.4 KB


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo

Comment #6 on issue 6016 by [hidden email]: privateAnnouncer is  
not used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

Look there is a bug in SystemNavigationTest>>setUp

        oldPrivateAnnouncer := SystemAnnouncer announcer.

should be

        oldPrivateAnnouncer := SystemAnnouncer privateAnnouncer.




_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo

Comment #7 on issue 6016 by [hidden email]: privateAnnouncer is not  
used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

Yes I fixed now in 20103


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo

Comment #8 on issue 6016 by [hidden email]: privateAnnouncer is not  
used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

Guille I also added

RPackageTestCase>>initializeAnnouncers
        oldMCAnnouncer := SystemAnnouncer announcer.
        SystemAnnouncer announcer: SystemAnnouncer new.
       
        oldPrivateAnnouncer := SystemAnnouncer privateAnnouncer.
        SystemAnnouncer privateAnnouncer: SystemAnnouncer new.

and

RPackageTestCase>>restoreAnnouncers
        SystemAnnouncer announcer: oldMCAnnouncer.
        SystemAnnouncer privateAnnouncer: oldPrivateAnnouncer.



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6016 in pharo: privateAnnouncer is not used and this is not good

pharo
Updates:
        Status: Integrated

Comment #9 on issue 6016 by [hidden email]: privateAnnouncer is not  
used and this is not good
http://code.google.com/p/pharo/issues/detail?id=6016

In 20123


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker