author | hlopkmar |
Fri, 30 Nov 2012 20:52:11 +0000 | |
branch | development |
changeset 1844 | 7f4dd9a13c2c |
parent 1829 | 991172ecd928 |
child 1953 | 1e42ad3fc322 |
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 |
" |
758 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
1515 | 23 |
JavaRefsAndConstantPoolTestCase subclass:#JavaFieldRefTests |
758 | 24 |
instanceVariableNames:'' |
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Tests-RuntimeConstantPool' |
|
28 |
! |
|
29 |
||
877 | 30 |
!JavaFieldRefTests 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 |
! ! |
|
758 | 55 |
|
761 | 56 |
!JavaFieldRefTests methodsFor:'permission tests'! |
57 |
||
58 |
testAccessingPPFromOutside |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
59 |
| javaFieldRef initString | |
1509 | 60 |
|
61 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
62 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
63 |
should: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
64 |
[ |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
65 |
javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
66 |
getFieldRefNamed: 'packagePrivateField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
67 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
68 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
69 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
70 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
71 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 72 |
|
73 |
"Created: / 14-04-2011 / 15:05:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
74 |
"Modified: / 23-05-2011 / 16:40:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
1509 | 75 |
"Modified (format): / 05-07-2012 / 17:27:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
761 | 76 |
! |
77 |
||
78 |
testAccessingPPFromPackage |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
79 |
| javaFieldRef initString | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
80 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
81 |
|
761 | 82 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
83 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
84 |
shouldnt: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
85 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
86 |
getFieldRefNamed: 'packagePrivateField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
87 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
88 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
89 |
javaFieldRef owner: (Java classForName: 'stx.libjava.tests.mocks.Crate'). |
761 | 90 |
javaFieldRef resolve. ] |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
91 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
92 |
. |
761 | 93 |
|
94 |
"Created: / 14-04-2011 / 15:08:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
95 |
"Modified: / 23-05-2011 / 16:41:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 96 |
! |
97 |
||
98 |
testAccessingPPFromSubclass |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
99 |
| javaFieldRef initString | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
100 |
|
761 | 101 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
102 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
103 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
104 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
761 | 105 |
self shouldnt: |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
106 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
107 |
getFieldRefNamed: 'packagePrivateField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
108 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
109 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
110 |
javaFieldRef owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
761 | 111 |
javaFieldRef resolve. ] |
112 |
raise: Error. |
|
113 |
||
114 |
"Created: / 14-04-2011 / 15:08:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
115 |
"Modified: / 23-05-2011 / 16:42:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 116 |
! |
117 |
||
118 |
testAccessingPrivateFromOutside |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
119 |
| javaFieldRef initString | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
120 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
121 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
122 |
|
761 | 123 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
124 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
125 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
126 |
should: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
127 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
128 |
getFieldRefNamed: 'privateField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
129 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
130 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
131 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
132 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
133 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 134 |
|
135 |
"Created: / 13-04-2011 / 14:44:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
136 |
"Modified: / 23-05-2011 / 16:42:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 137 |
! |
138 |
||
139 |
testAccessingPrivateFromOutsideInNonPublic |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
140 |
| javaFieldRef initString | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
141 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
142 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
143 |
|
761 | 144 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
145 |
initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
146 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
147 |
should: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
148 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
149 |
getFieldRefNamed: 'privateField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
150 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
151 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
152 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
153 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
154 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 155 |
|
156 |
"Created: / 13-04-2011 / 14:47:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
157 |
"Modified: / 23-05-2011 / 16:43:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 158 |
! |
159 |
||
160 |
testAccessingPrivateFromSubclass |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
161 |
| javaFieldRef initString | |
761 | 162 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
163 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
164 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
165 |
should: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
166 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
167 |
getFieldRefNamed: 'privateField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
168 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
169 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
170 |
javaFieldRef owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
171 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
172 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
173 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 174 |
|
175 |
"Created: / 13-04-2011 / 14:49:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
176 |
"Modified: / 23-05-2011 / 16:45:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 177 |
! |
178 |
||
179 |
testAccessingProtectedFromOutside |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
180 |
| javaFieldRef initString | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
181 |
|
761 | 182 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
183 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
184 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
185 |
should: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
186 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
187 |
getFieldRefNamed: 'protectedField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
188 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
189 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
190 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
191 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
192 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
193 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 194 |
|
195 |
"Created: / 13-04-2011 / 14:44:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
196 |
"Modified: / 23-05-2011 / 16:46:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 197 |
! |
198 |
||
199 |
testAccessingProtectedFromOutsideInNonPublic |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
200 |
| javaFieldRef initString | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
201 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
202 |
|
761 | 203 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
204 |
initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
205 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
206 |
should: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
207 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
208 |
getFieldRefNamed: 'protectedField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
209 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
210 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
211 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
212 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
213 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
214 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 215 |
|
216 |
"Created: / 13-04-2011 / 14:47:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
217 |
"Modified: / 23-05-2011 / 16:46:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 218 |
! |
219 |
||
220 |
testAccessingProtectedFromPackage |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
221 |
| javaFieldRef initString | |
761 | 222 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
223 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
224 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
225 |
shouldnt: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
226 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
227 |
getFieldRefNamed: 'protectedField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
228 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
229 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
230 |
javaFieldRef owner: (Java classForName: 'stx.libjava.tests.mocks.Crate'). |
761 | 231 |
javaFieldRef resolve. ] |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
232 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
233 |
. |
761 | 234 |
|
235 |
"Created: / 14-04-2011 / 15:09:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
236 |
"Modified: / 23-05-2011 / 16:48:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 237 |
! |
238 |
||
239 |
testAccessingProtectedFromSubclass |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
240 |
| javaFieldRef initString | |
761 | 241 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
242 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
243 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
244 |
shouldnt: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
245 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
246 |
getFieldRefNamed: 'protectedField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
247 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
248 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
249 |
javaFieldRef |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
250 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
251 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
252 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
253 |
. |
761 | 254 |
|
255 |
"Created: / 13-04-2011 / 14:49:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
256 |
"Modified: / 23-05-2011 / 16:49:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 257 |
! |
258 |
||
259 |
testAccessingPublicFromOutside |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
260 |
| javaFieldRef initString | |
761 | 261 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
262 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
263 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
264 |
shouldnt: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
265 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
266 |
getFieldRefNamed: 'publicField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
267 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
268 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
269 |
javaFieldRef |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
270 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
761 | 271 |
javaFieldRef resolve. ] |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
272 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
273 |
. |
761 | 274 |
|
275 |
"Created: / 13-04-2011 / 14:44:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
276 |
"Modified: / 23-05-2011 / 16:51:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 277 |
! |
278 |
||
279 |
testAccessingPublicFromOutsideInNonPublic |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
280 |
| javaFieldRef initString | |
761 | 281 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
282 |
initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
283 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
284 |
shouldnt: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
285 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
286 |
getFieldRefNamed: 'publicField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
287 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
288 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
289 |
javaFieldRef |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
290 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
291 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
292 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
293 |
. |
761 | 294 |
|
295 |
"Created: / 13-04-2011 / 14:48:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
296 |
"Modified: / 23-05-2011 / 16:52:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 297 |
! |
298 |
||
299 |
testAccessingPublicFromSubclass |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
300 |
| javaFieldRef initString | |
761 | 301 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
302 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
303 |
self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
304 |
shouldnt: |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
305 |
[ javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
306 |
getFieldRefNamed: 'publicField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
307 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
308 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
309 |
javaFieldRef |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
310 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
311 |
javaFieldRef resolve. ] |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
312 |
raise: Error |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
313 |
. |
761 | 314 |
|
315 |
"Created: / 13-04-2011 / 14:49:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
316 |
"Modified: / 23-05-2011 / 16:52:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 317 |
! ! |
318 |
||
319 |
!JavaFieldRefTests methodsFor:'resolving static tests'! |
|
320 |
||
321 |
testResolvingStatic |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
322 |
| javaFieldRef initString result expectedResult | |
761 | 323 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
324 |
javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
325 |
getFieldRefNamed: 'publicStaticField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
326 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
327 |
inClass: initString. |
1245 | 328 |
result := javaFieldRef resolve. |
761 | 329 |
expectedResult := (Java |
330 |
classForName: 'stx.libjava.tests.mocks.PublicClass') staticFields |
|
331 |
at: 3. |
|
332 |
self assertTrue: (result = expectedResult). |
|
333 |
||
334 |
"Created: / 28-04-2011 / 22:00:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1245 | 335 |
"Modified: / 08-12-2011 / 19:24:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 336 |
! ! |
337 |
||
338 |
!JavaFieldRefTests methodsFor:'resolving tests'! |
|
758 | 339 |
|
340 |
testCorrectInstanceCreation |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
341 |
| initString javaFieldRef | |
758 | 342 |
|
343 |
initString := 'Ljava/lang/String;'. |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
344 |
javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
345 |
getFieldRefNamed: 'value' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
346 |
typed: '[C' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
347 |
inClass: initString. |
758 | 348 |
self assertTrue: (javaFieldRef isResolved not). |
349 |
self assertTrue: (javaFieldRef valueCache isNil). |
|
350 |
self assertTrue: (javaFieldRef name = 'value'). |
|
351 |
self assertTrue: (javaFieldRef descriptor = '[C'). |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
352 |
self assertTrue: (javaFieldRef classRef name = initString). |
758 | 353 |
|
354 |
"Created: / 08-04-2011 / 14:01:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
355 |
"Modified: / 23-05-2011 / 16:28:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 356 |
! |
357 |
||
358 |
testCorrectResolving |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
359 |
| initString javaFieldRef expectedResult result | |
758 | 360 |
|
761 | 361 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
362 |
javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
363 |
getFieldRefNamed: 'publicField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
364 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
365 |
inClass: initString. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
366 |
self assertTrue: (javaFieldRef isResolved not). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
367 |
javaFieldRef resolve. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
368 |
self assertTrue: (javaFieldRef isResolved). |
758 | 369 |
result := javaFieldRef resolve. |
771 | 370 |
expectedResult := (Java |
371 |
classForName: 'stx.libjava.tests.mocks.PublicClass') fields |
|
372 |
at: 3. |
|
758 | 373 |
self assertTrue: (result = expectedResult). |
1829 | 374 |
self assertTrue: (javaFieldRef offset = 4). |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
375 |
self assertTrue: (javaFieldRef type = 'java.lang.String'). |
758 | 376 |
|
377 |
"Created: / 08-04-2011 / 14:07:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1829 | 378 |
"Modified: / 17-11-2012 / 21:44:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 379 |
! |
380 |
||
381 |
testInvalidation |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
382 |
| javaFieldRef initString | |
758 | 383 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
384 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
385 |
javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
386 |
getFieldRefNamed: 'publicField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
387 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
388 |
inClass: initString. |
758 | 389 |
self assertTrue: (javaFieldRef isResolved not). |
390 |
javaFieldRef resolve. |
|
391 |
self assertTrue: (javaFieldRef isResolved). |
|
761 | 392 |
self assertTrue: (javaFieldRef classRef isResolved). |
758 | 393 |
javaFieldRef invalidate. |
394 |
self assertTrue: (javaFieldRef isResolved not). |
|
761 | 395 |
self assertTrue: (javaFieldRef classRef isResolved not). |
758 | 396 |
|
397 |
"Created: / 08-04-2011 / 14:09:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
398 |
"Modified: / 23-05-2011 / 16:30:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 399 |
! |
400 |
||
401 |
testInvalidationForClassNegative |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
402 |
| javaFieldRef initString | |
758 | 403 |
|
761 | 404 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
405 |
javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
406 |
getFieldRefNamed: 'publicField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
407 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
408 |
inClass: initString. |
758 | 409 |
self assertTrue: (javaFieldRef isResolved not). |
410 |
javaFieldRef resolve. |
|
411 |
self assertTrue: (javaFieldRef isResolved). |
|
412 |
javaFieldRef invalidateForClass: 'Ljava/lang/Object;'. |
|
413 |
self assertTrue: (javaFieldRef isResolved). |
|
414 |
||
415 |
"Created: / 08-04-2011 / 16:23:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
416 |
"Modified: / 23-05-2011 / 16:31:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 417 |
! |
418 |
||
419 |
testInvalidationForClassPositive |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
420 |
| javaFieldRef initString | |
758 | 421 |
|
761 | 422 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
423 |
javaFieldRef := self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
424 |
getFieldRefNamed: 'publicField' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
425 |
typed: 'Ljava/lang/String;' |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
426 |
inClass: initString. |
758 | 427 |
self assertTrue: (javaFieldRef isResolved not). |
428 |
javaFieldRef resolve. |
|
429 |
self assertTrue: (javaFieldRef isResolved). |
|
761 | 430 |
javaFieldRef invalidateForClass: 'Lstx/libjava/tests/mocks/PublicClass;'. |
758 | 431 |
self assertTrue: (javaFieldRef isResolved not). |
432 |
||
433 |
"Created: / 08-04-2011 / 16:23:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
434 |
"Modified: / 23-05-2011 / 16:31:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 435 |
! |
436 |
||
437 |
testResolving |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
438 |
| javaFieldRef initString | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
439 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
440 |
javaFieldRef := self getFieldRefNamed: 'publicField' typed:'Ljava/lang/String;' inClass:initString. |
758 | 441 |
|
442 |
self assertTrue: (javaFieldRef isResolved not). |
|
443 |
javaFieldRef resolve. |
|
444 |
self assertTrue: (javaFieldRef isResolved). |
|
445 |
||
446 |
"Created: / 08-04-2011 / 14:04:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
777
diff
changeset
|
447 |
"Modified: / 23-05-2011 / 15:53:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 448 |
! ! |
449 |
||
450 |
!JavaFieldRefTests class methodsFor:'documentation'! |
|
451 |
||
452 |
version_SVN |
|
453 |
^ '$Id$' |
|
454 |
! ! |