Skip to content

Commit 43ec039

Browse files
authored
Merge pull request #759 from moosetechnology/rename-importing-context
Rename importing context
2 parents ec29054 + 3867efb commit 43ec039

9 files changed

+120
-109
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Class {
2+
#name : #MooseImportingContext,
3+
#superclass : #FamixStImporterContext,
4+
#category : #'Famix-Deprecated'
5+
}
6+
7+
{ #category : #testing }
8+
MooseImportingContext class >> isDeprecated [
9+
10+
^ true
11+
]

src/Moose-SmalltalkImporter-Core-Tests/ImportingContextTest.class.st

+15-15
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ Class {
88
ImportingContextTest >> testAllDependentsOf [
99

1010
| res1 res2 |
11-
MooseImportingContext initialize.
12-
res1 := MooseImportingContext new allDependentsOf: MooseImportingContext importingClass.
11+
FamixStImporterContext initialize.
12+
res1 := FamixStImporterContext new allDependentsOf: FamixStImporterContext importingClass.
1313
self assert: res1 size equals: 2.
14-
self assert: (res1 includes: MooseImportingContext importingClass).
15-
res2 := MooseImportingContext new allDependentsOf: MooseImportingContext importingImplicitVariable.
14+
self assert: (res1 includes: FamixStImporterContext importingClass).
15+
res2 := FamixStImporterContext new allDependentsOf: FamixStImporterContext importingImplicitVariable.
1616
self assert: res2 size equals: 4.
17-
self assert: (res2 includes: MooseImportingContext importingClass).
18-
self assert: (res2 includes: MooseImportingContext importingMethod).
19-
self assert: (res2 includes: MooseImportingContext importingImplicitVariable)
17+
self assert: (res2 includes: FamixStImporterContext importingClass).
18+
self assert: (res2 includes: FamixStImporterContext importingMethod).
19+
self assert: (res2 includes: FamixStImporterContext importingImplicitVariable)
2020
]
2121

2222
{ #category : #tests }
2323
ImportingContextTest >> testShouldComputeTypeOfAttributes [
2424
| context |
2525

26-
context :=MooseImportingContext new.
26+
context :=FamixStImporterContext new.
2727
self deny: (context shouldComputeTypeOfAttributes).
2828
context computeTypeOfAttributes.
2929
self assert: (context shouldComputeTypeOfAttributes).
@@ -33,7 +33,7 @@ ImportingContextTest >> testShouldComputeTypeOfAttributes [
3333
ImportingContextTest >> testShouldImportAllTheRest [
3434

3535
| context |
36-
context := MooseImportingContext new.
36+
context := FamixStImporterContext new.
3737
context
3838
importClass;
3939
importMethod;
@@ -46,7 +46,7 @@ ImportingContextTest >> testShouldImportAllTheRest [
4646
ImportingContextTest >> testShouldImportClasses [
4747

4848
| context |
49-
context := MooseImportingContext new.
49+
context := FamixStImporterContext new.
5050
context importClass.
5151
self assert: context shouldImportClass
5252
]
@@ -58,7 +58,7 @@ ImportingContextTest >> testShouldImportClassesForInheritance [
5858
entities without breaking it"
5959

6060
| context |
61-
context :=MooseImportingContext new.
61+
context :=FamixStImporterContext new.
6262
context importInheritance.
6363
(context class entityDependencies at: context class importingInheritance)
6464
do: [:each | self assert: (context shouldImport: each)]
@@ -68,7 +68,7 @@ ImportingContextTest >> testShouldImportClassesForInheritance [
6868
ImportingContextTest >> testShouldImportClassesForMethod [
6969

7070
| context |
71-
context := MooseImportingContext new.
71+
context := FamixStImporterContext new.
7272
context importMethod.
7373
self assert: context shouldImportClass
7474
]
@@ -77,7 +77,7 @@ ImportingContextTest >> testShouldImportClassesForMethod [
7777
ImportingContextTest >> testShouldImportMethodBody [
7878

7979
| context |
80-
context :=MooseImportingContext new.
80+
context :=FamixStImporterContext new.
8181
context importArgument.
8282
self assert: (context shouldImportMethodBody).
8383
]
@@ -86,7 +86,7 @@ ImportingContextTest >> testShouldImportMethodBody [
8686
ImportingContextTest >> testShouldImportMethodBody2 [
8787

8888
| context |
89-
context :=MooseImportingContext new.
89+
context :=FamixStImporterContext new.
9090
context importImplicitVariable.
9191

9292
self assert: (context shouldImportMethodBody).
@@ -96,7 +96,7 @@ ImportingContextTest >> testShouldImportMethodBody2 [
9696
ImportingContextTest >> testShouldImportMethodBodyBasedOnMaximum [
9797

9898
| context |
99-
context :=MooseImportingContext new.
99+
context :=FamixStImporterContext new.
100100
context importMaximum.
101101

102102
self assert: (context shouldImportMethodBody).

src/Moose-SmalltalkImporter-Core-Tests/MooseScripts.class.st

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ MooseScripts class >> createLightModelForLAN [
1616
model := FamixStModel new.
1717
model name: 'lightLAN'.
1818
FamixStPharoImporterTask new
19-
importingContext: (MooseImportingContext new
19+
importingContext: (FamixStImporterContext new
2020
importClass;
2121
importMethod;
2222
importInheritance;
@@ -44,7 +44,7 @@ MooseScripts class >> createLightModelForMorphic [
4444
model := FamixStModel new.
4545
model name: 'lightMorphic'.
4646
FamixStPharoImporterTask new
47-
importingContext: (MooseImportingContext new
47+
importingContext: (FamixStImporterContext new
4848
importClass;
4949
importMethod;
5050
importInheritance;
@@ -74,7 +74,7 @@ MooseScripts class >> createLightModelForNetwork [
7474
model := FamixStModel new.
7575
model name: 'lightNetwork'.
7676
FamixStPharoImporterTask new
77-
importingContext: (MooseImportingContext new
77+
importingContext: (FamixStImporterContext new
7878
importClass;
7979
importMethod;
8080
importInheritance;
@@ -103,7 +103,7 @@ MooseScripts class >> createLightModelForPharo [
103103
model := FamixStModel new.
104104
model name: 'lightPharo'.
105105
FamixStPharoImporterTask new
106-
importingContext: (MooseImportingContext new
106+
importingContext: (FamixStImporterContext new
107107
importClass;
108108
importMethod;
109109
importInheritance;
@@ -213,7 +213,7 @@ MooseScripts class >> createModelNamed: modelName withPackages: packages importe
213213
mooseModel := FamixStModel new.
214214
mooseModel name: modelName.
215215

216-
importingContext := MooseImportingContext new.
216+
importingContext := FamixStImporterContext new.
217217
(context select: [:anAssoc | anAssoc value = true] thenCollect: [:each | each key]) do: [ :each | importingContext perform: (#import , each) asSymbol ].
218218
merge ifTrue: [ importingContext mergeClassAndMetaclass ].
219219

src/Moose-SmalltalkImporter-Core-Tests/MooseSmalltalkImporterSubclassesTest.class.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ MooseSmalltalkImporterSubclassesTest >> setUp [
3636
model name: 'Test'.
3737
pharoImporterTask := FamixStPharoImporterTask new
3838
doNotRunCandidateOperator;
39-
importingContext: (MooseImportingContext new
39+
importingContext: (FamixStImporterContext new
4040
importPackage;
4141
importInheritance;
4242
importAccess;

src/Moose-SmalltalkImporter-LAN-Tests/FamixStepwiseImporterTest.class.st

+16-16
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ FamixStepwiseImporterTest >> testCheckFormalParameterIsCreated [
2525
| mseFormalParameter model |
2626
model := FamixStModel new.
2727
FamixStPharoImporterTask new
28-
importingContext: (MooseImportingContext new
28+
importingContext: (FamixStImporterContext new
2929
importImplicitVariable;
3030
importAccess;
3131
mergeClassAndMetaclass;
@@ -44,7 +44,7 @@ FamixStepwiseImporterTest >> testCheckSelfIsCreated [
4444
| model mseSelf |
4545
model := FamixStModel new.
4646
FamixStPharoImporterTask new
47-
importingContext: (MooseImportingContext new
47+
importingContext: (FamixStImporterContext new
4848
importImplicitVariable;
4949
importAccess;
5050
mergeClassAndMetaclass;
@@ -62,7 +62,7 @@ FamixStepwiseImporterTest >> testImportAttribute [
6262

6363
| importTask importer nodeClass |
6464
importTask := self newImportClassesTask.
65-
importTask importingContext: (MooseImportingContext new
65+
importTask importingContext: (FamixStImporterContext new
6666
importClass;
6767
importAttribute;
6868
importMethod;
@@ -80,7 +80,7 @@ FamixStepwiseImporterTest >> testImportAttributeAccesses [
8080

8181
| importTask importer nodeClass attr |
8282
importTask := self newImportClassesTask.
83-
importTask importingContext: (MooseImportingContext new
83+
importTask importingContext: (FamixStImporterContext new
8484
importClass;
8585
importAttribute;
8686
importMethod;
@@ -100,7 +100,7 @@ FamixStepwiseImporterTest >> testImportClassAndAttributeAndMergeItsMetaclass [
100100

101101
| importTask importer nodeClass |
102102
importTask := self newImportClassesTask.
103-
importTask importingContext: (MooseImportingContext new
103+
importTask importingContext: (FamixStImporterContext new
104104
importClass;
105105
importAttribute;
106106
mergeClassAndMetaclass;
@@ -116,7 +116,7 @@ FamixStepwiseImporterTest >> testImportClassAndInheritance [
116116

117117
| importTask importer importedClasses |
118118
importTask := self newImportClassesTask.
119-
importTask importingContext: (MooseImportingContext new
119+
importTask importingContext: (FamixStImporterContext new
120120
importClass;
121121
importInheritance;
122122
mergeClassAndMetaclass;
@@ -134,7 +134,7 @@ FamixStepwiseImporterTest >> testImportClassAndMethodAndMergeItsMetaclass [
134134

135135
| importTask importer importedMethods |
136136
importTask := self newImportClassesTask.
137-
importTask importingContext: (MooseImportingContext new
137+
importTask importingContext: (FamixStImporterContext new
138138
importClass;
139139
importMethod;
140140
mergeClassAndMetaclass;
@@ -153,7 +153,7 @@ FamixStepwiseImporterTest >> testImportLANPackage [
153153
model := FamixStModel new.
154154
FamixStPharoImporterTask new
155155
doNotRunCandidateOperator;
156-
importingContext: (MooseImportingContext new
156+
importingContext: (FamixStImporterContext new
157157
importClass;
158158
importPackage;
159159
yourself);
@@ -172,7 +172,7 @@ FamixStepwiseImporterTest >> testImportMergingMetaclassDoesNotDuplicateComment [
172172

173173
| importTask importer comments |
174174
importTask := self newImportClassesTask.
175-
importTask importingContext: (MooseImportingContext new
175+
importTask importingContext: (FamixStImporterContext new
176176
importClass;
177177
importComment;
178178
mergeClassAndMetaclass;
@@ -194,7 +194,7 @@ FamixStepwiseImporterTest >> testImportMethodBody [
194194

195195
| importTask importer context importedClasses famixClassNode nextNodeMethod nameMethod xFormalParameter |
196196
importTask := self newImportClassesTask.
197-
context := MooseImportingContext new
197+
context := FamixStImporterContext new
198198
importArgument;
199199
mergeClassAndMetaclass;
200200
yourself.
@@ -226,7 +226,7 @@ FamixStepwiseImporterTest >> testImportNamespace [
226226
model := FamixStModel new.
227227
FamixStPharoImporterTask new
228228
doNotRunCandidateOperator;
229-
importingContext: (MooseImportingContext new
229+
importingContext: (FamixStImporterContext new
230230
importNamespace;
231231
importClass;
232232
importPackage;
@@ -244,7 +244,7 @@ FamixStepwiseImporterTest >> testImportOneClassAndItsMetaclass [
244244

245245
| importTask importer importedClasses |
246246
importTask := self newImportClassesTask.
247-
importTask importingContext: MooseImportingContext new importClass.
247+
importTask importingContext: FamixStImporterContext new importClass.
248248
importTask addClass: LANNode.
249249
self assert: importTask classes size equals: 1.
250250
importer := importTask run.
@@ -258,7 +258,7 @@ FamixStepwiseImporterTest >> testImportOneClassAndMergeItsMetaclass [
258258

259259
| importTask importer importedClasses |
260260
importTask := self newImportClassesTask.
261-
importTask importingContext: (MooseImportingContext new
261+
importTask importingContext: (FamixStImporterContext new
262262
importClass;
263263
mergeClassAndMetaclass;
264264
yourself).
@@ -275,7 +275,7 @@ FamixStepwiseImporterTest >> testImportOneClassAndMethodAndMergeItsMetaclass [
275275

276276
| importTask importer importedMethods |
277277
importTask := self newImportClassesTask.
278-
importTask importingContext: (MooseImportingContext new
278+
importTask importingContext: (FamixStImporterContext new
279279
importClass;
280280
importMethod;
281281
mergeClassAndMetaclass;
@@ -292,7 +292,7 @@ FamixStepwiseImporterTest >> testImportOneClassAndOneAttributeAndMergeItsMetacla
292292

293293
| importTask importer nodeClass |
294294
importTask := self newImportClassesTask.
295-
importTask importingContext: (MooseImportingContext new
295+
importTask importingContext: (FamixStImporterContext new
296296
importClass;
297297
importAttribute;
298298
mergeClassAndMetaclass;
@@ -308,7 +308,7 @@ FamixStepwiseImporterTest >> testImportWithoutMergingMetaclassDoesDuplicateComme
308308

309309
| importTask importer comments |
310310
importTask := self newImportClassesTask.
311-
importTask importingContext: (MooseImportingContext new
311+
importTask importingContext: (FamixStImporterContext new
312312
importClass;
313313
importComment;
314314
distinguishClassAndMetaclass;

src/Moose-SmalltalkImporter-LAN-Tests/MoosePharoImporterTaskOnLANTest.class.st

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MoosePharoImporterTaskOnLANTest >> testImportClassUsingAddCategory [
3737
| model |
3838
FamixStPharoImporterTask new
3939
model: (model := FamixStModel new);
40-
importingContext: MooseImportingContext new importClass;
40+
importingContext: FamixStImporterContext new importClass;
4141
addFromPackage: (self packageOrganizer packageNamed: #'Moose-TestResources-LAN');
4242
run.
4343
self assert: model allClasses size equals: (self numberOfClassesIn: #( 'Moose-TestResources-LAN' )) * 2
@@ -49,7 +49,7 @@ MoosePharoImporterTaskOnLANTest >> testImportClassUsingAddClass [
4949
| model |
5050
FamixStPharoImporterTask new
5151
model: (model := FamixStModel new);
52-
importingContext: MooseImportingContext new importClass;
52+
importingContext: FamixStImporterContext new importClass;
5353
addClass: LANNode;
5454
run.
5555
self assert: model allClasses size equals: LANNode subclasses size + 1 * 2
@@ -61,7 +61,7 @@ MoosePharoImporterTaskOnLANTest >> testImportClassUsingAddPackage [
6161
| model |
6262
FamixStPharoImporterTask new
6363
model: (model := FamixStModel new);
64-
importingContext: MooseImportingContext new importClass;
64+
importingContext: FamixStImporterContext new importClass;
6565
addFromPackage: (self packageOrganizer packageNamed: #'Moose-TestResources-LAN');
6666
run.
6767
self assert: model allClasses size equals: 2 * (self packageOrganizer packageNamed: #'Moose-TestResources-LAN') definedClasses size
@@ -73,7 +73,7 @@ MoosePharoImporterTaskOnLANTest >> testImportClassUsingAddPackageNamed [
7373
| model |
7474
FamixStPharoImporterTask new
7575
model: (model := FamixStModel new);
76-
importingContext: MooseImportingContext new importClass;
76+
importingContext: FamixStImporterContext new importClass;
7777
addFromPackageNamed: 'Moose-TestResources-LAN';
7878
run.
7979
self assert: model allClasses size equals: 2 * (self packageOrganizer packageNamed: #'Moose-TestResources-LAN') definedClasses size

0 commit comments

Comments
 (0)