author | hlopkmar |
Mon, 23 May 2011 14:53:35 +0000 | |
branch | jk_new_structure |
changeset 814 | 68df82c46fb0 |
parent 778 | caa3a009f617 |
child 816 | 4e3072021201 |
permissions | -rw-r--r-- |
773 | 1 |
"{ Package: 'stx:libjava' }" |
2 |
||
3 |
TestCase subclass:#AbstractJavaTestCase |
|
4 |
instanceVariableNames:'exceptionThrowerBackup' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'Languages-Java-Tests-RuntimeConstantPool' |
|
8 |
! |
|
9 |
||
10 |
||
11 |
!AbstractJavaTestCase class methodsFor:'resources'! |
|
12 |
||
13 |
resources |
|
14 |
^ Array with: JavaInitializedResource with: JavaTestsResource. |
|
15 |
||
16 |
"Created: / 26-04-2011 / 13:03:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
17 |
! ! |
|
18 |
||
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
19 |
!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
|
20 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
21 |
getClassRefNamed: name |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
22 |
"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
|
23 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
24 |
| cp | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
25 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
26 |
cp := JavaConstantPool new:2. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
27 |
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
|
28 |
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
|
29 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
30 |
^ cp at: 1. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
31 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
32 |
"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
|
33 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
34 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
35 |
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
|
36 |
"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
|
37 |
| cp | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
38 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
39 |
cp := JavaConstantPool new: 6. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
40 |
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
|
41 |
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
|
42 |
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
|
43 |
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
|
44 |
cp at: 5 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
45 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
46 |
getFieldRefIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
47 |
withNameAndTypeAt: 6 andClassAt: 1). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
48 |
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
|
49 |
^ cp at: 5. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
50 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
51 |
"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
|
52 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
53 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
54 |
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
|
55 |
"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
|
56 |
| cp | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
57 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
58 |
cp := JavaConstantPool new: 6. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
59 |
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
|
60 |
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
|
61 |
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
|
62 |
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
|
63 |
cp at: 5 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
64 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
65 |
getInterfaceMethodRefIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
66 |
withNameAndTypeAt: 6 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
67 |
andClassAt: 1). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
68 |
cp at: 6 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
69 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
70 |
getNameAndTypeIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
71 |
withNameAt: 3 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
72 |
andTypeAt: 4). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
73 |
^ cp at: 5. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
74 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
75 |
"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
|
76 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
77 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
78 |
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
|
79 |
"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
|
80 |
| cp | |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
81 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
82 |
cp := JavaConstantPool new: 6. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
83 |
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
|
84 |
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
|
85 |
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
|
86 |
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
|
87 |
cp at: 5 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
88 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
89 |
getMethodRefIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
90 |
withNameAndTypeAt: 6 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
91 |
andClassAt: 1). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
92 |
cp at: 6 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
93 |
put: (self |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
94 |
getNameAndTypeIn: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
95 |
withNameAt: 3 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
96 |
andTypeAt: 4). |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
97 |
^ cp at: 5. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
98 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
99 |
"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
|
100 |
! ! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
101 |
|
773 | 102 |
!AbstractJavaTestCase methodsFor:'helpers'! |
103 |
||
104 |
disableMockedExceptionThrowing |
|
105 |
JavaResolver uniqueInstance exceptionThrower: exceptionThrowerBackup. |
|
106 |
||
107 |
"Created: / 13-04-2011 / 14:11:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
108 |
! |
|
109 |
||
110 |
enableMockedExceptionThrowing |
|
111 |
exceptionThrowerBackup := JavaResolver uniqueInstance exceptionThrower. |
|
112 |
JavaResolver uniqueInstance exceptionThrower: JavaExceptionThrowerMock new. |
|
113 |
||
114 |
"Created: / 13-04-2011 / 14:11:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
115 |
! |
|
116 |
||
117 |
getCrateClassReadStream |
|
118 |
^ ((Filename named: UserPreferences current javaTestsDirectory) |
|
119 |
/ 'libjava' / 'bin' |
|
120 |
/ 'stx' / 'libjava' |
|
121 |
/ 'tests' / 'mocks' |
|
122 |
/ 'Crate.class') readStream. |
|
123 |
||
124 |
"Created: / 10-05-2011 / 12:13:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
125 |
"Modified: / 12-05-2011 / 16:26:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
126 |
! |
|
127 |
||
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
128 |
getPrettyBigConstantPool |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
129 |
| cp | |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
130 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
131 |
cp := JavaConstantPool new: 20. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
132 |
cp at: 1 put: 6. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
133 |
cp at: 2 put: 'Ljava/lang/Object;'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
134 |
cp at: 3 putClassRefWithNameAt: 2. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
135 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
136 |
at: 4 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
137 |
putMethodRefWithClassAt: 3 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
138 |
andNameAndTypeAt: 5. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
139 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
140 |
at: 5 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
141 |
putNameAndTypeWithNameAt: 6 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
142 |
andDescriptorAt: 7. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
143 |
cp at: 6 put: '<init>'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
144 |
cp at: 7 put: '()V'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
145 |
cp at: 8 put: 'Ljava/lang/String;'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
146 |
cp at: 9 putClassRefWithNameAt: 8. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
147 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
148 |
at: 10 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
149 |
putMethodRefWithClassAt: 9 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
150 |
andNameAndTypeAt: 13. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
151 |
cp at: 11 put: 'length'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
152 |
cp at: 12 put: '()I'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
153 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
154 |
at: 13 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
155 |
putNameAndTypeWithNameAt: 11 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
156 |
andDescriptorAt: 12. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
157 |
cp at: 14 putClassRefWithNameAt: 15. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
158 |
cp at: 15 put: 'Ljava/lang/Runnable;'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
159 |
cp at: 16 put: 'run'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
160 |
cp at: 17 put: '()V'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
161 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
162 |
at: 18 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
163 |
putNameAndTypeWithNameAt: 16 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
164 |
andDescriptorAt: 17. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
165 |
cp at: 19 putClassRefWithNameAt: 15. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
166 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
167 |
at: 20 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
168 |
putInterfaceMethodRefWithClassAt: 19 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
169 |
andNameAndTypeAt: 18. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
170 |
^ cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
171 |
|
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
172 |
"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
|
173 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
174 |
|
777 | 175 |
javaLangObject |
176 |
^Java classForName:'java.lang.Object'. |
|
177 |
||
178 |
"Created: / 12-05-2011 / 19:09:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
773 | 179 |
! ! |
180 |
||
814
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
181 |
!AbstractJavaTestCase methodsFor:'refs creation'! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
182 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
183 |
getClassRefIn: aJavaConstantPool withNameAt: nameCPIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
184 |
| result | |
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 |
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
|
187 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
188 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
189 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
190 |
"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
|
191 |
"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
|
192 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
193 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
194 |
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
|
195 |
|result| |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
196 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
197 |
result := JavaFieldRef2 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
198 |
in: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
199 |
withNameAndTypeAt: nmIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
200 |
andClassAt: classIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
201 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
202 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
203 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
204 |
"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
|
205 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
206 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
207 |
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
|
208 |
|result| |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
209 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
210 |
result:= JavaInterfaceMethodRef2 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
211 |
in: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
212 |
withNameAndTypeAt: nmIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
213 |
andClassAt: classIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
214 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
215 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
216 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
217 |
"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
|
218 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
219 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
220 |
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
|
221 |
|result| |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
222 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
223 |
result := JavaMethodRef2 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
224 |
in: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
225 |
withNameAndTypeAt: nmIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
226 |
andClassAt: classIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
227 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
228 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
229 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
230 |
"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
|
231 |
! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
232 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
233 |
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
|
234 |
|result| |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
235 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
236 |
result := JavaNameAndType2 |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
237 |
in: cp |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
238 |
withNameAt: nameIndex |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
239 |
andDescriptorAt: typeIndex. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
240 |
result owner: self javaLangObject. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
241 |
^ result. |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
242 |
|
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
243 |
"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
|
244 |
! ! |
68df82c46fb0
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents:
778
diff
changeset
|
245 |
|
774 | 246 |
!AbstractJavaTestCase methodsFor:'running'! |
247 |
||
248 |
setUp |
|
249 |
JavaClassReader useNewClassReader. |
|
777 | 250 |
self enableMockedExceptionThrowing. |
774 | 251 |
|
252 |
"Created: / 12-05-2011 / 17:30:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
253 |
! |
|
254 |
||
255 |
tearDown |
|
256 |
JavaClassReader useOldClassReader. |
|
777 | 257 |
self disableMockedExceptionThrowing. |
774 | 258 |
|
259 |
"Created: / 12-05-2011 / 17:30:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
260 |
! ! |
|
261 |
||
773 | 262 |
!AbstractJavaTestCase class methodsFor:'documentation'! |
263 |
||
264 |
version_SVN |
|
265 |
^ '$Id$' |
|
266 |
! ! |