Skip to content

Commit 2c4470f

Browse files
Adapt to changes made to java initializers
1 parent 8a75483 commit 2c4470f

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,6 @@ CBAbstractClassBlueprintTest >> testInitializers [
229229
hasSameElements: self initializerMethodNames
230230
]
231231

232-
{ #category : 'tests' }
233-
CBAbstractClassBlueprintTest >> testIsInitializerMethod [
234-
235-
self assert: (classBlueprint models detect: [ :each |
236-
each name includesSubstring: 'initialize' ]) entity isInitializer
237-
]
238-
239232
{ #category : 'tests' }
240233
CBAbstractClassBlueprintTest >> testModels [
241234

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,15 @@ CBClassBlueprintForJavaModelTest >> createExternalMethod [
4646
{ #category : 'entities' }
4747
CBClassBlueprintForJavaModelTest >> createInitializers [
4848

49-
(model newMethodNamed: 'initializer1()')
50-
isConstructor: true;
51-
parentType: mainClass.
49+
(model newInitializerNamed: mainClass name) parentType: mainClass.
5250

53-
(model newMethodNamed: 'initializer2()')
54-
isConstructor: true;
55-
parentType: mainClass
51+
(model newInitializerNamed: mainClass name) parentType: mainClass
5652
]
5753

5854
{ #category : 'accessing' }
5955
CBClassBlueprintForJavaModelTest >> initializerMethodNames [
6056

61-
^ { 'initializer1()'. 'initializer2()' }
57+
^ { mainClass name }
6258
]
6359

6460
{ #category : 'entities' }

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ CBJavaClassPojoTest >> initializePojoClass [
101101
{ #category : 'initialization' }
102102
CBJavaClassPojoTest >> newConstructorMethodFor: aFamixjavaClass [
103103

104-
^ (model newMethodNamed: ('{1}()' format: aFamixjavaClass name))
105-
isConstructor: true;
106-
yourself
104+
^ model newInitializerNamed: aFamixjavaClass name
107105
]
108106

109107
{ #category : 'initialization' }

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,12 @@ CBPojoTest >> setNotDeadAttributeAndDeadAccessors [
8888
{ #category : 'running' }
8989
CBPojoTest >> setUp [
9090

91-
| constructor |
9291
super setUp.
9392
model := FamixJavaModel new.
9493
class := model newClassNamed: 'Pojo'.
9594

9695
attribute := model newAttributeNamed: 'attribute'.
9796

98-
constructor := (model newMethodNamed: 'constructor()')
99-
isConstructor: true;
100-
yourself.
10197
getter := (model newMethodNamed: 'getAttribute()')
10298
typing: (model newEntityTyping
10399
declaredType:
@@ -116,7 +112,7 @@ CBPojoTest >> setUp [
116112
class
117113
addMethod: getter;
118114
addMethod: setter;
119-
addMethod: constructor;
115+
addMethod: (model newInitializerNamed: 'Pojo');
120116
addAttribute: attribute
121117
]
122118

0 commit comments

Comments
 (0)