author | Marcel Hlopko <marcel.hlopko@fit.cvut.cz> |
Tue, 18 Dec 2012 18:36:27 +0100 | |
branch | development |
changeset 1906 | 10ab7260ffa7 |
parent 1864 | 60a8dc26c8c6 |
child 1987 | 596f7d5cb7cd |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 3 |
|
1155 | 4 |
New code and modifications done at SWING Research Group [1]: |
1152 | 5 |
|
877 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
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 |
||
1155 | 16 |
[1] Code written at SWING Research Group contains a signature |
17 |
of one of the above copright owners. For exact set of such code, |
|
18 |
see the differences between this version and version stx:libjava |
|
1152 | 19 |
as of 1.9.2010 |
877 | 20 |
" |
763 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
23 |
Object subclass:#JavaTestsLoader |
|
24 |
instanceVariableNames:'' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Tests' |
|
28 |
! |
|
29 |
||
877 | 30 |
!JavaTestsLoader class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 35 |
|
1155 | 36 |
New code and modifications done at SWING Research Group [1]: |
1152 | 37 |
|
877 | 38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
39 |
SWING Research Group, Czech Technical University in Prague |
|
40 |
||
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
||
1155 | 48 |
[1] Code written at SWING Research Group contains a signature |
49 |
of one of the above copright owners. For exact set of such code, |
|
50 |
see the differences between this version and version stx:libjava |
|
1152 | 51 |
as of 1.9.2010 |
877 | 52 |
|
53 |
" |
|
54 |
! ! |
|
763 | 55 |
|
860 | 56 |
!JavaTestsLoader class methodsFor:'accessing'! |
57 |
||
58 |
buildSuiteForLibjava |
|
59 |
||
1433 | 60 |
^(self buildSuiteFrom: (self loadLibjava)) name: 'stx:libjava Test Suite' |
860 | 61 |
|
62 |
" |
|
63 |
JavaTestsLoader buildSuiteForLibjava |
|
64 |
" |
|
65 |
||
66 |
"Created: / 21-06-2011 / 17:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
67 |
! |
|
68 |
||
69 |
buildSuiteForMauve |
|
70 |
||
1433 | 71 |
^(self buildSuiteFrom: (self loadMauve)) name: 'Mauve Test Suite' |
860 | 72 |
|
73 |
" |
|
74 |
JavaTestsLoader buildSuiteForMauve |
|
75 |
" |
|
76 |
||
77 |
"Created: / 21-06-2011 / 17:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
78 |
! |
|
79 |
||
80 |
buildSuiteForMauveToFix |
|
81 |
||
82 |
^self buildSuiteFrom: |
|
83 |
(self loadMauveToFix) |
|
84 |
||
85 |
" |
|
86 |
JavaTestsLoader buildSuiteForMauveToFix |
|
87 |
" |
|
88 |
||
89 |
"Created: / 21-06-2011 / 17:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
90 |
! ! |
|
91 |
||
763 | 92 |
!JavaTestsLoader class methodsFor:'loading'! |
93 |
||
94 |
load |
|
867 | 95 |
JavaTestsResource build. |
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
96 |
self loadIn:JavaTestsResource classpath |
763 | 97 |
|
98 |
"Created: / 07-05-2011 / 18:43:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
99 |
! |
|
100 |
||
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
101 |
load:testdir |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
102 |
|base dirs| |
763 | 103 |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
104 |
base := (UserPreferences current javaTestsDirectory asFilename / testdir) |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
105 |
pathName. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
106 |
dirs := JavaTestsResource classpath |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
107 |
select:[:each | each startsWith:base ]. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
108 |
self loadIn:dirs. |
763 | 109 |
|
110 |
" |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
111 |
JavaTestsLoader load: 'libjava'" |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
112 |
"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
|
113 |
! ! |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
114 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
115 |
!JavaTestsLoader class methodsFor:'loading - test suites'! |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
116 |
|
860 | 117 |
loadLibjava |
1075
927aeb3649fc
Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents:
1033
diff
changeset
|
118 |
| cp | |
860 | 119 |
JavaTestsResource new setUp. |
120 |
cp := JavaTestsResource classpathForLibjava. |
|
1075
927aeb3649fc
Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents:
1033
diff
changeset
|
121 |
^ self loadIn: cp |
860 | 122 |
|
123 |
"Created: / 21-06-2011 / 17:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1075
927aeb3649fc
Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents:
1033
diff
changeset
|
124 |
"Modified (format): / 03-11-2011 / 10:17:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
860 | 125 |
! |
126 |
||
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
127 |
loadMauve |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
128 |
|cp| |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
129 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
130 |
JavaTestsResource new setUp. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
131 |
cp := JavaTestsResource classpathForMauve. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
132 |
^self loadIn: cp |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
133 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
134 |
"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
|
135 |
! |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
136 |
|
852
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
137 |
loadMauve: pattern |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
138 |
|cp| |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
139 |
|
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
140 |
JavaTestsResource new setUp. |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
141 |
cp := JavaTestsResource classpathForMauve. |
857
98433a9afe3f
JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents:
852
diff
changeset
|
142 |
^self loadIn: cp matching: pattern. |
852
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
143 |
|
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
144 |
" |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
145 |
JavaTestsLoader loadMauve:'gnu.testlet.java.lang.String.*' |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
146 |
" |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
147 |
|
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
148 |
"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
|
149 |
"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
|
150 |
! |
37bd4bf93eb6
added JavaTestsLoader>>loadMauve: pattern utility method
vranyj1
parents:
849
diff
changeset
|
151 |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
152 |
loadMauveToFix |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
153 |
|cp| |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
154 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
155 |
JavaTestsResource new setUp. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
156 |
cp := JavaTestsResource classpathForMauve. |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
157 |
self |
849 | 158 |
loadIn: cp matching:'gnu.testlet.java.lang.*'; |
159 |
loadIn: cp matching:'gnu.testlet.java.lang.reflect.*'; |
|
898 | 160 |
loadIn: cp matching:'gnu.testlet.java.util.*'; |
161 |
loadIn: cp matching:'gnu.testlet.java.io.*'; |
|
162 |
loadIn: cp matching:'gnu.testlet.java.nio.*'. |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
163 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
164 |
" |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
165 |
JavaTestsLoader loadMauveToFix |
763 | 166 |
" |
167 |
||
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
168 |
"Created: / 11-06-2011 / 16:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
763 | 169 |
! ! |
170 |
||
171 |
!JavaTestsLoader class methodsFor:'private'! |
|
172 |
||
860 | 173 |
buildSuiteFrom: classes |
174 |
||
175 |
| javaTestCases suite | |
|
176 |
||
177 |
javaTestCases := OrderedCollection new. |
|
178 |
suite := TestSuite new. |
|
179 |
||
180 |
classes do: |
|
181 |
[:jclass| |
|
1545 | 182 |
((self ignoredTestCaseNames includes: jclass name) not |
183 |
and:[jclass isTestCaseLike]) |
|
860 | 184 |
ifTrue: |
185 |
[ | tc | |
|
186 |
tc := jclass asTestCase. |
|
187 |
(tc askFor:#isTestlet) ifTrue:[ |
|
188 |
tc shouldFork: true. |
|
189 |
]. |
|
190 |
tc isAbstract ifFalse:[javaTestCases add:tc ]]]. |
|
191 |
||
1492 | 192 |
javaTestCases sort:[:a :b| a name < b name ]. |
193 |
||
860 | 194 |
javaTestCases do: |
195 |
[:each | |
|
196 |
suite addTests:each buildSuite tests ]. |
|
197 |
||
198 |
^suite |
|
199 |
||
1545 | 200 |
"Modified: / 23-07-2012 / 20:12:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
201 |
! |
|
202 |
||
203 |
ignoredTestCaseNames |
|
204 |
"Return an array of java slashed class names to be ignored when |
|
205 |
building testsuite" |
|
206 |
||
207 |
^#( |
|
208 |
#'stx/libjava/tests/JUnit3Tests' |
|
209 |
#'stx/libjava/tests/JUnit4Tests' |
|
210 |
||
211 |
"Fails because of broken finalization, ignore for now.." |
|
212 |
#'gnu/testlet/java/nio/channels/FileChannel/manyopen' |
|
213 |
) |
|
214 |
||
215 |
"Created: / 23-07-2012 / 20:06:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
860 | 216 |
! |
217 |
||
763 | 218 |
loadIn: directories |
219 |
||
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
220 |
^self loadIn: directories matching: '*' |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
221 |
|
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
222 |
"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
|
223 |
! |
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
224 |
|
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
|
225 |
loadIn: directories matching: pattern |
857
98433a9afe3f
JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents:
852
diff
changeset
|
226 |
| 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
|
227 |
|
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
228 |
JavaInitializedResource new setUp. |
763 | 229 |
JavaLibrariesResource new setUp. |
230 |
JavaTestsResource new setUp. |
|
857
98433a9afe3f
JavaTestsLoader: loadMauve: now returns collection of loaded classes
vranyj1
parents:
852
diff
changeset
|
231 |
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
|
232 |
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
|
233 |
: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
|
234 |
each asFilename exists ifTrue: [ |
1033 | 235 |
classes addAll: (JavaVM loadClassesIn: each matching: pattern) |
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
|
236 |
] |
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
237 |
]. |
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
898
diff
changeset
|
238 |
^ classes |
763 | 239 |
|
848
b06ee9c295d9
Utility methods to load relevant subset of Mauve test suite
vranyj1
parents:
829
diff
changeset
|
240 |
"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
|
241 |
"Modified: / 20-06-2011 / 19:02:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
763 | 242 |
! ! |
243 |
||
244 |
!JavaTestsLoader class methodsFor:'documentation'! |
|
245 |
||
1864 | 246 |
version_HG |
247 |
||
248 |
^ '$Changeset: <not expanded> $' |
|
249 |
! |
|
250 |
||
763 | 251 |
version_SVN |
1864 | 252 |
^ '§Id§' |
763 | 253 |
! ! |