author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 05 Sep 2013 16:37:21 +0100 | |
branch | development |
changeset 2708 | 648286432b9a |
parent 2569 | 931869a85b5e |
child 2711 | a00302fe5083 |
permissions | -rw-r--r-- |
749 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
5 |
|
749 | 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 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
19 |
as of 1.9.2010 |
749 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
23 |
TestCase subclass:#JavaTestCaseProxy |
|
24 |
instanceVariableNames:'' |
|
25 |
classVariableNames:'TestCases' |
|
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Tests-Proxies' |
|
28 |
! |
|
29 |
||
30 |
JavaTestCaseProxy class instanceVariableNames:'javaClassName shouldFork' |
|
31 |
||
32 |
" |
|
33 |
The following class instance variables are inherited by this class: |
|
34 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
35 |
TestCase - lastOutcomes |
749 | 36 |
TestAsserter - |
37 |
Object - |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
!JavaTestCaseProxy class methodsFor:'documentation'! |
|
42 |
||
43 |
copyright |
|
44 |
" |
|
45 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
46 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
47 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
48 |
|
749 | 49 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
50 |
SWING Research Group, Czech Technical University in Prague |
|
51 |
||
52 |
This software is furnished under a license and may be used |
|
53 |
only in accordance with the terms of that license and with the |
|
54 |
inclusion of the above copyright notice. This software may not |
|
55 |
be provided or otherwise made available to, or used by, any |
|
56 |
other person. No title to or ownership of the software is |
|
57 |
hereby transferred. |
|
58 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
59 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
60 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
61 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
62 |
as of 1.9.2010 |
749 | 63 |
|
64 |
" |
|
65 |
! ! |
|
66 |
||
67 |
!JavaTestCaseProxy class methodsFor:'initialization'! |
|
68 |
||
69 |
initialize |
|
70 |
||
71 |
TestCases := Dictionary new. |
|
72 |
||
73 |
"Created: / 01-03-2011 / 10:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
74 |
! |
|
75 |
||
76 |
setJavaClassName: aSymbol |
|
77 |
||
78 |
javaClassName ifNotNil: |
|
79 |
[self error: 'Attempting to set java class name twice']. |
|
80 |
javaClassName := aSymbol. |
|
81 |
||
82 |
"Created: / 01-03-2011 / 10:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
83 |
! ! |
|
84 |
||
85 |
!JavaTestCaseProxy class methodsFor:'accessing'! |
|
86 |
||
87 |
javaClass |
|
88 |
||
89 |
^Java classForName: javaClassName |
|
90 |
||
91 |
"Created: / 01-03-2011 / 11:30:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
92 |
"Modified: / 21-06-2011 / 17:09:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
93 |
! |
|
94 |
||
95 |
javaClassName |
|
96 |
||
97 |
^javaClassName |
|
98 |
||
99 |
"Created: / 01-03-2011 / 11:30:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
100 |
! |
|
101 |
||
102 |
shouldFork |
|
103 |
^ shouldFork ? false |
|
104 |
||
105 |
"Modified: / 13-06-2011 / 16:34:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
106 |
! |
|
107 |
||
108 |
shouldFork:aBoolean |
|
109 |
shouldFork := aBoolean. |
|
110 |
! |
|
111 |
||
112 |
sunitName |
|
113 |
||
114 |
^javaClassName |
|
115 |
||
116 |
"Created: / 10-08-2011 / 21:21:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
117 |
! ! |
|
118 |
||
119 |
!JavaTestCaseProxy class methodsFor:'private'! |
|
120 |
||
121 |
testSelectors |
|
122 |
"raise an error: must be redefined in concrete subclass(es)" |
|
123 |
||
124 |
^ self subclassResponsibility |
|
125 |
! ! |
|
126 |
||
127 |
!JavaTestCaseProxy class methodsFor:'queries'! |
|
128 |
||
129 |
isAbstract |
|
130 |
||
131 |
^self == JavaTestCaseProxy or:[self superclass == JavaTestCaseProxy] |
|
132 |
||
133 |
"Created: / 21-06-2011 / 16:56:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
134 |
! |
|
135 |
||
136 |
isTestlet |
|
137 |
||
138 |
^false |
|
139 |
||
140 |
"Created: / 21-06-2011 / 16:57:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
141 |
! ! |
|
142 |
||
143 |
!JavaTestCaseProxy class methodsFor:'subclass creation'! |
|
144 |
||
145 |
for: javaClass |
|
146 |
||
147 |
self subclassResponsibility |
|
148 |
||
149 |
"Modified: / 21-06-2011 / 17:08:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
150 |
! |
|
151 |
||
152 |
forClassNamed: name |
|
153 |
"Answers a new (anonymous) testcase proxy for |
|
154 |
given javaClass" |
|
155 |
||
156 |
| meta cls | |
|
157 |
TestCases at: name ifPresent: [:c | ^ c ]. |
|
158 |
meta := Metaclass new. |
|
159 |
meta setSuperclass: self class. |
|
160 |
meta instSize: self class instSize. |
|
161 |
cls := meta new. |
|
162 |
cls setSuperclass: self. |
|
163 |
cls flags: self flags. |
|
164 |
cls instSize: self instSize. |
|
165 |
cls setJavaClassName: name. |
|
166 |
cls |
|
167 |
setName: (self name , ' for: (Java classForName: ' , name storeString |
|
168 |
, ')') asSymbol. |
|
169 |
cls setCategory: #'(java test case proxies)'. |
|
170 |
TestCases at: name put: cls. |
|
171 |
^ cls |
|
172 |
||
173 |
"Modified: / 03-03-2011 / 00:20:49 / Marcel Hlopko <hlopik@gmail.com>" |
|
174 |
"Modified: / 29-04-2011 / 10:21:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
175 |
"Created: / 21-06-2011 / 17:07:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
176 |
! ! |
|
177 |
||
178 |
!JavaTestCaseProxy methodsFor:'accessing'! |
|
179 |
||
180 |
javaClass |
|
181 |
||
182 |
| javaClass | |
|
183 |
||
184 |
self |
|
185 |
assert: (javaClass := self class javaClass) isJavaClass |
|
186 |
description: 'java class does not exists'. |
|
187 |
^javaClass |
|
188 |
||
189 |
"Created: / 01-03-2011 / 14:48:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
190 |
||
2569
931869a85b5e
Adde JavaTestCaseProxy>>timeout.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2429
diff
changeset
|
191 |
! |
931869a85b5e
Adde JavaTestCaseProxy>>timeout.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2429
diff
changeset
|
192 |
|
931869a85b5e
Adde JavaTestCaseProxy>>timeout.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2429
diff
changeset
|
193 |
timeout |
931869a85b5e
Adde JavaTestCaseProxy>>timeout.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2429
diff
changeset
|
194 |
^60"sec" |
931869a85b5e
Adde JavaTestCaseProxy>>timeout.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2429
diff
changeset
|
195 |
|
749 | 196 |
! ! |
197 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
198 |
!JavaTestCaseProxy methodsFor:'queries'! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
199 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
200 |
shouldSkip |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
201 |
^false |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
202 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
203 |
"Created: / 29-11-2012 / 12:03:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
204 |
! ! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
205 |
|
749 | 206 |
!JavaTestCaseProxy class methodsFor:'documentation'! |
207 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
208 |
version_CVS |
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
209 |
^ '$Header: /cvs/stx/stx/libjava/JavaTestCaseProxy.st,v 1.3 2013-02-25 11:15:31 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
210 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
211 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
212 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
213 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
214 |
^ '$Changeset: <not expanded> $' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
215 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
216 |
|
749 | 217 |
version_SVN |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
218 |
^ '§Id§' |
749 | 219 |
! ! |
220 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
221 |
|
2152 | 222 |
JavaTestCaseProxy initialize! |