Skip to content

Commit ae22d5b

Browse files
committed
cleaning ClassBlueprint
1 parent 6a45c58 commit ae22d5b

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

Moose-Blueprint-Models/FamixJavaMethod.extension.st

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ FamixJavaMethod >> isSubPublic [
125125
^ reimplementations anySatisfy: [ :m | m isPublic ]
126126
]
127127

128+
{ #category : '*Moose-Blueprint-Models' }
129+
FamixJavaMethod >> isTestMethod [
130+
^ self belongsToTestCase and: [ self nameBeginsWithTest or: [ self isJUnit4Test ] ]
131+
]
132+
128133
{ #category : '*Moose-Blueprint-Models' }
129134
FamixJavaMethod >> lazyInitializerRegex [
130135

Moose-Blueprint-Models/FamixStMethod.extension.st

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,8 @@ FamixStMethod >> isSubCalledInternallyOnly [
102102

103103
^ redefinitions allSatisfy: [ :m | m isCalledInHierarchyOnly ]
104104
]
105+
106+
{ #category : '*Moose-Blueprint-Models' }
107+
FamixStMethod >> isTestMethod [
108+
^ self belongsToTestCase and: [ self nameBeginsWithTest ]
109+
]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Extension { #name : 'FamixTClass' }
2+
3+
{ #category : '*Moose-Blueprint-Models' }
4+
FamixTClass >> hierarchyOfClasses [
5+
6+
^ self withSuperclassHierarchy , self subclassHierarchy
7+
]

Moose-Blueprint-Models/FamixTMethod.extension.st

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ FamixTMethod >> belongsToDeadBranch [
88
ofClass: self parentType
99
]
1010

11+
{ #category : '*Moose-Blueprint-Models' }
12+
FamixTMethod >> belongsToTestCase [
13+
14+
^ self parentType isTestCase
15+
]
16+
1117
{ #category : '*Moose-Blueprint-Models' }
1218
FamixTMethod >> calledBy [
1319

@@ -19,8 +25,7 @@ FamixTMethod >> calledBy [
1925
{ #category : '*Moose-Blueprint-Models' }
2026
FamixTMethod >> hierarchyOfClasses [
2127

22-
^ self parentType withSuperclassHierarchy
23-
, self parentType subclassHierarchy
28+
^ self parentType hierarchyOfClasses
2429
]
2530

2631
{ #category : '*Moose-Blueprint-Models' }
@@ -163,15 +168,20 @@ FamixTMethod >> isTestInternalImplementation [
163168
{ #category : '*Moose-Blueprint-Models' }
164169
FamixTMethod >> isTestMethod [
165170

166-
^ self parentType isTestCase and: [
167-
(self name beginsWith: #test) and: [ self name fifth isUppercase ] ]
171+
^ self subclassResponsibility
168172
]
169173

170174
{ #category : '*Moose-Blueprint-Models' }
171175
FamixTMethod >> isTested [
172176

173177
^ (self incomingInvocations collect: #sender) anySatisfy: [ :each |
174-
each parentType isTestCase ]
178+
each isTestCase ]
179+
]
180+
181+
{ #category : '*Moose-Blueprint-Models' }
182+
FamixTMethod >> nameBeginsWithTest [
183+
184+
^ self name beginsWith: 'test'
175185
]
176186

177187
{ #category : '*Moose-Blueprint-Models' }

0 commit comments

Comments
 (0)