author | vranyj1 |
Wed, 23 Nov 2011 15:26:06 +0000 | |
branch | jk_new_structure |
changeset 1152 | 040cba55a7d2 |
parent 877 | f5a5b93e1c78 |
child 1155 | d6f6d5fc0343 |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 3 |
|
4 |
New code and modification done at SWING Research Group [1]: |
|
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 |
Parts of the code written by Claus Gittinger are under following |
|
10 |
license: |
|
11 |
||
12 |
This software is furnished under a license and may be used |
|
13 |
only in accordance with the terms of that license and with the |
|
14 |
inclusion of the above copyright notice. This software may not |
|
15 |
be provided or otherwise made available to, or used by, any |
|
16 |
other person. No title to or ownership of the software is |
|
17 |
hereby transferred. |
|
18 |
||
19 |
[1] Code written at SWING Research Group contain a signature |
|
1152 | 20 |
of one of the above copright owners. For exact set of such code |
21 |
see the differences between this version and version stx:lib |
|
22 |
as of 1.9.2010 |
|
877 | 23 |
" |
758 | 24 |
"{ Package: 'stx:libjava' }" |
25 |
||
773 | 26 |
AbstractJavaTestCase subclass:#JavaMethodRefTests |
758 | 27 |
instanceVariableNames:'' |
28 |
classVariableNames:'' |
|
29 |
poolDictionaries:'' |
|
30 |
category:'Languages-Java-Tests-RuntimeConstantPool' |
|
31 |
! |
|
32 |
||
877 | 33 |
!JavaMethodRefTests class methodsFor:'documentation'! |
34 |
||
35 |
copyright |
|
36 |
" |
|
37 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 38 |
|
39 |
New code and modification done at SWING Research Group [1]: |
|
40 |
||
877 | 41 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
42 |
SWING Research Group, Czech Technical University in Prague |
|
43 |
||
44 |
Parts of the code written by Claus Gittinger are under following |
|
45 |
license: |
|
46 |
||
47 |
This software is furnished under a license and may be used |
|
48 |
only in accordance with the terms of that license and with the |
|
49 |
inclusion of the above copyright notice. This software may not |
|
50 |
be provided or otherwise made available to, or used by, any |
|
51 |
other person. No title to or ownership of the software is |
|
52 |
hereby transferred. |
|
53 |
||
54 |
[1] Code written at SWING Research Group contain a signature |
|
1152 | 55 |
of one of the above copright owners. For exact set of such code |
56 |
see the differences between this version and version stx:lib |
|
57 |
as of 1.9.2010 |
|
877 | 58 |
|
59 |
" |
|
60 |
! ! |
|
758 | 61 |
|
761 | 62 |
!JavaMethodRefTests methodsFor:'permission tests'! |
63 |
||
64 |
testAccessingPPFromOutside |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
65 |
| javaMethodRef initString | |
761 | 66 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
67 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
68 |
self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
69 |
should: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
70 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
71 |
getMethodRefNamed: 'packagePrivateMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
72 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
73 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
74 |
|
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
75 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
76 |
raise: Error |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
77 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 78 |
|
79 |
"Created: / 14-04-2011 / 15:10:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
80 |
"Modified: / 23-05-2011 / 17:15:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 81 |
! |
82 |
||
83 |
testAccessingPPFromSubclass |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
84 |
| javaMethodRef initString | |
761 | 85 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
86 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
87 |
self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
88 |
shouldnt: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
89 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
90 |
getMethodRefNamed: 'packagePrivateMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
91 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
92 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
93 |
javaMethodRef |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
94 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
95 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
96 |
raise: Error |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
97 |
. |
761 | 98 |
|
99 |
"Created: / 14-04-2011 / 15:10:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
100 |
"Modified: / 23-05-2011 / 17:14:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 101 |
! |
102 |
||
103 |
testAccessingPrivateFromOutside |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
104 |
| javaMethodRef initString | |
761 | 105 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
106 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
107 |
self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
108 |
should: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
109 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
110 |
getMethodRefNamed: 'privateMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
111 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
112 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
113 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
114 |
raise: Error |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
115 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 116 |
|
117 |
"Created: / 13-04-2011 / 14:44:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
118 |
"Modified: / 23-05-2011 / 17:16:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 119 |
! |
120 |
||
121 |
testAccessingPrivateFromOutsideInNonPublic |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
122 |
| javaMethodRef initString | |
761 | 123 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
124 |
initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
125 |
self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
126 |
should: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
127 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
128 |
getMethodRefNamed: 'privateMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
129 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
130 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
131 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
132 |
raise: Error |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
133 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 134 |
|
135 |
"Created: / 13-04-2011 / 14:47:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
136 |
"Modified: / 23-05-2011 / 17:17:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 137 |
! |
138 |
||
139 |
testAccessingPrivateFromSubclass |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
140 |
| javaMethodRef initString | |
761 | 141 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
142 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
143 |
self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
144 |
should: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
145 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
146 |
getMethodRefNamed: 'privateMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
147 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
148 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
149 |
javaMethodRef owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
150 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
151 |
raise: Error |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
152 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 153 |
|
154 |
"Created: / 13-04-2011 / 14:49:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
155 |
"Modified: / 23-05-2011 / 17:13:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 156 |
! |
157 |
||
158 |
testAccessingProtectedFromOutside |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
159 |
| javaMethodRef initString | |
761 | 160 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
161 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
162 |
self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
163 |
should: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
164 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
165 |
getMethodRefNamed: 'protectedMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
166 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
167 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
168 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
169 |
raise: Error |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
170 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 171 |
|
172 |
"Created: / 13-04-2011 / 14:44:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
173 |
"Modified: / 23-05-2011 / 17:12:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 174 |
! |
175 |
||
176 |
testAccessingProtectedFromOutsideInNonPublic |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
177 |
| javaMethodRef initString | |
761 | 178 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
179 |
initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
180 |
self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
181 |
should: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
182 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
183 |
getMethodRefNamed: 'protectedMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
184 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
185 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
186 |
|
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
187 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
188 |
raise: Error |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
189 |
suchThat: [:e | e messageText = 'IllegalAccessError' ]. |
761 | 190 |
|
191 |
"Created: / 13-04-2011 / 14:47:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
192 |
"Modified: / 23-05-2011 / 17:12:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 193 |
! |
194 |
||
195 |
testAccessingProtectedFromPackage |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
196 |
| javaMethodRef initString | |
761 | 197 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
198 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
199 |
self shouldnt: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
200 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
201 |
getMethodRefNamed: 'publicMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
202 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
203 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
204 |
javaMethodRef |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
205 |
owner: (Java classForName: 'stx.libjava.tests.mocks.Crate'). |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
206 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
207 |
raise: Error. |
761 | 208 |
|
209 |
"Created: / 14-04-2011 / 15:09:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
210 |
"Modified: / 23-05-2011 / 17:11:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 211 |
! |
212 |
||
213 |
testAccessingProtectedFromSubclass |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
214 |
| javaMethodRef initString | |
761 | 215 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
216 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
217 |
self shouldnt: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
218 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
219 |
getMethodRefNamed: 'protectedMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
220 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
221 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
222 |
javaMethodRef |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
223 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
224 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
225 |
raise: Error. |
761 | 226 |
|
227 |
"Created: / 13-04-2011 / 14:49:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
228 |
"Modified: / 23-05-2011 / 17:11:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 229 |
! |
230 |
||
231 |
testAccessingPublicFromOutside |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
232 |
| javaMethodRef initString | |
761 | 233 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
234 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
761 | 235 |
self shouldnt: |
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
236 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
237 |
getMethodRefNamed: 'publicMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
238 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
239 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
240 |
javaMethodRef |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
241 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
761 | 242 |
javaMethodRef resolve. ] |
243 |
raise: Error. |
|
244 |
||
245 |
"Created: / 13-04-2011 / 14:44:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
246 |
"Modified: / 23-05-2011 / 17:10:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 247 |
! |
248 |
||
249 |
testAccessingPublicFromOutsideInNonPublic |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
250 |
| javaMethodRef initString | |
761 | 251 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
252 |
initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
253 |
self shouldnt: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
254 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
255 |
getMethodRefNamed: 'publicMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
256 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
257 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
258 |
javaMethodRef |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
259 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
260 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
261 |
raise: Error. |
761 | 262 |
|
263 |
"Created: / 13-04-2011 / 14:48:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
264 |
"Modified: / 23-05-2011 / 17:10:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 265 |
! |
266 |
||
267 |
testAccessingPublicFromSubclass |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
268 |
| javaMethodRef initString | |
761 | 269 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
270 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
271 |
self shouldnt: |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
272 |
[ javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
273 |
getMethodRefNamed: 'publicMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
274 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
275 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
276 |
javaMethodRef |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
277 |
owner: (Java classForName: 'stx.libjava.tests.mocks.SubclassOfPublicClass'). |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
278 |
javaMethodRef resolve. ] |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
279 |
raise: Error. |
761 | 280 |
|
281 |
"Created: / 13-04-2011 / 14:49:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
282 |
"Modified: / 23-05-2011 / 17:10:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
816
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
283 |
! |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
284 |
|
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
285 |
testAccessingPublicInterfaceFromOutside |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
286 |
| javaMethodRef initString | |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
287 |
|
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
288 |
initString := 'Lstx/libjava/tests/mocks/PublicInterface;'. |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
289 |
self should: |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
290 |
[ javaMethodRef := self |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
291 |
getMethodRefNamed: 'publicMethod' |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
292 |
typed: '()Ljava/lang/String;' |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
293 |
inClass: initString. |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
294 |
javaMethodRef |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
295 |
owner: (Java classForName: 'stx.libjava.tests.mocks.PublicClass'). |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
296 |
javaMethodRef resolve. ] |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
297 |
raise: Error suchThat: [:e | e messageText = 'IncompatibleClassChangeError']. |
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
298 |
|
4e3072021201
all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents:
815
diff
changeset
|
299 |
"Created: / 23-05-2011 / 17:54:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 300 |
! ! |
301 |
||
302 |
!JavaMethodRefTests methodsFor:'resolving static tests'! |
|
303 |
||
304 |
testCorrectStaticResolving |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
305 |
| initString javaMethodRef expectedResult result | |
761 | 306 |
|
307 |
initString := 'Lstx/libjava/tests/mocks/PublicClass;'. |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
308 |
|
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
309 |
javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
310 |
getMethodRefNamed: 'publicStaticMethod' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
311 |
typed: '()Ljava/lang/String;' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
312 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
313 |
|
761 | 314 |
result := javaMethodRef resolveStatic. |
315 |
expectedResult := (Java |
|
316 |
classForName: 'stx.libjava.tests.mocks.PublicClass') methodDictionary |
|
317 |
at: #'publicStaticMethod()Ljava/lang/String;'. |
|
318 |
self assertTrue: (result = expectedResult). |
|
319 |
||
320 |
"Created: / 28-04-2011 / 22:46:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
321 |
"Modified: / 23-05-2011 / 17:08:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 322 |
! ! |
323 |
||
324 |
!JavaMethodRefTests methodsFor:'resolving tests'! |
|
758 | 325 |
|
326 |
testCorrectInstanceCreation |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
327 |
| initString javaMethodRef | |
758 | 328 |
|
329 |
initString := 'Ljava/lang/String;'. |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
330 |
javaMethodRef := self getMethodRefNamed: '<init>' typed: '()V' inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
331 |
|
758 | 332 |
self assertTrue: (javaMethodRef isResolved not). |
333 |
self assertTrue: (javaMethodRef valueCache isNil). |
|
334 |
self assertTrue: (javaMethodRef name = '<init>'). |
|
335 |
self assertTrue: (javaMethodRef descriptor = '()V'). |
|
336 |
self assertTrue: (javaMethodRef classRef name = 'Ljava/lang/String;'). |
|
337 |
||
338 |
"Created: / 08-04-2011 / 14:01:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
339 |
"Modified: / 23-05-2011 / 17:03:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 340 |
! |
341 |
||
342 |
testCorrectResolving |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
343 |
| initString javaMethodRef expectedResult result | |
758 | 344 |
|
345 |
initString := 'Ljava/lang/String;'. |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
346 |
javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
347 |
getMethodRefNamed: '<init>' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
348 |
typed: '()V' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
349 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
350 |
|
758 | 351 |
result := javaMethodRef resolve. |
761 | 352 |
expectedResult := (Java classForName: 'java.lang.String') methodDictionary |
353 |
at: #'<init>()V'. |
|
758 | 354 |
self assertTrue: (result = expectedResult). |
355 |
||
356 |
"Created: / 08-04-2011 / 14:07:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
357 |
"Modified: / 23-05-2011 / 17:06:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 358 |
! |
359 |
||
360 |
testInvalidation |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
361 |
| javaMethodRef initString| |
758 | 362 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
363 |
initString := 'Ljava/lang/String;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
364 |
javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
365 |
getMethodRefNamed: '<init>' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
366 |
typed: '()V' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
367 |
inClass: initString. |
758 | 368 |
self assertTrue: (javaMethodRef isResolved not). |
369 |
javaMethodRef resolve. |
|
370 |
self assertTrue: (javaMethodRef isResolved). |
|
761 | 371 |
self assertTrue: (javaMethodRef classRef isResolved). |
758 | 372 |
javaMethodRef invalidate. |
373 |
self assertTrue: (javaMethodRef isResolved not). |
|
761 | 374 |
self assertTrue: (javaMethodRef classRef isResolved not). |
758 | 375 |
|
376 |
"Created: / 08-04-2011 / 14:09:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
377 |
"Modified: / 23-05-2011 / 17:06:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 378 |
! |
379 |
||
380 |
testInvalidationForClassNegative |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
381 |
| javaMethodRef initString| |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
382 |
|
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
383 |
initString := 'Ljava/lang/String;'. |
758 | 384 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
385 |
javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
386 |
getMethodRefNamed: '<init>' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
387 |
typed: '()V' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
388 |
inClass: initString. |
758 | 389 |
self assertTrue: (javaMethodRef isResolved not). |
390 |
javaMethodRef resolve. |
|
391 |
self assertTrue: (javaMethodRef isResolved). |
|
392 |
javaMethodRef invalidateForClass: 'Ljava/lang/Object;'. |
|
393 |
self assertTrue: (javaMethodRef isResolved). |
|
394 |
||
395 |
"Created: / 08-04-2011 / 16:23:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
396 |
"Modified: / 23-05-2011 / 17:07:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 397 |
! |
398 |
||
399 |
testInvalidationForClassPositive |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
400 |
| javaMethodRef initString| |
758 | 401 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
402 |
initString := 'Ljava/lang/String;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
403 |
javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
404 |
getMethodRefNamed: '<init>' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
405 |
typed: '()V' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
406 |
inClass: initString. |
758 | 407 |
self assertTrue: (javaMethodRef isResolved not). |
408 |
javaMethodRef resolve. |
|
409 |
self assertTrue: (javaMethodRef isResolved). |
|
410 |
javaMethodRef invalidateForClass: 'Ljava/lang/String;'. |
|
411 |
self assertTrue: (javaMethodRef isResolved not). |
|
412 |
||
413 |
"Created: / 08-04-2011 / 16:23:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
414 |
"Modified: / 23-05-2011 / 17:07:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 415 |
! |
416 |
||
417 |
testResolving |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
418 |
| initString javaMethodRef | |
758 | 419 |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
420 |
initString := 'Ljava/lang/String;'. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
421 |
javaMethodRef := self |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
422 |
getMethodRefNamed: '<init>' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
423 |
typed: '()V' |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
424 |
inClass: initString. |
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
425 |
|
758 | 426 |
self assertTrue: (javaMethodRef isResolved not). |
427 |
javaMethodRef resolve. |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
428 |
self assertTrue: (javaMethodRef classRef isResolved). |
758 | 429 |
self assertTrue: (javaMethodRef isResolved). |
430 |
||
431 |
"Created: / 08-04-2011 / 14:04:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
815
f98e7173ef67
refactored methodRef tests.. interfaceMethodRefs to come
hlopkmar
parents:
773
diff
changeset
|
432 |
"Modified: / 23-05-2011 / 17:05:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 433 |
! ! |
434 |
||
435 |
!JavaMethodRefTests class methodsFor:'documentation'! |
|
436 |
||
437 |
version_SVN |
|
438 |
^ '$Id$' |
|
439 |
! ! |