author | hlopkmar |
Fri, 13 May 2011 08:01:14 +0000 | |
branch | jk_new_structure |
changeset 778 | caa3a009f617 |
parent 777 | e6e61412ae43 |
child 814 | 68df82c46fb0 |
permissions | -rw-r--r-- |
752 | 1 |
"{ Package: 'stx:libjava' }" |
2 |
||
773 | 3 |
AbstractJavaTestCase subclass:#JavaRuntimeConstantPoolTests |
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
4 |
instanceVariableNames:'constantPoolCacheBackup' |
752 | 5 |
classVariableNames:'' |
6 |
poolDictionaries:'' |
|
7 |
category:'Languages-Java-Tests-RuntimeConstantPool' |
|
8 |
! |
|
9 |
||
10 |
||
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
11 |
!JavaRuntimeConstantPoolTests methodsFor:'helpers'! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
12 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
13 |
cleanUpCPCache |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
14 |
"warning - counting with the fact that cp cache is backed up in setUp and restored in tearDown methods" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
15 |
JavaConstantPool allConstantPools: OrderedCollection new. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
16 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
17 |
"Created: / 13-05-2011 / 09:42:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
18 |
! ! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
19 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
20 |
!JavaRuntimeConstantPoolTests methodsFor:'running'! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
21 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
22 |
setUp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
23 |
super setUp. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
24 |
constantPoolCacheBackup := JavaConstantPool allConstantPools. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
25 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
26 |
"Created: / 13-05-2011 / 09:33:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
27 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
28 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
29 |
tearDown |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
30 |
super tearDown. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
31 |
JavaConstantPool allConstantPools: constantPoolCacheBackup. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
32 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
33 |
"Created: / 13-05-2011 / 09:33:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
34 |
! ! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
35 |
|
771 | 36 |
!JavaRuntimeConstantPoolTests methodsFor:'tests'! |
37 |
||
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
38 |
testConstantPoolCaching |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
39 |
| newConstantPool | |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
40 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
41 |
JavaConstantPool allConstantPools: OrderedCollection new. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
42 |
newConstantPool := self getPrettyBigConstantPool. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
43 |
self |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
44 |
assertTrue: (JavaConstantPool allConstantPools includes: newConstantPool). |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
45 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
46 |
"Created: / 13-05-2011 / 09:36:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
47 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
48 |
|
771 | 49 |
testInvalidateAll |
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
50 |
| cp | |
771 | 51 |
|
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
52 |
cp := self getPrettyBigConstantPool. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
53 |
cp do: [:each | each isJavaRef ifTrue: [each resolve]]. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
54 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
55 |
do: [:each | each isJavaRef ifTrue: [ self assertTrue: (each isResolved) ] ]. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
56 |
cp invalidateAll. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
57 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
58 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
59 |
do: [:each | each isJavaRef ifTrue: [ self assertTrue: (each isResolved not) ] ]. |
771 | 60 |
|
61 |
"Created: / 08-04-2011 / 17:03:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
62 |
"Modified: / 13-05-2011 / 09:48:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
771 | 63 |
! |
64 |
||
65 |
testInvalidateForClass |
|
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
66 |
| cp | |
771 | 67 |
|
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
68 |
self cleanUpCPCache. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
69 |
cp := self getPrettyBigConstantPool. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
70 |
cp do: [:each | each isJavaRef ifTrue: [ each resolve ] ]. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
71 |
cp |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
72 |
do: [:each | each isJavaRef ifTrue: [ self assertTrue: (each isResolved) ] ]. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
73 |
JavaConstantPool invalidateReferencesToClass: 'Ljava/lang/Runnable;'. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
74 |
1 to: 13 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
75 |
do: |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
76 |
[:index | |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
77 |
(cp at: index) isJavaRef |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
78 |
ifTrue: [ self assertTrue: (cp at: index) isResolved ] ]. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
79 |
14 to: 20 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
80 |
do: |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
81 |
[:index | |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
82 |
(cp at: index) isJavaRef |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
83 |
ifTrue: [ self assertTrue: (cp at: index) isResolved not ] ]. |
771 | 84 |
|
85 |
"Created: / 08-04-2011 / 17:10:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
86 |
"Modified: / 13-05-2011 / 09:55:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
771 | 87 |
! ! |
88 |
||
752 | 89 |
!JavaRuntimeConstantPoolTests class methodsFor:'documentation'! |
90 |
||
91 |
version_SVN |
|
92 |
^ '$Id$' |
|
93 |
! ! |