Skip to content

Commit

Permalink
Merge pull request #3709 from MarcusDenker/3708-cleanup-SystemNavigat…
Browse files Browse the repository at this point in the history
…ionTest

3708-cleanup-SystemNavigationTest
  • Loading branch information
Ducasse committed Jul 1, 2019
2 parents 53cf143 + 9fbd3b4 commit 2201dd1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 100 deletions.

This file was deleted.

52 changes: 13 additions & 39 deletions src/System-Support-Tests/SystemNavigationTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Class {
#superclass : #TestCase,
#instVars : [
'classFactory',
'navigator',
'oldSystemAnnouncer'
],
#category : #'System-Support-Tests'
Expand All @@ -26,24 +25,7 @@ SystemNavigationTest >> classFactory [

{ #category : #'setUp-tearDown' }
SystemNavigationTest >> createClassFactory [
^ ClassFactoryWithOrganization newWithOrganization: self organizationToTest
]

{ #category : #'setUp-tearDown' }
SystemNavigationTest >> createSystemNavigationToTest [
^SystemNavigation new
]

{ #category : #accessing }
SystemNavigationTest >> environmentToTest [
^self systemNavigationToTest environment

]

{ #category : #accessing }
SystemNavigationTest >> organizationToTest [
^self environmentToTest organization

^ ClassFactoryWithOrganization newWithOrganization: self systemNavigationToTest environment organization
]

{ #category : #running }
Expand All @@ -53,13 +35,12 @@ SystemNavigationTest >> setUp [
oldSystemAnnouncer := SystemAnnouncer uniqueInstance.
SystemAnnouncer announcer: nil.

navigator := self createSystemNavigationToTest.
classFactory := self createClassFactory.
]

{ #category : #accessing }
SystemNavigationTest >> systemNavigationToTest [
^navigator
^SystemNavigation new

]

Expand Down Expand Up @@ -89,34 +70,27 @@ SystemNavigationTest >> testAllExistingProtocolsFor [
{ #category : #testing }
SystemNavigationTest >> testAllReferencesToPool [
| result |

result := self systemNavigationToTest allReferencesToPool: FooSharedPool.
self assert: result size = 1.
]

{ #category : #testing }
SystemNavigationTest >> testAllReferencesToPoolWhenNoRefences [
| result |

self assert: result size equals: 1.
result := self systemNavigationToTest allReferencesToPool: UnreferencedSharedPool.
self assert: result size = 0.
self assert: result size equals: 0
]

{ #category : #testing }
SystemNavigationTest >> testAllSendersOfASelector [
| senders selector class otherClass callers |
selector := ('aMethod', 'WithSenders') asSymbol.

selector := ('aMethod' , 'WithSenders') asSymbol.
class := self classFactory newClass.
class compileSilently: selector asString, ' ^ self'.
class compileSilently: 'anotherMethod ^self ', selector asString.
class compileSilently: selector asString , ' ^ self'.
class compileSilently: 'anotherMethod ^self ' , selector asString.
otherClass := self classFactory newClass.
otherClass compileSilently: 'yetAnotherMethod ^self ', selector asString.
otherClass
compileSilently: 'yetAnotherMethod ^self ' , selector asString.
senders := self systemNavigationToTest allSendersOf: selector.
self assert: senders size = 2.
callers := senders collect: [ :methodRef | methodRef selector].
self assert: (callers includesAll: #(#anotherMethod #yetAnotherMethod))

self assert: senders size equals: 2.
callers := senders collect: [ :methodRef | methodRef selector ].
self
assert: (callers includesAll: #(#anotherMethod #yetAnotherMethod))
]

{ #category : #testing }
Expand Down

0 comments on commit 2201dd1

Please sign in to comment.