author | hlopkmar |
Wed, 19 Oct 2011 16:18:27 +0000 | |
branch | jk_new_structure |
changeset 1026 | 5badd1d31864 |
parent 898 | 94eb1038a323 |
child 1033 | a31de6a4cfa4 |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
4 |
SWING Research Group, Czech Technical University in Prague |
|
5 |
||
6 |
Parts of the code written by Claus Gittinger are under following |
|
7 |
license: |
|
8 |
||
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
15 |
||
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed: |
|
17 |
||
18 |
Permission is hereby granted, free of charge, to any person |
|
19 |
obtaining a copy of this software and associated documentation |
|
20 |
files (the 'Software'), to deal in the Software without |
|
21 |
restriction, including without limitation the rights to use, |
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
23 |
copies of the Software, and to permit persons to whom the |
|
24 |
Software is furnished to do so, subject to the following |
|
25 |
conditions: |
|
26 |
||
27 |
The above copyright notice and this permission notice shall be |
|
28 |
included in all copies or substantial portions of the Software. |
|
29 |
||
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
37 |
OTHER DEALINGS IN THE SOFTWARE. |
|
38 |
||
39 |
[1] Code written at SWING Research Group contain a signature |
|
40 |
of one of the above copright owners. |
|
41 |
" |
|
763 | 42 |
"{ Package: 'stx:libjava' }" |
43 |
||
44 |
Object subclass:#JavaTestsLoader |
|
45 |
instanceVariableNames:'' |
|
46 |
classVariableNames:'' |
|
47 |
poolDictionaries:'' |
|
48 |
category:'Languages-Java-Tests' |
|
49 |
! |
|
50 |
||
877 | 51 |
!JavaTestsLoader class methodsFor:'documentation'! |
52 |
||
53 |
copyright |
|
54 |
" |
|
55 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
56 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
57 |
SWING Research Group, Czech Technical University in Prague |
|
58 |
||
59 |
Parts of the code written by Claus Gittinger are under following |
|
60 |
license: |
|
61 |
||
62 |
This software is furnished under a license and may be used |
|
63 |
only in accordance with the terms of that license and with the |
|
64 |
inclusion of the above copyright notice. This software may not |
|
65 |
be provided or otherwise made available to, or used by, any |
|
66 |
other person. No title to or ownership of the software is |
|
67 |
hereby transferred. |
|
68 |
||
69 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed: |
|
70 |
||
71 |
Permission is hereby granted, free of charge, to any person |
|
72 |
obtaining a copy of this software and associated documentation |
|
73 |
files (the 'Software'), to deal in the Software without |
|
74 |
restriction, including without limitation the rights to use, |
|
75 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
76 |
copies of the Software, and to permit persons to whom the |
|
77 |
Software is furnished to do so, subject to the following |
|
78 |
conditions: |
|
79 |
||
80 |
The above copyright notice and this permission notice shall be |
|
81 |
included in all copies or substantial portions of the Software. |
|
82 |
||
83 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
84 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
85 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
86 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
87 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
88 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
89 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
90 |
OTHER DEALINGS IN THE SOFTWARE. |
|
91 |
||
92 |
[1] Code written at SWING Research Group contain a signature |
|
93 |
of one of the above copright owners. |
|
94 |
||
95 |
" |
|
96 |
! ! |
|
763 | 97 |
|
860 | 98 |
!JavaTestsLoader class methodsFor:'accessing'! |
99 |
||
100 |
buildSuiteForLibjava |
|
101 |
||
102 |
^self buildSuiteFrom: |
|
103 |
(self loadLibjava) |
|
104 |
||
105 |
" |
|
106 |
JavaTestsLoader buildSuiteForLibjava |
|
107 |
" |
|
108 |
||
109 |
"Created: / 21-06-2011 / 17:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
110 |
! |
|
111 |
||
112 |
buildSuiteForMauve |
|
113 |
||
114 |
^self buildSuiteFrom: |
|
115 |
(self loadMauve) |
|
116 |
||
117 |
" |
|
118 |
JavaTestsLoader buildSuiteForMauve |
|
119 |
" |
|
120 |
||
121 |
"Created: / 21-06-2011 / 17:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
122 |
! |
|
123 |
||
124 |
buildSuiteForMauveToFix |
|
125 |
||
126 |
^self buildSuiteFrom: |
|
127 |
(self loadMauveToFix) |
|
128 |
||
129 |
" |
|
130 |
JavaTestsLoader buildSuiteForMauveToFix |
|
131 |
" |
|
132 |
||
133 |
"Created: / 21-06-2011 / 17:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
134 |
! ! |
|
135 |
||
763 | 136 |
!JavaTestsLoader class methodsFor:'loading'! |
137 |
||
138 |
load |
|
867 | 139 |
JavaTestsResource build. |
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
140 |
self loadIn:JavaTestsResource classpath |
763 | 141 |
|
142 |
"Created: / 07-05-2011 / 18:43:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
143 |
! |
|
144 |
||
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
145 |
load:testdir |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
146 |
|base dirs| |
763 | 147 |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
148 |
base := (UserPreferences current javaTestsDirectory asFilename / testdir) |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
149 |
pathName. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
150 |
dirs := JavaTestsResource classpath |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
151 |
select:[:each | each startsWith:base ]. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
152 |
self loadIn:dirs. |
763 | 153 |
|
154 |
" |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
155 |
JavaTestsLoader load: 'libjava'" |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
156 |
"Created: / 07-05-2011 / 18:40:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
157 |
! ! |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
158 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
159 |
!JavaTestsLoader class methodsFor:'loading - test suites'! |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
160 |
|
860 | 161 |
loadLibjava |
162 |
|cp| |
|
163 |
||
164 |
JavaTestsResource new setUp. |
|
165 |
cp := JavaTestsResource classpathForLibjava. |
|
166 |
^self loadIn: cp |
|
167 |
||
168 |
"Created: / 21-06-2011 / 17:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
169 |
! |
|
170 |
||
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
171 |
loadMauve |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
172 |
|cp| |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
173 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
174 |
JavaTestsResource new setUp. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
175 |
cp := JavaTestsResource classpathForMauve. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
176 |
^self loadIn: cp |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
177 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
178 |
"Created: / 11-06-2011 / 16:03:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
179 |
! |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
180 |
|
852
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
181 |
loadMauve: pattern |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
182 |
|cp| |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
183 |
|
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
184 |
JavaTestsResource new setUp. |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
185 |
cp := JavaTestsResource classpathForMauve. |
857
98433a9afe3f
JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents:
852
diff
changeset
|
186 |
^self loadIn: cp matching: pattern. |
852
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
187 |
|
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
188 |
" |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
189 |
JavaTestsLoader loadMauve:'gnu.testlet.java.lang.String.*' |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
190 |
" |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
191 |
|
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
192 |
"Created: / 12-06-2011 / 21:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
857
98433a9afe3f
JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents:
852
diff
changeset
|
193 |
"Modified: / 20-06-2011 / 19:00:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
852
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
194 |
! |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
195 |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
196 |
loadMauveToFix |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
197 |
|cp| |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
198 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
199 |
JavaTestsResource new setUp. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
200 |
cp := JavaTestsResource classpathForMauve. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
201 |
self |
849 | 202 |
loadIn: cp matching:'gnu.testlet.java.lang.*'; |
203 |
loadIn: cp matching:'gnu.testlet.java.lang.reflect.*'; |
|
898 | 204 |
loadIn: cp matching:'gnu.testlet.java.util.*'; |
205 |
loadIn: cp matching:'gnu.testlet.java.io.*'; |
|
206 |
loadIn: cp matching:'gnu.testlet.java.nio.*'. |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
207 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
208 |
" |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
209 |
JavaTestsLoader loadMauveToFix |
763 | 210 |
" |
211 |
||
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
212 |
"Created: / 11-06-2011 / 16:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
763 | 213 |
! ! |
214 |
||
215 |
!JavaTestsLoader class methodsFor:'private'! |
|
216 |
||
860 | 217 |
buildSuiteFrom: classes |
218 |
||
219 |
| javaTestCases suite | |
|
220 |
||
221 |
javaTestCases := OrderedCollection new. |
|
222 |
suite := TestSuite new. |
|
223 |
||
224 |
classes do: |
|
225 |
[:jclass| |
|
226 |
(jclass ~~ (Java at:'stx.libjava.tests.JUnit3Tests') |
|
227 |
and:[jclass ~~ (Java at:'stx.libjava.tests.JUnit4Tests') |
|
228 |
and:[jclass isTestCaseLike]]) |
|
229 |
ifTrue: |
|
230 |
[ | tc | |
|
231 |
tc := jclass asTestCase. |
|
232 |
(tc askFor:#isTestlet) ifTrue:[ |
|
233 |
tc shouldFork: true. |
|
234 |
]. |
|
235 |
tc isAbstract ifFalse:[javaTestCases add:tc ]]]. |
|
236 |
||
237 |
javaTestCases do: |
|
238 |
[:each | |
|
239 |
suite addTests:each buildSuite tests ]. |
|
240 |
||
241 |
^suite |
|
242 |
||
243 |
"Modified: / 21-06-2011 / 17:39:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
244 |
! |
|
245 |
||
763 | 246 |
loadIn: directories |
247 |
||
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
248 |
^self loadIn: directories matching: '*' |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
249 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
250 |
"Created: / 11-06-2011 / 16:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
251 |
! |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
252 |
|
1026
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
253 |
loadIn: directories matching: pattern |
857
98433a9afe3f
JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents:
852
diff
changeset
|
254 |
| classes | |
1026
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
255 |
|
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
256 |
JavaInitializedResource new setUp. |
763 | 257 |
JavaLibrariesResource new setUp. |
258 |
JavaTestsResource new setUp. |
|
857
98433a9afe3f
JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents:
852
diff
changeset
|
259 |
classes := OrderedCollection new. |
1026
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
260 |
directories do: [ |
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
261 |
:each | |
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
262 |
each asFilename exists ifTrue: [ |
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
263 |
classes addAll: (Java javaRegistry loadClassesIn: each matching: pattern) |
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
264 |
] |
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
265 |
]. |
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
266 |
^ classes |
763 | 267 |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
268 |
"Created: / 11-06-2011 / 16:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
857
98433a9afe3f
JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents:
852
diff
changeset
|
269 |
"Modified: / 20-06-2011 / 19:02:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
763 | 270 |
! ! |
271 |
||
272 |
!JavaTestsLoader class methodsFor:'documentation'! |
|
273 |
||
274 |
version_SVN |
|
275 |
^ '$Id$' |
|
276 |
! ! |