author | vranyj1 |
Mon, 08 Aug 2011 16:36:49 +0000 | |
branch | jk_new_structure |
changeset 891 | bd376bf281fe |
parent 877 | f5a5b93e1c78 |
child 1152 | 040cba55a7d2 |
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 |
" |
|
773 | 42 |
"{ Package: 'stx:libjava' }" |
43 |
||
44 |
TestCase subclass:#AbstractJavaTestCase |
|
45 |
instanceVariableNames:'exceptionThrowerBackup' |
|
46 |
classVariableNames:'' |
|
47 |
poolDictionaries:'' |
|
48 |
category:'Languages-Java-Tests-RuntimeConstantPool' |
|
49 |
! |
|
50 |
||
877 | 51 |
!AbstractJavaTestCase 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 |
! ! |
|
773 | 97 |
|
98 |
!AbstractJavaTestCase class methodsFor:'resources'! |
|
99 |
||
100 |
resources |
|
101 |
^ Array with: JavaInitializedResource with: JavaTestsResource. |
|
102 |
||
103 |
"Created: / 26-04-2011 / 13:03:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
104 |
! ! |
|
105 |
||
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
106 |
!AbstractJavaTestCase methodsFor:'cp creation helpers'! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
107 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
108 |
getClassRefNamed: name |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
109 |
"creates classRef with correctly prepared constant pool" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
110 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
111 |
| cp | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
112 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
113 |
cp := JavaConstantPool new:2. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
114 |
cp at: 1 put: (self getClassRefIn: cp withNameAt: 2). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
115 |
cp at: 2 put: name. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
116 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
117 |
^ cp at: 1. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
118 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
119 |
"Created: / 23-05-2011 / 16:17:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
120 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
121 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
122 |
getFieldRefNamed: name typed: type inClass: classString |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
123 |
"creates fieldRef with correctly prepared constant pool" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
124 |
| cp | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
125 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
126 |
cp := JavaConstantPool new: 6. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
127 |
cp at: 1 put: (self getClassRefIn: cp withNameAt: 2). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
128 |
cp at: 2 put: classString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
129 |
cp at: 3 put: name. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
130 |
cp at: 4 put: type. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
131 |
cp at: 5 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
132 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
133 |
getFieldRefIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
134 |
withNameAndTypeAt: 6 andClassAt: 1). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
135 |
cp at: 6 put: (self getNameAndTypeIn: cp withNameAt: 3 andTypeAt: 4). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
136 |
^ cp at: 5. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
137 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
138 |
"Created: / 23-05-2011 / 15:56:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
139 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
140 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
141 |
getInterfaceMethodRefNamed: name typed: type inClass: classString |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
142 |
"creates interfaceMethodRef with correctly prepared constant pool" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
143 |
| cp | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
144 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
145 |
cp := JavaConstantPool new: 6. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
146 |
cp at: 1 put: (self getClassRefIn: cp withNameAt: 2). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
147 |
cp at: 2 put: classString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
148 |
cp at: 3 put: name. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
149 |
cp at: 4 put: type. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
150 |
cp at: 5 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
151 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
152 |
getInterfaceMethodRefIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
153 |
withNameAndTypeAt: 6 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
154 |
andClassAt: 1). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
155 |
cp at: 6 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
156 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
157 |
getNameAndTypeIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
158 |
withNameAt: 3 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
159 |
andTypeAt: 4). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
160 |
^ cp at: 5. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
161 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
162 |
"Created: / 23-05-2011 / 16:15:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
163 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
164 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
165 |
getMethodRefNamed: name typed: type inClass: classString |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
166 |
"creates methodRef with correctly prepared constant pool" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
167 |
| cp | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
168 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
169 |
cp := JavaConstantPool new: 6. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
170 |
cp at: 1 put: (self getClassRefIn: cp withNameAt: 2). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
171 |
cp at: 2 put: classString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
172 |
cp at: 3 put: name. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
173 |
cp at: 4 put: type. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
174 |
cp at: 5 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
175 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
176 |
getMethodRefIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
177 |
withNameAndTypeAt: 6 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
178 |
andClassAt: 1). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
179 |
cp at: 6 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
180 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
181 |
getNameAndTypeIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
182 |
withNameAt: 3 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
183 |
andTypeAt: 4). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
184 |
^ cp at: 5. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
185 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
186 |
"Created: / 23-05-2011 / 16:00:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
187 |
! ! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
188 |
|
773 | 189 |
!AbstractJavaTestCase methodsFor:'helpers'! |
190 |
||
191 |
disableMockedExceptionThrowing |
|
192 |
JavaResolver uniqueInstance exceptionThrower: exceptionThrowerBackup. |
|
193 |
||
194 |
"Created: / 13-04-2011 / 14:11:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
195 |
! |
|
196 |
||
197 |
enableMockedExceptionThrowing |
|
198 |
exceptionThrowerBackup := JavaResolver uniqueInstance exceptionThrower. |
|
199 |
JavaResolver uniqueInstance exceptionThrower: JavaExceptionThrowerMock new. |
|
200 |
||
201 |
"Created: / 13-04-2011 / 14:11:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
202 |
! |
|
203 |
||
204 |
getCrateClassReadStream |
|
205 |
^ ((Filename named: UserPreferences current javaTestsDirectory) |
|
206 |
/ 'libjava' / 'bin' |
|
207 |
/ 'stx' / 'libjava' |
|
208 |
/ 'tests' / 'mocks' |
|
209 |
/ 'Crate.class') readStream. |
|
210 |
||
211 |
"Created: / 10-05-2011 / 12:13:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
212 |
"Modified: / 12-05-2011 / 16:26:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
213 |
! |
|
214 |
||
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
215 |
getPrettyBigConstantPool |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
216 |
| cp | |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
217 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
218 |
cp := JavaConstantPool new: 20. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
219 |
cp at: 1 put: 6. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
220 |
cp at: 2 put: 'Ljava/lang/Object;'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
221 |
cp at: 3 putClassRefWithNameAt: 2. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
222 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
223 |
at: 4 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
224 |
putMethodRefWithClassAt: 3 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
225 |
andNameAndTypeAt: 5. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
226 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
227 |
at: 5 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
228 |
putNameAndTypeWithNameAt: 6 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
229 |
andDescriptorAt: 7. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
230 |
cp at: 6 put: '<init>'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
231 |
cp at: 7 put: '()V'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
232 |
cp at: 8 put: 'Ljava/lang/String;'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
233 |
cp at: 9 putClassRefWithNameAt: 8. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
234 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
235 |
at: 10 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
236 |
putMethodRefWithClassAt: 9 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
237 |
andNameAndTypeAt: 13. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
238 |
cp at: 11 put: 'length'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
239 |
cp at: 12 put: '()I'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
240 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
241 |
at: 13 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
242 |
putNameAndTypeWithNameAt: 11 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
243 |
andDescriptorAt: 12. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
244 |
cp at: 14 putClassRefWithNameAt: 15. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
245 |
cp at: 15 put: 'Ljava/lang/Runnable;'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
246 |
cp at: 16 put: 'run'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
247 |
cp at: 17 put: '()V'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
248 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
249 |
at: 18 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
250 |
putNameAndTypeWithNameAt: 16 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
251 |
andDescriptorAt: 17. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
252 |
cp at: 19 putClassRefWithNameAt: 15. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
253 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
254 |
at: 20 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
255 |
putInterfaceMethodRefWithClassAt: 19 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
256 |
andNameAndTypeAt: 18. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
257 |
^ cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
258 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
259 |
"Modified: / 23-05-2011 / 15:16:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
260 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
261 |
|
777 | 262 |
javaLangObject |
263 |
^Java classForName:'java.lang.Object'. |
|
264 |
||
265 |
"Created: / 12-05-2011 / 19:09:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
773 | 266 |
! ! |
267 |
||
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
268 |
!AbstractJavaTestCase methodsFor:'refs creation'! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
269 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
270 |
getClassRefIn: aJavaConstantPool withNameAt: nameCPIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
271 |
| result | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
272 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
273 |
result := JavaClassRef2 in: aJavaConstantPool withNameAt: nameCPIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
274 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
275 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
276 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
277 |
"Created: / 12-05-2011 / 19:14:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
278 |
"Modified: / 23-05-2011 / 16:24:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
279 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
280 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
281 |
getFieldRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
282 |
|result| |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
283 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
284 |
result := JavaFieldRef2 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
285 |
in: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
286 |
withNameAndTypeAt: nmIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
287 |
andClassAt: classIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
288 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
289 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
290 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
291 |
"Created: / 23-05-2011 / 16:01:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
292 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
293 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
294 |
getInterfaceMethodRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
295 |
|result| |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
296 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
297 |
result:= JavaInterfaceMethodRef2 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
298 |
in: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
299 |
withNameAndTypeAt: nmIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
300 |
andClassAt: classIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
301 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
302 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
303 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
304 |
"Created: / 23-05-2011 / 15:58:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
305 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
306 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
307 |
getMethodRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
308 |
|result| |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
309 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
310 |
result := JavaMethodRef2 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
311 |
in: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
312 |
withNameAndTypeAt: nmIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
313 |
andClassAt: classIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
314 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
315 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
316 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
317 |
"Created: / 23-05-2011 / 15:58:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
318 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
319 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
320 |
getNameAndTypeIn: cp withNameAt: nameIndex andTypeAt: typeIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
321 |
|result| |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
322 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
323 |
result := JavaNameAndType2 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
324 |
in: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
325 |
withNameAt: nameIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
326 |
andDescriptorAt: typeIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
327 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
328 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
329 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
330 |
"Created: / 23-05-2011 / 16:00:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
331 |
! ! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
332 |
|
774 | 333 |
!AbstractJavaTestCase methodsFor:'running'! |
334 |
||
335 |
setUp |
|
777 | 336 |
self enableMockedExceptionThrowing. |
774 | 337 |
|
338 |
"Created: / 12-05-2011 / 17:30:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
816
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
814
diff
changeset
|
339 |
"Modified: / 23-05-2011 / 18:02:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
774 | 340 |
! |
341 |
||
342 |
tearDown |
|
891 | 343 |
|
777 | 344 |
self disableMockedExceptionThrowing. |
774 | 345 |
|
346 |
"Created: / 12-05-2011 / 17:30:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
891 | 347 |
"Modified: / 08-08-2011 / 17:24:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
774 | 348 |
! ! |
349 |
||
773 | 350 |
!AbstractJavaTestCase class methodsFor:'documentation'! |
351 |
||
352 |
version_SVN |
|
353 |
^ '$Id$' |
|
354 |
! ! |