Skip to content

Commit ee1ff1e

Browse files
authored
Merge pull request #32 from moosetechnology/31-Remove-isCBTestCase
deprecate isCBTestCase. fix #31
2 parents 2503f30 + b417fda commit ee1ff1e

File tree

7 files changed

+21
-18
lines changed

7 files changed

+21
-18
lines changed

Moose-Blueprint-Models-Tests/CBClassBlueprintForJavaModelTest.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ CBClassBlueprintForJavaModelTest >> testIsCBTestCase [
116116
famixClass2 addMethod: famixMethod.
117117
famixMethod annotationInstances add: testAnnotationInstance.
118118
"JUnit3"
119-
self assert: famixClass isCBTestCase.
119+
self assert: famixClass isTestCase.
120120
"JUnit4 and fllowing"
121-
self assert: famixClass2 isCBTestCase.
121+
self assert: famixClass2 isTestCase
122122
]

Moose-Blueprint-Models/CBMethodModel.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ CBMethodModel >> shape [
345345
" si la méthode est appelée dans une classe de test et que la méthode n'est pas appelée dans sa classe de test => testShape"
346346

347347
shape := (self isTested and: [
348-
self entity parentType isCBTestCase not ])
348+
self entity parentType isTestCase not ])
349349
ifTrue: [ self testedShape ]
350350
ifFalse: [ self defaultShape ].
351351
"shape when: RSMouseClick do: [ self inspect ]."

Moose-Blueprint-Models/FamixJavaAttribute.extension.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Extension { #name : 'FamixJavaAttribute' }
22

33
{ #category : '*Moose-Blueprint-Models' }
44
FamixJavaAttribute >> cbAccessors [
5-
self deprecated: 'please use acessorMethods' transformWith: '`@receiver cbAccessors' -> '`@receiver acessorMethods '.
5+
self deprecated: 'please use acessorMethods' transformWith: '`@receiver cbAccessors' -> '`@receiver accessorMethods '.
66
^ (self incomingAccesses collectAsSet: [ :each | each source ])
77
select: [ :each |
88
each isGetter or: [ each isSetter or: [ each isLazyInitializer ] ] ]

Moose-Blueprint-Models/FamixJavaClass.extension.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Extension { #name : 'FamixJavaClass' }
22

33
{ #category : '*Moose-Blueprint-Models' }
44
FamixJavaClass >> isCBTestCase [
5-
5+
self deprecated: 'please use isTestCase' transformWith: '`@receiver isCBTestCase' -> '`@receiver isTestCase '.
66
^ self isJUnit4TestCase or: [ self inheritsFromTestCase or: [self name = 'TestCase' ] ]
77
]
88

Moose-Blueprint-Models/FamixStAttribute.extension.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Extension { #name : 'FamixStAttribute' }
22

33
{ #category : '*Moose-Blueprint-Models' }
44
FamixStAttribute >> cbAccessors [
5-
self deprecated: 'please use acessorMethods' transformWith: '`@receiver cbAccessors' -> '`@receiver acessorMethods '.
5+
self deprecated: 'please use accessorMethods' transformWith: '`@receiver cbAccessors' -> '`@receiver accessorMethods '.
66
^ (self incomingAccesses collectAsSet: [ :each | each source ])
77
select: [ :each |
88
each isGetter or: [ each isSetter or: [ each isLazyInitializer ] ] ]

Moose-Blueprint-Models/FamixStClass.extension.st

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
Extension { #name : 'FamixStClass' }
22

33
{ #category : '*Moose-Blueprint-Models' }
4-
FamixStClass >> isCBTestCase [
4+
FamixStClass >> inheritsFromTestCase [
5+
6+
self withSuperclassesDo: [ :each |
7+
each name = 'TestCase' ifTrue: [ ^ true ] ].
8+
^ false
9+
]
510

11+
{ #category : '*Moose-Blueprint-Models' }
12+
FamixStClass >> isCBTestCase [
13+
self deprecated: 'please use isTestCase' transformWith: '`@receiver isCBTestCase' -> '`@receiver isTestCase '.
614
self withSuperclassesDo: [ :each |
715
each name = 'TestCase' ifTrue: [ ^ true ] ].
816
^ false

Moose-Blueprint-Models/FamixTMethod.extension.st

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ FamixTMethod >> isCalledInHierarchyOnly [
6262

6363
invokingTypes := (self incomingInvocations collect: [ :each |
6464
each source parentType ]) reject: [ :each |
65-
each isCBTestCase ].
65+
each isTestCase ].
6666

6767
invokingTypes ifEmpty: [ ^ false ].
6868

@@ -73,10 +73,9 @@ FamixTMethod >> isCalledInHierarchyOnly [
7373
FamixTMethod >> isCalledInternallyOnly [
7474

7575
| incoInvocSources |
76-
7776
incoInvocSources := (self incomingInvocations collect: [ :each |
7877
each source ]) reject: [ :each |
79-
each parentType isCBTestCase ].
78+
each parentType isTestCase ].
8079

8180
^ incoInvocSources isNotEmpty and: [
8281
incoInvocSources allSatisfy: [ :i |
@@ -129,12 +128,10 @@ FamixTMethod >> isTestCaseMethod [
129128

130129
{ #category : '*Moose-Blueprint-Models' }
131130
FamixTMethod >> isTestExternalImplementation [
132-
133131
"Here we do not care if it is called by other test methods"
134132

135133
| invocationSources |
136-
137-
self parentType isCBTestCase ifFalse: [ ^ false ].
134+
self parentType isTestCase ifFalse: [ ^ false ].
138135
invocationSources := self incomingInvocations collect: [ :each |
139136
each source ].
140137

@@ -151,12 +148,10 @@ FamixTMethod >> isTestInternal [
151148

152149
{ #category : '*Moose-Blueprint-Models' }
153150
FamixTMethod >> isTestInternalImplementation [
154-
155151
"theinconveince is that it might be called by another internal test implementation of another test class"
156152

157153
| invocationSources |
158-
159-
self parentType isCBTestCase ifFalse: [ ^ false ].
154+
self parentType isTestCase ifFalse: [ ^ false ].
160155
invocationSources := self incomingInvocations collect: [ :each |
161156
each source ].
162157

@@ -168,15 +163,15 @@ FamixTMethod >> isTestInternalImplementation [
168163
{ #category : '*Moose-Blueprint-Models' }
169164
FamixTMethod >> isTestMethod [
170165

171-
^ self parentType isCBTestCase and: [
166+
^ self parentType isTestCase and: [
172167
(self name beginsWith: #test) and: [ self name fifth isUppercase ] ]
173168
]
174169

175170
{ #category : '*Moose-Blueprint-Models' }
176171
FamixTMethod >> isTested [
177172

178173
^ (self incomingInvocations collect: #sender) anySatisfy: [ :each |
179-
each parentType isCBTestCase ]
174+
each parentType isTestCase ]
180175
]
181176

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

0 commit comments

Comments
 (0)