749
|
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 |
"
|
|
42 |
"{ Package: 'stx:libjava' }"
|
|
43 |
|
|
44 |
TestCase subclass:#JavaTestCaseProxy
|
|
45 |
instanceVariableNames:''
|
|
46 |
classVariableNames:'TestCases'
|
|
47 |
poolDictionaries:''
|
|
48 |
category:'Languages-Java-Tests-Proxies'
|
|
49 |
!
|
|
50 |
|
|
51 |
JavaTestCaseProxy class instanceVariableNames:'javaClassName shouldFork'
|
|
52 |
|
|
53 |
"
|
|
54 |
The following class instance variables are inherited by this class:
|
|
55 |
|
|
56 |
TestCase - lastTestRunResultOrNil lastTestRunsPassedTests lastTestRunsFailedTests lastTestRunsErrorTests
|
|
57 |
TestAsserter -
|
|
58 |
Object -
|
|
59 |
"
|
|
60 |
!
|
|
61 |
|
|
62 |
!JavaTestCaseProxy class methodsFor:'documentation'!
|
|
63 |
|
|
64 |
copyright
|
|
65 |
"
|
|
66 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
67 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
68 |
SWING Research Group, Czech Technical University in Prague
|
|
69 |
|
|
70 |
Parts of the code written by Claus Gittinger are under following
|
|
71 |
license:
|
|
72 |
|
|
73 |
This software is furnished under a license and may be used
|
|
74 |
only in accordance with the terms of that license and with the
|
|
75 |
inclusion of the above copyright notice. This software may not
|
|
76 |
be provided or otherwise made available to, or used by, any
|
|
77 |
other person. No title to or ownership of the software is
|
|
78 |
hereby transferred.
|
|
79 |
|
|
80 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
81 |
|
|
82 |
Permission is hereby granted, free of charge, to any person
|
|
83 |
obtaining a copy of this software and associated documentation
|
|
84 |
files (the 'Software'), to deal in the Software without
|
|
85 |
restriction, including without limitation the rights to use,
|
|
86 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
87 |
copies of the Software, and to permit persons to whom the
|
|
88 |
Software is furnished to do so, subject to the following
|
|
89 |
conditions:
|
|
90 |
|
|
91 |
The above copyright notice and this permission notice shall be
|
|
92 |
included in all copies or substantial portions of the Software.
|
|
93 |
|
|
94 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
95 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
96 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
97 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
98 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
99 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
100 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
101 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
102 |
|
|
103 |
[1] Code written at SWING Research Group contain a signature
|
|
104 |
of one of the above copright owners.
|
|
105 |
|
|
106 |
"
|
|
107 |
! !
|
|
108 |
|
|
109 |
!JavaTestCaseProxy class methodsFor:'initialization'!
|
|
110 |
|
|
111 |
initialize
|
|
112 |
|
|
113 |
TestCases := Dictionary new.
|
|
114 |
|
|
115 |
"Created: / 01-03-2011 / 10:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
116 |
!
|
|
117 |
|
|
118 |
setJavaClassName: aSymbol
|
|
119 |
|
|
120 |
javaClassName ifNotNil:
|
|
121 |
[self error: 'Attempting to set java class name twice'].
|
|
122 |
javaClassName := aSymbol.
|
|
123 |
|
|
124 |
"Created: / 01-03-2011 / 10:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
125 |
! !
|
|
126 |
|
|
127 |
!JavaTestCaseProxy class methodsFor:'accessing'!
|
|
128 |
|
|
129 |
javaClass
|
|
130 |
|
|
131 |
^Java classForName: javaClassName
|
|
132 |
|
|
133 |
"Created: / 01-03-2011 / 11:30:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
134 |
"Modified: / 21-06-2011 / 17:09:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
135 |
!
|
|
136 |
|
|
137 |
javaClassName
|
|
138 |
|
|
139 |
^javaClassName
|
|
140 |
|
|
141 |
"Created: / 01-03-2011 / 11:30:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
142 |
!
|
|
143 |
|
|
144 |
shouldFork
|
|
145 |
^ shouldFork ? false
|
|
146 |
|
|
147 |
"Modified: / 13-06-2011 / 16:34:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
148 |
!
|
|
149 |
|
|
150 |
shouldFork:aBoolean
|
|
151 |
shouldFork := aBoolean.
|
|
152 |
!
|
|
153 |
|
|
154 |
sunitName
|
|
155 |
|
|
156 |
^javaClassName
|
|
157 |
|
|
158 |
"Created: / 10-08-2011 / 21:21:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
159 |
! !
|
|
160 |
|
|
161 |
!JavaTestCaseProxy class methodsFor:'private'!
|
|
162 |
|
|
163 |
testSelectors
|
|
164 |
"raise an error: must be redefined in concrete subclass(es)"
|
|
165 |
|
|
166 |
^ self subclassResponsibility
|
|
167 |
! !
|
|
168 |
|
|
169 |
!JavaTestCaseProxy class methodsFor:'queries'!
|
|
170 |
|
|
171 |
isAbstract
|
|
172 |
|
|
173 |
^self == JavaTestCaseProxy or:[self superclass == JavaTestCaseProxy]
|
|
174 |
|
|
175 |
"Created: / 21-06-2011 / 16:56:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
176 |
!
|
|
177 |
|
|
178 |
isTestlet
|
|
179 |
|
|
180 |
^false
|
|
181 |
|
|
182 |
"Created: / 21-06-2011 / 16:57:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
183 |
! !
|
|
184 |
|
|
185 |
!JavaTestCaseProxy class methodsFor:'subclass creation'!
|
|
186 |
|
|
187 |
for: javaClass
|
|
188 |
|
|
189 |
self subclassResponsibility
|
|
190 |
|
|
191 |
"Modified: / 21-06-2011 / 17:08:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
192 |
!
|
|
193 |
|
|
194 |
forClassNamed: name
|
|
195 |
"Answers a new (anonymous) testcase proxy for
|
|
196 |
given javaClass"
|
|
197 |
|
|
198 |
| meta cls |
|
|
199 |
TestCases at: name ifPresent: [:c | ^ c ].
|
|
200 |
meta := Metaclass new.
|
|
201 |
meta setSuperclass: self class.
|
|
202 |
meta instSize: self class instSize.
|
|
203 |
cls := meta new.
|
|
204 |
cls setSuperclass: self.
|
|
205 |
cls flags: self flags.
|
|
206 |
cls instSize: self instSize.
|
|
207 |
cls setJavaClassName: name.
|
|
208 |
cls
|
|
209 |
setName: (self name , ' for: (Java classForName: ' , name storeString
|
|
210 |
, ')') asSymbol.
|
|
211 |
cls setCategory: #'(java test case proxies)'.
|
|
212 |
TestCases at: name put: cls.
|
|
213 |
^ cls
|
|
214 |
|
|
215 |
"Modified: / 03-03-2011 / 00:20:49 / Marcel Hlopko <hlopik@gmail.com>"
|
|
216 |
"Modified: / 29-04-2011 / 10:21:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
217 |
"Created: / 21-06-2011 / 17:07:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
218 |
! !
|
|
219 |
|
|
220 |
!JavaTestCaseProxy methodsFor:'accessing'!
|
|
221 |
|
|
222 |
javaClass
|
|
223 |
|
|
224 |
| javaClass |
|
|
225 |
|
|
226 |
self
|
|
227 |
assert: (javaClass := self class javaClass) isJavaClass
|
|
228 |
description: 'java class does not exists'.
|
|
229 |
^javaClass
|
|
230 |
|
|
231 |
"Created: / 01-03-2011 / 14:48:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
232 |
|
|
233 |
! !
|
|
234 |
|
|
235 |
!JavaTestCaseProxy class methodsFor:'documentation'!
|
|
236 |
|
|
237 |
version_SVN
|
2152
|
238 |
^ '$Id: JavaTestCaseProxy.st,v 1.1 2011-08-18 19:06:53 vrany Exp $'
|
749
|
239 |
! !
|
|
240 |
|
2152
|
241 |
JavaTestCaseProxy initialize!
|