author | Claus Gittinger <cg@exept.de> |
Wed, 16 Aug 2017 20:22:54 +0200 | |
branch | cvs_MAIN |
changeset 3740 | eb2b40dd162d |
parent 3412 | df11bb428463 |
child 3539 | e546e1df7a01 |
permissions | -rw-r--r-- |
749 | 1 |
" |
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2757
diff
changeset
|
2 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
5 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2757
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
749 | 7 |
SWING Research Group, Czech Technical University in Prague |
8 |
||
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
15 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
19 |
as of 1.9.2010 |
749 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
3330
b14c58b2876c
Oops, moved stray reloading-related methods from stx:libjava/experiments to stx:libjava.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
23 |
"{ NameSpace: Smalltalk }" |
b14c58b2876c
Oops, moved stray reloading-related methods from stx:libjava/experiments to stx:libjava.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
24 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
25 |
JavaRefsAndConstantPoolTestCase subclass:#JavaRuntimeConstantPoolTests |
749 | 26 |
instanceVariableNames:'constantPoolCacheBackup' |
27 |
classVariableNames:'' |
|
28 |
poolDictionaries:'' |
|
29 |
category:'Languages-Java-Tests-RuntimeConstantPool' |
|
30 |
! |
|
31 |
||
32 |
!JavaRuntimeConstantPoolTests class methodsFor:'documentation'! |
|
33 |
||
34 |
copyright |
|
35 |
" |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2757
diff
changeset
|
36 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
37 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
38 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
39 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2757
diff
changeset
|
40 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
749 | 41 |
SWING Research Group, Czech Technical University in Prague |
42 |
||
43 |
This software is furnished under a license and may be used |
|
44 |
only in accordance with the terms of that license and with the |
|
45 |
inclusion of the above copyright notice. This software may not |
|
46 |
be provided or otherwise made available to, or used by, any |
|
47 |
other person. No title to or ownership of the software is |
|
48 |
hereby transferred. |
|
49 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
50 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
51 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
52 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
53 |
as of 1.9.2010 |
749 | 54 |
|
55 |
" |
|
56 |
! ! |
|
57 |
||
58 |
!JavaRuntimeConstantPoolTests methodsFor:'helpers'! |
|
59 |
||
60 |
cleanUpCPCache |
|
61 |
"warning - counting with the fact that cp cache is backed up in setUp and restored in tearDown methods" |
|
62 |
JavaConstantPool allConstantPools: OrderedCollection new. |
|
63 |
||
64 |
"Created: / 13-05-2011 / 09:42:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
65 |
! ! |
|
66 |
||
67 |
!JavaRuntimeConstantPoolTests methodsFor:'running'! |
|
68 |
||
69 |
setUp |
|
70 |
super setUp. |
|
71 |
constantPoolCacheBackup := JavaConstantPool allConstantPools. |
|
72 |
||
73 |
"Created: / 13-05-2011 / 09:33:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
74 |
! |
|
75 |
||
76 |
tearDown |
|
77 |
super tearDown. |
|
78 |
JavaConstantPool allConstantPools: constantPoolCacheBackup. |
|
79 |
||
80 |
"Created: / 13-05-2011 / 09:33:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
81 |
! ! |
|
82 |
||
83 |
!JavaRuntimeConstantPoolTests methodsFor:'tests'! |
|
84 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
85 |
_testConstantPoolCaching |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
86 |
"will be enabled when caching and invalidation is implemented" |
749 | 87 |
| newConstantPool | |
88 |
JavaConstantPool allConstantPools: OrderedCollection new. |
|
89 |
newConstantPool := self getPrettyBigConstantPool. |
|
90 |
self |
|
91 |
assertTrue: (JavaConstantPool allConstantPools includes: newConstantPool). |
|
92 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
93 |
"Created: / 12-04-2012 / 10:16:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
749 | 94 |
! |
95 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
96 |
_testInvalidateAll |
749 | 97 |
| cp | |
98 |
cp := self getPrettyBigConstantPool. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
99 |
cp do: [:each | each isJavaRef ifTrue: [ each resolve ] ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
100 |
cp do: [:each | each isJavaRef ifTrue: [ self assertTrue: (each isResolved) ] ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
101 |
cp invalidateAll. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
102 |
cp do: [:each | each isJavaRef ifTrue: [ self assertTrue: (each isResolved not) ] ]. |
749 | 103 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
104 |
"Created: / 17-11-2012 / 21:44:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
749 | 105 |
! |
106 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
107 |
_testInvalidateForClass |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
108 |
"will be enabled when caching and invalidation is implemented" |
749 | 109 |
| cp | |
110 |
self cleanUpCPCache. |
|
111 |
cp := self getPrettyBigConstantPool. |
|
112 |
cp do: [:each | each isJavaRef ifTrue: [ each resolve ] ]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
113 |
cp do: [:each | each isJavaRef ifTrue: [ self assertTrue: (each isResolved) ] ]. |
2757
66f842986836
cleanup multiple Java class versions handling
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
2731
diff
changeset
|
114 |
JavaConstantPool invalidateForClass: 'Ljava/lang/Runnable;'. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
115 |
1 to: 13 do: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
116 |
:index | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
117 |
(cp at: index) isJavaRef ifTrue: [ self assertTrue: (cp at: index) isResolved ] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
118 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
119 |
14 to: 20 do: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
120 |
:index | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
121 |
(cp at: index) isJavaRef ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
122 |
self assertTrue: (cp at: index) isResolved not |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
123 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
124 |
]. |
749 | 125 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
126 |
"Created: / 12-04-2012 / 10:16:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
2757
66f842986836
cleanup multiple Java class versions handling
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
2731
diff
changeset
|
127 |
"Modified: / 02-10-2013 / 21:08:42 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>" |
749 | 128 |
! ! |
129 |
||
130 |
!JavaRuntimeConstantPoolTests class methodsFor:'documentation'! |
|
131 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
132 |
version_CVS |
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
133 |
^ '$Header: /cvs/stx/stx/libjava/JavaRuntimeConstantPoolTests.st,v 1.6 2015-03-20 12:08:00 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
134 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
135 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
136 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
137 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
138 |
^ '$Changeset: <not expanded> $' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
139 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
140 |
|
749 | 141 |
version_SVN |
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
142 |
^ 'Id' |
2152 | 143 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
144 |