1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
'From Haver 5.0 [latest update: #4568] on 16 April 2021 at 7:51:10 pm'!
'Description '!
!provides: 'FileFinderTest' 1 7!
!requires: 'FileFinder' 1 9 nil!
SystemOrganization addCategory: 'FileFinderTest'!
!moduleCreation: FileFinderTest!
Modules newEnvironment: #FileFinderTest!
!interfacesOf: FileFinderTest!
Modules environment: #FileFinderTest ::
interface: #SPI aliasFor: #API!
!interfacesOf: FileFinder!
Modules environment: #FileFinder ::
interface: #UTI exporting: #PackageFileFinder#(#VMFileFinder #LiveVMFileFinder )#ComplexFileFinder#ChangeSetFileFinder#(#SourceFileFinder #LiveSourceFileFinder )#(#ImageFileFinder #LiveImageFileFinder ) inPackage: 'FileFinderTest'!
!importsOf: FileFinderTest!
Modules environment: #FileFinderTest ::
import: #UTI of: Modules>>#FileFinder!
!classDefinition: (Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) category: 'FileFinderTest'!
TestCase subclass: #AbstractFileFinderTestCase
instanceVariableNames: 'fileFinder'
classVariableNames: ''
poolDictionaries: ''
category: 'FileFinderTest'
inModule: #FileFinderTest!
!classDefinition: (Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) class category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#FileFinderTest>>#CreationTestCase) category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) subclass: #CreationTestCase
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'FileFinderTest'
inModule: #FileFinderTest!
!classDefinition: (Modules>>#FileFinderTest>>#CreationTestCase) class category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#CreationTestCase) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#FileFinderTest>>#FindChangeSetFileTestCase) category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) subclass: #FindChangeSetFileTestCase
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'FileFinderTest'
inModule: #FileFinderTest!
!classDefinition: (Modules>>#FileFinderTest>>#FindChangeSetFileTestCase) class category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#FindChangeSetFileTestCase) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#FileFinderTest>>#FindImageFileTestCase) category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) subclass: #FindImageFileTestCase
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'FileFinderTest'
inModule: #FileFinderTest!
!classDefinition: (Modules>>#FileFinderTest>>#FindImageFileTestCase) class category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#FindImageFileTestCase) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#FileFinderTest>>#FindPackageFileTestCase) category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) subclass: #FindPackageFileTestCase
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'FileFinderTest'
inModule: #FileFinderTest!
!classDefinition: (Modules>>#FileFinderTest>>#FindPackageFileTestCase) class category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#FindPackageFileTestCase) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#FileFinderTest>>#FindSourceFileTestCase) category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) subclass: #FindSourceFileTestCase
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'FileFinderTest'
inModule: #FileFinderTest!
!classDefinition: (Modules>>#FileFinderTest>>#FindSourceFileTestCase) class category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#FindSourceFileTestCase) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#FileFinderTest>>#FindVMFileTestCase) category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) subclass: #FindVMFileTestCase
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'FileFinderTest'
inModule: #FileFinderTest!
!classDefinition: (Modules>>#FileFinderTest>>#FindVMFileTestCase) class category: 'FileFinderTest'!
(Modules>>#FileFinderTest>>#FindVMFileTestCase) class
instanceVariableNames: ''!
!(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) methodsFor: 'initialization' stamp: 'KLG 4/9/2021 18:05:47'!
initializeFileFinder
"Initialize the file finder"! !
!(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) methodsFor: 'setUp/tearDown' stamp: 'KLG 4/9/2021 18:05:52'!
setUp
"Set up the file finder to test."
super setUp.
fileFinder _ self fileFinderClassToTest new.
self initializeFileFinder! !
!(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) methodsFor: 'instance creation' stamp: 'KLG 4/9/2021 12:38:42'!
fileFinderClassToTest
"Answer the class of the file finder to test."
^ self class fileFinderClassToTest! !
!(Modules>>#FileFinderTest>>#AbstractFileFinderTestCase) class methodsFor: 'instance creation' stamp: 'KLG 4/9/2021 12:38:42'!
fileFinderClassToTest
"Answer the class of the file finder to test."
^ self subclassResponsibility ! !
!(Modules>>#FileFinderTest>>#CreationTestCase) methodsFor: 'testing' stamp: 'KLG 4/11/2021 20:31:06'!
testUniqueness
"Test the instantiation and uniqueness of all the sub models."
self
assert: fileFinder haverImageFileFinder == fileFinder haverImageFileFinder;
assert: fileFinder haverChangesFileFinder == fileFinder haverChangesFileFinder;
assert: fileFinder cuisImageFileFinder == fileFinder cuisImageFileFinder;
assert: fileFinder cuisChangesFileFinder == fileFinder cuisChangesFileFinder;
assert: fileFinder packageFileFinder == fileFinder packageFileFinder;
assert: fileFinder changeSetFileFinder == fileFinder changeSetFileFinder;
assert: fileFinder compressedSourceFileFinder == fileFinder compressedSourceFileFinder;
assert: fileFinder vmFileFinder == fileFinder vmFileFinder! !
!(Modules>>#FileFinderTest>>#CreationTestCase) class methodsFor: 'instance creation' stamp: 'KLG 4/9/2021 12:38:42'!
fileFinderClassToTest
"Answer the class of the file finder to test."
^ ComplexFileFinder ! !
!(Modules>>#FileFinderTest>>#FindChangeSetFileTestCase) methodsFor: 'initialization' stamp: 'KLG 4/11/2021 18:59:17'!
initializeFileFinder
"Initialize the file finder"
fileFinder
addRoot: '/home/bear/smallworks/cuis/Environments/HaverOnCuis/environments'
andFileBundleConstructor: #forChangeSet
! !
!(Modules>>#FileFinderTest>>#FindChangeSetFileTestCase) methodsFor: 'testing' stamp: 'KLG 4/9/2021 18:59:20'!
testFiles
"Check that the source file finder answers the right source files."
| filenames |
filenames _ fileFinder filenames.
self
assert: 1 equals: filenames size;
assert: (filenames isKindOf: SequenceableCollection).
filenames do: [ :filename | self assert: filename isString ]! !
!(Modules>>#FileFinderTest>>#FindChangeSetFileTestCase) class methodsFor: 'instance creation' stamp: 'KLG 4/9/2021 18:57:34'!
fileFinderClassToTest
"Answer the class of the file finder to test."
^ ChangeSetFileFinder ! !
!(Modules>>#FileFinderTest>>#FindImageFileTestCase) methodsFor: 'testing' stamp: 'KLG 4/9/2021 14:34:19'!
testFiles
"Check that the source file finder answers the right source files."
| filenames |
filenames _ fileFinder filenames.
self
assert: 1 equals: filenames size;
assert: (filenames isKindOf: SequenceableCollection).
filenames do: [ :filename | self assert: filename isString ]! !
!(Modules>>#FileFinderTest>>#FindImageFileTestCase) class methodsFor: 'instance creation' stamp: 'KLG 4/9/2021 14:39:07'!
fileFinderClassToTest
"Answer the class of the file finder to test."
^ ImageFileFinder ! !
!(Modules>>#FileFinderTest>>#FindPackageFileTestCase) methodsFor: 'initialization' stamp: 'KLG 4/9/2021 18:59:57'!
initializeFileFinder
"Initialize the file finder"
fileFinder
cuisRoot: '/home/bear/gitwork/Cuis-Smalltalk'
andHaverRoot: '/home/bear/smallworks/cuis/Environments/HaverOnCuis'
! !
!(Modules>>#FileFinderTest>>#FindPackageFileTestCase) methodsFor: 'testing' stamp: 'KLG 4/9/2021 18:07:06'!
testFiles
"Check that the source file finder answers the right source files."
| filenames |
filenames _ fileFinder filenames.
self
assert: (filenames isKindOf: SequenceableCollection).
filenames do: [ :filename | self assert: filename isString ]! !
!(Modules>>#FileFinderTest>>#FindPackageFileTestCase) class methodsFor: 'instance creation' stamp: 'KLG 4/9/2021 18:08:30'!
fileFinderClassToTest
"Answer the class of the file finder to test."
^ PackageFileFinder ! !
!(Modules>>#FileFinderTest>>#FindSourceFileTestCase) methodsFor: 'testing' stamp: 'KLG 4/9/2021 12:55:31'!
testFiles
"Check that the source file finder answers the right source files."
| filenames |
filenames _ fileFinder filenames.
self
assert: 2 equals: filenames size;
assert: (filenames isKindOf: SequenceableCollection).
filenames do: [ :filename | self assert: filename isString ]! !
!(Modules>>#FileFinderTest>>#FindSourceFileTestCase) class methodsFor: 'instance creation' stamp: 'KLG 4/9/2021 12:38:42'!
fileFinderClassToTest
"Answer the class of the file finder to test."
^ SourceFileFinder! !
!(Modules>>#FileFinderTest>>#FindVMFileTestCase) methodsFor: 'testing' stamp: 'KLG 4/10/2021 10:41:58'!
testFiles
"Check that the VM file finder answers the right files."
| filenames |
filenames _ fileFinder filenames.
self
assert: (filenames isKindOf: SequenceableCollection).
self flagHaver: 'TODO: Make this platform agnostic'.
filenames do: [ :filename | | entry extension |
self assert: filename isString.
extension _
(entry _ filename asFileEntry) baseName = 'squeak' ifTrue: [ ''] ifFalse: [ 'so' ].
self assert: extension equals: entry extension ].! !
!(Modules>>#FileFinderTest>>#FindVMFileTestCase) class methodsFor: 'instance creation' stamp: 'KLG 4/9/2021 14:39:37'!
fileFinderClassToTest
"Answer the class of the file finder to test."
^ VMFileFinder ! !